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");
|
2005-10-29 04:41:10 +00:00
|
|
|
require_once(BASE."include/incl.php");
|
|
|
|
|
require_once(BASE."include/category.php");
|
|
|
|
|
require_once(BASE."include/application.php");
|
|
|
|
|
require_once(BASE."include/mail.php");
|
|
|
|
|
require_once(BASE."include/monitor.php");
|
2006-02-20 02:51:19 +00:00
|
|
|
require_once(BASE."include/testResults.php");
|
2005-10-29 04:41:10 +00:00
|
|
|
|
2006-06-17 06:10:10 +00:00
|
|
|
$aClean = array(); //filtered user input
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
$aClean['sConfirmed'] = makeSafe($_REQUEST['sConfirmed']);
|
|
|
|
|
$aClean['sWhat'] = makeSafe($_REQUEST['sWhat']);
|
|
|
|
|
$aClean['iCatId'] = makeSafe($_REQUEST['iCatId']);
|
|
|
|
|
$aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
|
|
|
|
|
$aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
|
2006-06-17 06:10:10 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if($aClean['sConfirmed'] != "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
|
|
|
|
|
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit("Not confirmed");
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if($aClean['sWhat'])
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2006-07-06 17:27:54 +00:00
|
|
|
switch($aClean['sWhat'])
|
2005-10-26 02:09:49 +00:00
|
|
|
{
|
|
|
|
|
case "category":
|
|
|
|
|
// delete category and the apps in it
|
2006-07-06 17:27:54 +00:00
|
|
|
$oCategory = new Category($aClean['iCatId']);
|
2005-10-26 02:09:49 +00:00
|
|
|
if(!$oCategory->delete())
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit();
|
2005-10-26 02:09:49 +00:00
|
|
|
else
|
2006-07-06 18:44:56 +00:00
|
|
|
util_redirect_and_exit(BASE."appbrowse.php");
|
2005-10-26 02:09:49 +00:00
|
|
|
break;
|
|
|
|
|
case "appFamily":
|
|
|
|
|
// delete app family & all its versions
|
2006-07-06 17:27:54 +00:00
|
|
|
$oApp = new Application($aClean['iAppId']);
|
2005-10-26 02:09:49 +00:00
|
|
|
if(!$oApp->delete())
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit();
|
2005-10-26 02:09:49 +00:00
|
|
|
else
|
2006-07-06 18:44:56 +00:00
|
|
|
util_redirect_and_exit(BASE."appbrowse.php");
|
2005-10-26 02:09:49 +00:00
|
|
|
break;
|
|
|
|
|
case "appVersion":
|
2006-07-06 17:27:54 +00:00
|
|
|
$oVersion = new Version($aClean['iVersionId']);
|
2005-10-26 02:09:49 +00:00
|
|
|
if(!$oVersion->delete())
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit();
|
2005-10-26 02:09:49 +00:00
|
|
|
else
|
2006-07-06 18:44:56 +00:00
|
|
|
util_redirect_and_exit(BASE."appview.php?iAppId=".$aClean['iAppId']);
|
2005-10-26 02:09:49 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
?>
|