2004-12-12 03:51:51 +00:00
|
|
|
<?php
|
2004-12-25 20:03:34 +00:00
|
|
|
/****************************************************/
|
|
|
|
|
/* code to delete versions, families and categories */
|
|
|
|
|
/****************************************************/
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-25 20:03:34 +00:00
|
|
|
/*
|
|
|
|
|
* application environment
|
|
|
|
|
*/
|
2004-03-15 16:22:00 +00:00
|
|
|
include("path.php");
|
2004-12-25 20:03:34 +00:00
|
|
|
include(BASE."include/incl.php");
|
|
|
|
|
include(BASE."include/category.php");
|
|
|
|
|
include(BASE."include/application.php");
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2005-01-30 23:12:48 +00:00
|
|
|
if(!$_SESSION['current']->hasPriv("admin"))
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
|
|
|
|
errorpage();
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-25 20:03:34 +00:00
|
|
|
if($_REQUEST['confirmed'] != "yes")
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
|
|
|
|
// ask for confirmation
|
|
|
|
|
// could do some Real Damage if someone accidently hits the delete button on the main category :)
|
|
|
|
|
//
|
|
|
|
|
// perhaps we can do this with some javascript, popup
|
|
|
|
|
|
|
|
|
|
errorpage("Not confirmed");
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-25 20:03:34 +00:00
|
|
|
if($_REQUEST['what'])
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2004-12-25 20:03:34 +00:00
|
|
|
switch($_REQUEST['what'])
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
|
|
|
|
case "comment":
|
2005-01-29 17:17:32 +00:00
|
|
|
// TODO: delete a comment
|
|
|
|
|
redirect(BASE."appview.php?appId=".$_REQUEST['appId']."&versionId=".$_REQUEST['versionId']);
|
2004-03-15 16:22:00 +00:00
|
|
|
break;
|
|
|
|
|
case "category":
|
|
|
|
|
// delete category and the apps in it
|
2004-12-25 20:03:34 +00:00
|
|
|
deleteCategory($_REQUEST['catId']);
|
2005-01-29 17:17:32 +00:00
|
|
|
redirect(BASE."appbrowse.php");
|
2004-03-15 16:22:00 +00:00
|
|
|
break;
|
|
|
|
|
case "appFamily":
|
|
|
|
|
// delete app family & all its versions
|
2004-12-25 20:03:34 +00:00
|
|
|
deleteAppFamily($_REQUEST['appId']);
|
2005-01-29 17:17:32 +00:00
|
|
|
redirect(BASE."appbrowse.php");
|
2004-03-15 16:22:00 +00:00
|
|
|
break;
|
|
|
|
|
case "appVersion":
|
|
|
|
|
// delete a version
|
2004-12-25 20:03:34 +00:00
|
|
|
deleteAppVersion($_REQUEST['versionId']);
|
2005-01-29 17:17:32 +00:00
|
|
|
redirect(BASE."appview.php?appId=".$_REQUEST['appId']);
|
2004-03-15 16:22:00 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|