Remove unnecessary exit calls after redirect() and util_show_error_page() calls

This commit is contained in:
Jonathan Ernst
2006-07-06 17:59:52 +00:00
committed by WineHQ
parent 735a2bc65f
commit 54c484de8c
36 changed files with 17 additions and 153 deletions

View File

@@ -27,7 +27,6 @@ if(!$_SESSION['current']->hasPriv("admin") &&
!$_SESSION['current']->isSuperMaintainer($aClean['iAppId']))
{
util_show_error_page("Insufficient Privileges!");
exit;
}
//set link for version
@@ -45,7 +44,6 @@ if($aClean['sSub'] == "Submit")
{
$oNote->create();
redirect(apidb_fullurl("appview.php?".$sVersionLink));
exit;
}
else if($aClean['sSub'] == 'Preview' OR empty($aClean['sSubmit']))
{

View File

@@ -12,10 +12,8 @@ $aClean['iParentId'] = makeSafe($_REQUEST['iParentId']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page();
exit;
}
$oCat = new Category($aClean['iCatId']);
if($aClean['sSubmit'])
{

View File

@@ -20,10 +20,7 @@ $aClean['sReject'] = makeSafe($_REQUEST['sReject']);
// deny access if not admin or at least some kind of maintainer
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer())
{
util_show_error_page("Insufficient privileges.");
exit;
}
// shows the list of appdata in queue
if (!$aClean['iId'])

View File

@@ -132,10 +132,8 @@ function display_move_test_to_versions_table($aVersionsIds,$icurrentVersionId)
//deny access if not logged in or not a super maintainer of any applications
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isSuperMaintainer())
{
util_show_error_page("Insufficient privileges.");
exit;
}
$oTest = new testData($aClean['iTestingId']);
if ($aClean['sSub'])
@@ -144,10 +142,7 @@ if ($aClean['sSub'])
{
/* make sure the user is authorized to view this application request */
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page("Insufficient privileges.");
exit;
}
$oApp = new Application($aClean['iAppId']);
@@ -164,10 +159,8 @@ if ($aClean['sSub'])
/* make sure the user has permission to view this version */
$oVersion = new Version($aClean['iVersionId']);
if(!$_SESSION['current']->hasAppVersionModifyPermission($oVersion))
{
util_show_error_page("Insufficient privileges.");
exit;
}
} else
{
//error no Id!

View File

@@ -22,10 +22,7 @@ $aClean['iPage'] = makeSafe($_REQUEST['iPage']);
// deny access if not logged in
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page("Insufficient privileges.");
exit;
}
if ($aClean['sSub'])
{
@@ -40,7 +37,6 @@ if ($aClean['sSub'])
$oBuglink->unqueue();
}
redirect($_SERVER['PHP_SELF']."?iItemsPerPage=".$aClean['iItemsPerPage']."&sQueuedOnly=".$aClean['sQueuedOnly']."&ipage=".$aClean['iPage']);
exit;
}
{

View File

@@ -20,10 +20,8 @@ $aClean['sReject'] = makeSafe( $_REQUEST['sReject'] );
$aClean['sReplyText'] = makeSafe( $_REQUEST['sReplyText'] );
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page("Insufficient privileges.");
exit;
}
if ($aClean['sSub'])
{

View File

@@ -16,10 +16,7 @@ $aClean['iMaintainerId'] = makeSafe($_REQUEST['iMaintainerId']);
// deny access if not logged in
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page("Insufficient privileges.");
exit;
}
apidb_header("Admin Maintainers");
echo '<form name="sQform" action="adminMaintainers.php" method="post" enctype="multipart/form-data">',"\n";

View File

@@ -21,10 +21,8 @@ $aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
// deny access if not admin
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page("Insufficient privileges.");
exit;
}
/*
* We issued a delete command.
*/
@@ -40,8 +38,6 @@ if($aClean['sCmd'])
redirect($_SERVER['PHP_SELF'].
"?iItemsPerPage=".$aClean['iItemsPerPage'].
"&iPage=".$aClean['iPage']);
exit;
}

View File

@@ -21,10 +21,7 @@ if ($aClean['sSub'])
$oTest = new testData($aClean['iTestingId']);
$oVersion = new Version($oTest->iVersionId);
if(!($_SESSION['current']->hasAppVersionModifyPermission($oVersion)))
{
util_show_error_page("Insufficient privileges.");
exit;
}
if(($aClean['sSub'] == 'Submit') || ($aClean['sSub'] == 'Save') ||
($aClean['sSub'] == 'Reject') || ($aClean['sSub'] == 'Delete'))

View File

@@ -18,10 +18,8 @@ $aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
apidb_header("Admin Users Management");
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page("Insufficient privileges.");
exit;
}
// we want to delete a user
if($aClean['sAction'] == "delete" && is_numeric($aClean['iUserId']))

View File

@@ -16,16 +16,10 @@ $aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
if(!is_numeric($aClean['iAppId']))
{
util_show_error_page("Wrong ID");
exit;
}
if(!($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isSuperMaintainer($aClean['iAppId'])))
{
util_show_error_page("Insufficient Privileges!");
exit;
}
if(!empty($aClean['sSubmit']))
{

View File

@@ -16,20 +16,14 @@ $aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
$aClean['sPreview'] = makeSafe($_REQUEST['sPreview']);
if(!is_numeric($aClean['iNoteId']))
{
util_show_error_page('Wrong note ID');
exit;
}
/* Get note data */
$oNote = new Note($aClean['iNoteId']);
/* Check for privs */
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($oNote->iVersionId) && !$_SESSION['current']->isSuperMaintainer($oNote->iAppId))
{
util_show_error_page("Insufficient Privileges!");
exit;
}
if(!empty($aClean['sSub']))
{

View File

@@ -12,17 +12,11 @@ $aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
if(!is_numeric($aClean['iAppId']) OR !is_numeric($aClean['iVersionId']))
{
util_show_error_page("Wrong ID");
exit;
}
/* Check for admin privs */
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($aClean['iVersionId']) && !$_SESSION['current']->isSuperMaintainer($aClean['iAppId']))
{
util_show_error_page("Insufficient Privileges!");
exit;
}
/* process the changes the user entered into the web form */
if(!empty($aClean['sSubmit']))

View File

@@ -4,10 +4,7 @@ include("path.php");
include(BASE."include/"."incl.php");
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page();
exit;
}
function build_app_list()
{

View File

@@ -9,10 +9,7 @@ $aClean['iDistributionId'] = makeSafe($_REQUEST['iDistributionId']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page("Insufficient privileges.");
exit;
}
$oDistribution = new distribution($aClean['iDistributionId']);
@@ -28,7 +25,6 @@ if($aClean['sSubmit'])
}
redirect(apidb_fullurl("distributionView.php"));
exit;
}
else
{

View File

@@ -10,10 +10,7 @@ $aClean['sName'] = makeSafe($_REQUEST['sName']);
$aClean['sWebpage'] = makeSafe($_REQUEST['sWebpage']);
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page();
exit;
}
$oVendor = new Vendor($aClean['iVendorId']);
if($aClean['sSubmit'])

View File

@@ -12,17 +12,11 @@ $aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
$aClean['sAction'] = makeSafe($_REQUEST['sAction']);
if(!is_numeric($aClean['iAppId']) OR !is_numeric($aClean['iVersionId']))
{
util_show_error_page("Wrong ID");
exit;
}
/* Check for admin privs */
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page("Insufficient Privileges!");
exit;
}
if(!empty($aClean['sAction']))
{