- supermaintainers where not able to delete versions
- maintainers where not able to delete comments
This commit is contained in:
@@ -12,12 +12,6 @@ include(BASE."include/category.php");
|
|||||||
include(BASE."include/application.php");
|
include(BASE."include/application.php");
|
||||||
include(BASE."include/mail.php");
|
include(BASE."include/mail.php");
|
||||||
|
|
||||||
if(!$_SESSION['current']->hasPriv("admin"))
|
|
||||||
{
|
|
||||||
errorpage();
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($_REQUEST['confirmed'] != "yes")
|
if($_REQUEST['confirmed'] != "yes")
|
||||||
{
|
{
|
||||||
// ask for confirmation
|
// ask for confirmation
|
||||||
@@ -34,26 +28,53 @@ if($_REQUEST['what'])
|
|||||||
{
|
{
|
||||||
case "comment":
|
case "comment":
|
||||||
$oComment = new Comment($_REQUEST['commentId']);
|
$oComment = new Comment($_REQUEST['commentId']);
|
||||||
|
if( !$_SESSION['current']->isMaintainer($oComment->iVersionId)
|
||||||
|
&& !$_SESSION['current']->isSuperMaintainer($oComment->iAppId)
|
||||||
|
&& !$_SESSION['current']->hasPriv("admin") )
|
||||||
|
{
|
||||||
|
errorpage();
|
||||||
|
} else
|
||||||
|
{
|
||||||
$oComment->delete();
|
$oComment->delete();
|
||||||
redirect(BASE."appview.php?appId=".$_REQUEST['appId']."&versionId=".$_REQUEST['versionId']);
|
redirect(BASE."appview.php?appId=".$_REQUEST['appId']."&versionId=".$_REQUEST['versionId']);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "category":
|
case "category":
|
||||||
// delete category and the apps in it
|
// delete category and the apps in it
|
||||||
$oCategory = new Category($_REQUEST['catId']);
|
$oCategory = new Category($_REQUEST['catId']);
|
||||||
|
if( !$_SESSION['current']->hasPriv("admin") )
|
||||||
|
{
|
||||||
|
errorpage();
|
||||||
|
} else
|
||||||
|
{
|
||||||
$oCategory->delete();
|
$oCategory->delete();
|
||||||
redirect(BASE."appbrowse.php");
|
redirect(BASE."appbrowse.php");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "appFamily":
|
case "appFamily":
|
||||||
// delete app family & all its versions
|
// delete app family & all its versions
|
||||||
$oApp = new Application($_REQUEST['appId']);
|
$oApp = new Application($_REQUEST['appId']);
|
||||||
|
if( !$_SESSION['current']->hasPriv("admin") )
|
||||||
|
{
|
||||||
|
errorpage();
|
||||||
|
} else
|
||||||
|
{
|
||||||
$oApp->delete();
|
$oApp->delete();
|
||||||
redirect(BASE."appbrowse.php");
|
redirect(BASE."appbrowse.php");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "appVersion":
|
case "appVersion":
|
||||||
// delete a version
|
// delete a version
|
||||||
$oVersion = new Version($_REQUEST['versionId']);
|
$oVersion = new Version($_REQUEST['versionId']);
|
||||||
|
if( !$_SESSION['current']->isSuperMaintainer($oVersion->iAppId)
|
||||||
|
&& !$_SESSION['current']->hasPriv("admin") )
|
||||||
|
{
|
||||||
|
errorpage();
|
||||||
|
} else
|
||||||
|
{
|
||||||
$oVersion->delete();
|
$oVersion->delete();
|
||||||
redirect(BASE."appview.php?appId=".$_REQUEST['appId']);
|
redirect(BASE."appview.php?appId=".$_REQUEST['appId']);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user