This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
qemudb/admin/deleteAny.php

69 lines
1.8 KiB
PHP
Raw Normal View History

<?php
/****************************************************/
/* code to delete versions, families and categories */
/****************************************************/
2004-03-15 16:22:00 +00:00
/*
* application environment
*/
2004-03-15 16:22:00 +00:00
include("path.php");
include(BASE."include/incl.php");
include(BASE."include/category.php");
include(BASE."include/application.php");
include(BASE."include/mail.php");
2004-03-15 16:22:00 +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");
}
if($_REQUEST['what'])
2004-03-15 16:22:00 +00:00
{
switch($_REQUEST['what'])
2004-03-15 16:22:00 +00:00
{
case "category":
// delete category and the apps in it
$oCategory = new Category($_REQUEST['catId']);
if( !$_SESSION['current']->hasPriv("admin") )
{
errorpage();
} else
{
$oCategory->delete();
redirect(BASE."appbrowse.php");
}
2004-03-15 16:22:00 +00:00
break;
case "appFamily":
// delete app family & all its versions
$oApp = new Application($_REQUEST['appId']);
if( !$_SESSION['current']->hasPriv("admin") )
{
errorpage();
} else
{
$oApp->delete();
redirect(BASE."appbrowse.php");
}
2004-03-15 16:22:00 +00:00
break;
case "appVersion":
// delete a version
2005-02-19 01:19:07 +00:00
$oVersion = new Version($_REQUEST['versionId']);
if( !$_SESSION['current']->isSuperMaintainer($oVersion->iAppId)
&& !$_SESSION['current']->hasPriv("admin") )
{
errorpage();
} else
{
$oVersion->delete();
redirect(BASE."appview.php?appId=".$_REQUEST['appId']);
}
2004-03-15 16:22:00 +00:00
break;
}
}
?>