Rename util_show_error_page() to util_show_error_page_and_exit() and redirect() to util_redirect_and_exit()

so it is explicit that we exit in those functions that so we know it isn't necessary to put an exit after
we call them
This commit is contained in:
Jonathan Ernst
2006-07-06 18:44:56 +00:00
committed by WineHQ
parent a34058b924
commit 3096e63828
41 changed files with 119 additions and 120 deletions

View File

@@ -67,10 +67,10 @@ function do_account($sCmd = null)
if($_SESSION['current']) if($_SESSION['current'])
$_SESSION['current']->logout(); $_SESSION['current']->logout();
redirect(apidb_fullurl("index.php")); util_redirect_and_exit(apidb_fullurl("index.php"));
} }
// not valid command, display error page // not valid command, display error page
util_show_error_page("Internal Error","This module was called with incorrect parameters"); util_show_error_page_and_exit("Internal Error","This module was called with incorrect parameters");
} }
/** /**
@@ -129,7 +129,7 @@ function cmd_do_new()
$oUser->login($aClean['sUserEmail'], $aClean['sUserPassword']); $oUser->login($aClean['sUserEmail'], $aClean['sUserPassword']);
addmsg("Account created! (".$aClean['sUserEmail'].")", "green"); addmsg("Account created! (".$aClean['sUserEmail'].")", "green");
redirect(apidb_fullurl()); util_redirect_and_exit(apidb_fullurl());
} }
else if($iResult == USER_CREATE_EXISTS) else if($iResult == USER_CREATE_EXISTS)
{ {
@@ -162,7 +162,7 @@ function cmd_send_passwd()
{ {
addmsg("Please enter your email address in the 'E-mail' field and re-request a new password", addmsg("Please enter your email address in the 'E-mail' field and re-request a new password",
"green"); "green");
redirect(apidb_fullurl("account.php?cmd=login")); util_redirect_and_exit(apidb_fullurl("account.php?cmd=login"));
} }
$shNote = '(<b>Note</b>: accounts for <b>appdb</b>.winehq.org and <b>bugs</b>.winehq.org ' $shNote = '(<b>Note</b>: accounts for <b>appdb</b>.winehq.org and <b>bugs</b>.winehq.org '
@@ -202,7 +202,7 @@ function cmd_send_passwd()
.$shNote, "red"); .$shNote, "red");
} }
redirect(apidb_fullurl("account.php?sCmd=login")); util_redirect_and_exit(apidb_fullurl("account.php?sCmd=login"));
} }
/** /**
@@ -221,7 +221,7 @@ function cmd_do_login()
if($iResult == SUCCESS) if($iResult == SUCCESS)
{ {
addmsg("You are successfully logged in as '$oUser->sRealname'.", "green"); addmsg("You are successfully logged in as '$oUser->sRealname'.", "green");
redirect(apidb_fullurl("index.php")); util_redirect_and_exit(apidb_fullurl("index.php"));
} else } else
{ {
retry("login","Login failed ".$shNote); retry("login","Login failed ".$shNote);

View File

@@ -33,7 +33,7 @@ if(!$_SESSION['current']->isLoggedIn())
} }
if( !is_numeric($aClean['iVersionId']) ) if( !is_numeric($aClean['iVersionId']) )
util_show_error_page('Internal Database Access Error'); util_show_error_page_and_exit('Internal Database Access Error');
if(!is_numeric($aClean['iThread'])) if(!is_numeric($aClean['iThread']))
{ {
@@ -45,7 +45,7 @@ if(!empty($aClean['sBody']))
{ {
$oComment = new Comment(); $oComment = new Comment();
$oComment->create($aClean['sSubject'], $aClean['sBody'], $aClean['iThread'], $aClean['iVersionId']); $oComment->create($aClean['sSubject'], $aClean['sBody'], $aClean['iThread'], $aClean['iVersionId']);
redirect(apidb_fullurl("appview.php?iVersionId=".$oComment->iVersionId)); util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$oComment->iVersionId));
// let's show the comment form // let's show the comment form
} else } else
{ {

View File

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

View File

@@ -12,13 +12,13 @@ $aClean['iParentId'] = makeSafe($_REQUEST['iParentId']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']); $aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
if(!$_SESSION['current']->hasPriv("admin")) if(!$_SESSION['current']->hasPriv("admin"))
util_show_error_page(); util_show_error_page_and_exit();
$oCat = new Category($aClean['iCatId']); $oCat = new Category($aClean['iCatId']);
if($aClean['sSubmit']) if($aClean['sSubmit'])
{ {
$oCat->update($aClean['sName'],$aClean['sDescription'],$aClean['iParentId']); $oCat->update($aClean['sName'],$aClean['sDescription'],$aClean['iParentId']);
redirect(apidb_fullurl("appbrowse.php?iCatId=".$oCat->iCatId)); util_redirect_and_exit(apidb_fullurl("appbrowse.php?iCatId=".$oCat->iCatId));
} }
else else
{ {

View File

@@ -20,7 +20,7 @@ $aClean['sReject'] = makeSafe($_REQUEST['sReject']);
// deny access if not admin or at least some kind of maintainer // deny access if not admin or at least some kind of maintainer
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer()) if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer())
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
// shows the list of appdata in queue // shows the list of appdata in queue
if (!$aClean['iId']) if (!$aClean['iId'])
@@ -190,7 +190,7 @@ if (!$aClean['iId'])
} }
} }
} }
redirect(apidb_fullurl("admin/adminAppDataQueue.php")); util_redirect_and_exit(apidb_fullurl("admin/adminAppDataQueue.php"));
} elseif ($aClean['sReject']) } elseif ($aClean['sReject'])
{ {
if($obj_row->type == "image") if($obj_row->type == "image")
@@ -216,7 +216,7 @@ if (!$aClean['iId'])
echo "<p>Application data was successfully deleted from the Queue.</p>\n"; echo "<p>Application data was successfully deleted from the Queue.</p>\n";
} }
} }
redirect(apidb_fullurl("admin/adminAppDataQueue.php")); util_redirect_and_exit(apidb_fullurl("admin/adminAppDataQueue.php"));
} }
} }
echo html_frame_end("&nbsp;"); echo html_frame_end("&nbsp;");

View File

@@ -132,7 +132,7 @@ function display_move_test_to_versions_table($aVersionsIds,$icurrentVersionId)
//deny access if not logged in or not a super maintainer of any applications //deny access if not logged in or not a super maintainer of any applications
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isSuperMaintainer()) if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isSuperMaintainer())
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
$oTest = new testData($aClean['iTestingId']); $oTest = new testData($aClean['iTestingId']);
@@ -142,7 +142,7 @@ if ($aClean['sSub'])
{ {
/* make sure the user is authorized to view this application request */ /* make sure the user is authorized to view this application request */
if(!$_SESSION['current']->hasPriv("admin")) if(!$_SESSION['current']->hasPriv("admin"))
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
$oApp = new Application($aClean['iAppId']); $oApp = new Application($aClean['iAppId']);
@@ -159,13 +159,13 @@ if ($aClean['sSub'])
/* make sure the user has permission to view this version */ /* make sure the user has permission to view this version */
$oVersion = new Version($aClean['iVersionId']); $oVersion = new Version($aClean['iVersionId']);
if(!$_SESSION['current']->hasAppVersionModifyPermission($oVersion)) if(!$_SESSION['current']->hasAppVersionModifyPermission($oVersion))
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
} else } else
{ {
//error no Id! //error no Id!
addmsg("Application Not Found!", "red"); addmsg("Application Not Found!", "red");
redirect(apidb_fullurl("admin/adminAppQueue.php")); util_redirect_and_exit(apidb_fullurl("admin/adminAppQueue.php"));
} }
// Get the Testing results if they exist // Get the Testing results if they exist
@@ -205,7 +205,7 @@ if ($aClean['sSub'])
$oVersion->unQueue(); $oVersion->unQueue();
$oTest->update(true); $oTest->update(true);
$oTest->unQueue(); $oTest->unQueue();
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
else if ($aClean['sSub'] == 'duplicate') else if ($aClean['sSub'] == 'duplicate')
{ {
@@ -222,7 +222,7 @@ if ($aClean['sSub'])
} }
/* redirect back to the main page */ /* redirect back to the main page */
redirect(apidb_fullurl("admin/adminAppQueue.php")); util_redirect_and_exit(apidb_fullurl("admin/adminAppQueue.php"));
} }
else if ($aClean['sSub'] == 'movetest') else if ($aClean['sSub'] == 'movetest')
{ {
@@ -239,7 +239,7 @@ if ($aClean['sSub'])
} }
// redirect back to the main page // redirect back to the main page
redirect(apidb_fullurl("admin/adminAppQueue.php")); util_redirect_and_exit(apidb_fullurl("admin/adminAppQueue.php"));
} }
else if ($aClean['sSub'] == 'Delete') else if ($aClean['sSub'] == 'Delete')
{ {
@@ -258,7 +258,7 @@ if ($aClean['sSub'])
$oVersion->delete(); $oVersion->delete();
} }
redirect(apidb_fullurl("admin/adminAppQueue.php")); util_redirect_and_exit(apidb_fullurl("admin/adminAppQueue.php"));
} }
else if ($aClean['sSub'] == 'Reject') else if ($aClean['sSub'] == 'Reject')
{ {
@@ -277,7 +277,7 @@ if ($aClean['sSub'])
$oVersion->reject(); $oVersion->reject();
$oTest->update(true); $oTest->update(true);
$oTest->reject(); $oTest->reject();
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
//process according to sub flag //process according to sub flag
@@ -422,7 +422,7 @@ if ($aClean['sSub'])
{ {
//error no sub! //error no sub!
addmsg("Internal Routine Not Found!!", "red"); addmsg("Internal Routine Not Found!!", "red");
redirect(apidb_fullurl("admin/adminAppQueue.php")); util_redirect_and_exit(apidb_fullurl("admin/adminAppQueue.php"));
} }
} }
else /* if ($aClean['sSub']) is not defined, display the main app queue page */ else /* if ($aClean['sSub']) is not defined, display the main app queue page */

View File

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

View File

@@ -20,7 +20,7 @@ $aClean['sReject'] = makeSafe( $_REQUEST['sReject'] );
$aClean['sReplyText'] = makeSafe( $_REQUEST['sReplyText'] ); $aClean['sReplyText'] = makeSafe( $_REQUEST['sReplyText'] );
if(!$_SESSION['current']->hasPriv("admin")) if(!$_SESSION['current']->hasPriv("admin"))
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
if ($aClean['sSub']) if ($aClean['sSub'])
@@ -40,7 +40,7 @@ if ($aClean['sSub'])
else else
{ {
//error no Id! //error no Id!
util_show_error_page("<p><b>QueueId Not Found!</b></p>"); util_show_error_page_and_exit("<p><b>QueueId Not Found!</b></p>");
} }
//process according to which request was submitted and optionally the sub flag //process according to which request was submitted and optionally the sub flag

View File

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

View File

@@ -21,7 +21,7 @@ $aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
// deny access if not admin // deny access if not admin
if(!$_SESSION['current']->hasPriv("admin")) if(!$_SESSION['current']->hasPriv("admin"))
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
/* /*
* We issued a delete command. * We issued a delete command.
@@ -35,7 +35,7 @@ if($aClean['sCmd'])
$oScreenshot->delete(); $oScreenshot->delete();
$oScreenshot->free(); $oScreenshot->free();
} }
redirect($_SERVER['PHP_SELF']. util_redirect_and_exit($_SERVER['PHP_SELF'].
"?iItemsPerPage=".$aClean['iItemsPerPage']. "?iItemsPerPage=".$aClean['iItemsPerPage'].
"&iPage=".$aClean['iPage']); "&iPage=".$aClean['iPage']);
} }

View File

@@ -21,7 +21,7 @@ if ($aClean['sSub'])
$oTest = new testData($aClean['iTestingId']); $oTest = new testData($aClean['iTestingId']);
$oVersion = new Version($oTest->iVersionId); $oVersion = new Version($oTest->iVersionId);
if(!($_SESSION['current']->hasAppVersionModifyPermission($oVersion))) if(!($_SESSION['current']->hasAppVersionModifyPermission($oVersion)))
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
if(($aClean['sSub'] == 'Submit') || ($aClean['sSub'] == 'Save') || if(($aClean['sSub'] == 'Submit') || ($aClean['sSub'] == 'Save') ||
($aClean['sSub'] == 'Reject') || ($aClean['sSub'] == 'Delete')) ($aClean['sSub'] == 'Reject') || ($aClean['sSub'] == 'Delete'))
@@ -47,7 +47,7 @@ if ($aClean['sSub'])
$oTest->delete(); $oTest->delete();
} }
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
} }
@@ -138,7 +138,7 @@ if ($aClean['sSub'])
{ {
// error no sub! // error no sub!
addmsg("Internal Routine Not Found!!", "red"); addmsg("Internal Routine Not Found!!", "red");
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
} }
else // if ($aClean['sSub']) is not defined, display the Testing results queue page else // if ($aClean['sSub']) is not defined, display the Testing results queue page

View File

@@ -18,7 +18,7 @@ $aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
apidb_header("Admin Users Management"); apidb_header("Admin Users Management");
if(!$_SESSION['current']->hasPriv("admin")) if(!$_SESSION['current']->hasPriv("admin"))
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
// we want to delete a user // we want to delete a user

View File

@@ -29,7 +29,7 @@ if($aClean['sConfirmed'] != "yes")
// //
// perhaps we can do this with some javascript, popup // perhaps we can do this with some javascript, popup
util_show_error_page("Not confirmed"); util_show_error_page_and_exit("Not confirmed");
} }
if($aClean['sWhat']) if($aClean['sWhat'])
@@ -40,24 +40,24 @@ if($aClean['sWhat'])
// delete category and the apps in it // delete category and the apps in it
$oCategory = new Category($aClean['iCatId']); $oCategory = new Category($aClean['iCatId']);
if(!$oCategory->delete()) if(!$oCategory->delete())
util_show_error_page(); util_show_error_page_and_exit();
else else
redirect(BASE."appbrowse.php"); util_redirect_and_exit(BASE."appbrowse.php");
break; break;
case "appFamily": case "appFamily":
// delete app family & all its versions // delete app family & all its versions
$oApp = new Application($aClean['iAppId']); $oApp = new Application($aClean['iAppId']);
if(!$oApp->delete()) if(!$oApp->delete())
util_show_error_page(); util_show_error_page_and_exit();
else else
redirect(BASE."appbrowse.php"); util_redirect_and_exit(BASE."appbrowse.php");
break; break;
case "appVersion": case "appVersion":
$oVersion = new Version($aClean['iVersionId']); $oVersion = new Version($aClean['iVersionId']);
if(!$oVersion->delete()) if(!$oVersion->delete())
util_show_error_page(); util_show_error_page_and_exit();
else else
redirect(BASE."appview.php?iAppId=".$aClean['iAppId']); util_redirect_and_exit(BASE."appview.php?iAppId=".$aClean['iAppId']);
break; break;
} }
} }

View File

@@ -16,15 +16,15 @@ $aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']); $aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
if(!is_numeric($aClean['iAppId'])) if(!is_numeric($aClean['iAppId']))
util_show_error_page("Wrong ID"); util_show_error_page_and_exit("Wrong ID");
if(!($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isSuperMaintainer($aClean['iAppId']))) if(!($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isSuperMaintainer($aClean['iAppId'])))
util_show_error_page("Insufficient Privileges!"); util_show_error_page_and_exit("Insufficient Privileges!");
if(!empty($aClean['sSubmit'])) if(!empty($aClean['sSubmit']))
{ {
process_app_version_changes(false); process_app_version_changes(false);
redirect(apidb_fullurl("appview.php?iAppId={$aClean['iAppId']}")); util_redirect_and_exit(apidb_fullurl("appview.php?iAppId={$aClean['iAppId']}"));
} }
else else
// Show the form for editing the Application Family // Show the form for editing the Application Family
@@ -36,7 +36,7 @@ else
if(!$oApp) if(!$oApp)
{ {
util_show_error_page('Application does not exist'); util_show_error_page_and_exit('Application does not exist');
} }
if($_SESSION['current']->showDebuggingInfos()) { echo "<p align=center><b>appName:</b> $oApp->sName </p>"; } if($_SESSION['current']->showDebuggingInfos()) { echo "<p align=center><b>appName:</b> $oApp->sName </p>"; }

View File

@@ -16,14 +16,14 @@ $aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
$aClean['sPreview'] = makeSafe($_REQUEST['sPreview']); $aClean['sPreview'] = makeSafe($_REQUEST['sPreview']);
if(!is_numeric($aClean['iNoteId'])) if(!is_numeric($aClean['iNoteId']))
util_show_error_page('Wrong note ID'); util_show_error_page_and_exit('Wrong note ID');
/* Get note data */ /* Get note data */
$oNote = new Note($aClean['iNoteId']); $oNote = new Note($aClean['iNoteId']);
/* Check for privs */ /* Check for privs */
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($oNote->iVersionId) && !$_SESSION['current']->isSuperMaintainer($oNote->iAppId)) if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($oNote->iVersionId) && !$_SESSION['current']->isSuperMaintainer($oNote->iAppId))
util_show_error_page("Insufficient Privileges!"); util_show_error_page_and_exit("Insufficient Privileges!");
if(!empty($aClean['sSub'])) if(!empty($aClean['sSub']))
{ {
@@ -37,7 +37,7 @@ if(!empty($aClean['sSub']))
{ {
$oNote->update(); $oNote->update();
} }
redirect(apidb_fullurl("appview.php?iVersionId={$oNote->iVersionId}")); util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId={$oNote->iVersionId}"));
} else /* display note */ } else /* display note */
{ {
// show form // show form

View File

@@ -12,17 +12,17 @@ $aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']); $aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
if(!is_numeric($aClean['iAppId']) OR !is_numeric($aClean['iVersionId'])) if(!is_numeric($aClean['iAppId']) OR !is_numeric($aClean['iVersionId']))
util_show_error_page("Wrong ID"); util_show_error_page_and_exit("Wrong ID");
/* Check for admin privs */ /* Check for admin privs */
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($aClean['iVersionId']) && !$_SESSION['current']->isSuperMaintainer($aClean['iAppId'])) if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($aClean['iVersionId']) && !$_SESSION['current']->isSuperMaintainer($aClean['iAppId']))
util_show_error_page("Insufficient Privileges!"); util_show_error_page_and_exit("Insufficient Privileges!");
/* process the changes the user entered into the web form */ /* process the changes the user entered into the web form */
if(!empty($aClean['sSubmit'])) if(!empty($aClean['sSubmit']))
{ {
process_app_version_changes(true); process_app_version_changes(true);
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId'])); util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
} else /* or display the webform for making changes */ } else /* or display the webform for making changes */
{ {

View File

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

View File

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

View File

@@ -10,13 +10,13 @@ $aClean['sName'] = makeSafe($_REQUEST['sName']);
$aClean['sWebpage'] = makeSafe($_REQUEST['sWebpage']); $aClean['sWebpage'] = makeSafe($_REQUEST['sWebpage']);
if(!$_SESSION['current']->hasPriv("admin")) if(!$_SESSION['current']->hasPriv("admin"))
util_show_error_page(); util_show_error_page_and_exit();
$oVendor = new Vendor($aClean['iVendorId']); $oVendor = new Vendor($aClean['iVendorId']);
if($aClean['sSubmit']) if($aClean['sSubmit'])
{ {
$oVendor->update($aClean['sName'],$aClean['sWebpage']); $oVendor->update($aClean['sName'],$aClean['sWebpage']);
redirect(apidb_fullurl("vendorview.php")); util_redirect_and_exit(apidb_fullurl("vendorview.php"));
} }
else else
{ {

View File

@@ -12,11 +12,11 @@ $aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
$aClean['sAction'] = makeSafe($_REQUEST['sAction']); $aClean['sAction'] = makeSafe($_REQUEST['sAction']);
if(!is_numeric($aClean['iAppId']) OR !is_numeric($aClean['iVersionId'])) if(!is_numeric($aClean['iAppId']) OR !is_numeric($aClean['iVersionId']))
util_show_error_page("Wrong ID"); util_show_error_page_and_exit("Wrong ID");
/* Check for admin privs */ /* Check for admin privs */
if(!$_SESSION['current']->hasPriv("admin")) if(!$_SESSION['current']->hasPriv("admin"))
util_show_error_page("Insufficient Privileges!"); util_show_error_page_and_exit("Insufficient Privileges!");
if(!empty($aClean['sAction'])) if(!empty($aClean['sAction']))
{ {
@@ -25,7 +25,7 @@ if(!empty($aClean['sAction']))
$oVersion->update(null, null, null, null, $aClean['iAppId']); $oVersion->update(null, null, null, null, $aClean['iAppId']);
/* redirect to the application we just moved this version to */ /* redirect to the application we just moved this version to */
redirect(apidb_fullurl("appview.php?iAppId=".$aClean['iAppId'])); util_redirect_and_exit(apidb_fullurl("appview.php?iAppId=".$aClean['iAppId']));
} else /* or display the webform for making changes */ } else /* or display the webform for making changes */
{ {
?> ?>

View File

@@ -7,7 +7,7 @@ include("path.php");
require_once(BASE."include/incl.php"); require_once(BASE."include/incl.php");
redirect(BASE."appsubmit.php"); util_redirect_and_exit(BASE."appsubmit.php");
?> ?>

View File

@@ -35,7 +35,7 @@ if( empty( $aClean['iCatId'] ) )
} }
if(!is_numeric($aClean['iCatId'])) if(!is_numeric($aClean['iCatId']))
util_show_error_page("Something went wrong with the category ID"); util_show_error_page_and_exit("Something went wrong with the category ID");
// list sub categories // list sub categories
$cat = new Category($aClean['iCatId']); $cat = new Category($aClean['iCatId']);

View File

@@ -32,13 +32,13 @@ header("Pragma: ");
// is the user supposed to be viewing this image ? // is the user supposed to be viewing this image ?
if(!$_SESSION['current']->canViewImage($aClean['iId'])) if(!$_SESSION['current']->canViewImage($aClean['iId']))
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
if ($aClean['sREQUEST_METHOD']='HEAD') if ($aClean['sREQUEST_METHOD']='HEAD')
{ {
/* WARNING! optimization of logic in include/screenshots.php */ /* WARNING! optimization of logic in include/screenshots.php */
if (sscanf($aClean['iId'],"%d", &$iId) < 1) if (sscanf($aClean['iId'],"%d", &$iId) < 1)
util_show_error_page("Bad parameter"); util_show_error_page_and_exit("Bad parameter");
$hResult = query_parameters("SELECT id, url FROM appData $hResult = query_parameters("SELECT id, url FROM appData
WHERE id = '?' WHERE id = '?'

View File

@@ -66,7 +66,7 @@ function newSubmition($errors)
} }
//deny access if not logged on //deny access if not logged on
if(!$_SESSION['current']->isLoggedIn()) if(!$_SESSION['current']->isLoggedIn())
util_show_error_page("Insufficient privileges to create application. Are you sure you are logged in?"); util_show_error_page_and_exit("Insufficient privileges to create application. Are you sure you are logged in?");
if ($aClean['sSub']) if ($aClean['sSub'])
{ {
@@ -88,7 +88,7 @@ if ($aClean['sSub'])
(($oApp->queued=="false")?true:false) && (($oApp->queued=="false")?true:false) &&
!$_SESSION['current']->isVersionSubmitter($oApp->AppId)) !$_SESSION['current']->isVersionSubmitter($oApp->AppId))
{ {
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
} }
$oVersion = new Version($oRow->versionId); $oVersion = new Version($oRow->versionId);
} else } else
@@ -106,14 +106,14 @@ if ($aClean['sSub'])
(($oVersion->queued=="false")?true:false) && (($oVersion->queued=="false")?true:false) &&
!$_SESSION['current']->isVersionSubmitter($oVersion->versionId)) !$_SESSION['current']->isVersionSubmitter($oVersion->versionId))
{ {
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
} }
} }
else else
{ {
//error no Id! //error no Id!
addmsg("Application Not Found!", "red"); addmsg("Application Not Found!", "red");
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
// Get the Testing results if they exist // Get the Testing results if they exist
@@ -207,7 +207,7 @@ if ($aClean['sSub'])
{ {
$oTest->create(); $oTest->create();
} }
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
} }
if ($aClean['sSub'] == 'Delete') if ($aClean['sSub'] == 'Delete')
@@ -236,7 +236,7 @@ if ($aClean['sSub'])
$oVersion->delete(); $oVersion->delete();
} }
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
if ($aClean['sSub'] == 'view') if ($aClean['sSub'] == 'view')
{ {
@@ -388,7 +388,7 @@ if ($aClean['sSub'])
{ {
// error no sub! // error no sub!
addmsg("Internal Routine Not Found!!", "red"); addmsg("Internal Routine Not Found!!", "red");
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
} }
else // if ($aClean['sSub']) is not defined, display the main app queue page else // if ($aClean['sSub']) is not defined, display the main app queue page

View File

@@ -95,7 +95,7 @@ function display_bundle($iAppId)
} }
if(!is_numeric($aClean['iAppId']) && !is_numeric($aClean['iVersionId'])) if(!is_numeric($aClean['iAppId']) && !is_numeric($aClean['iVersionId']))
util_show_error_page("Something went wrong with the application or version id"); util_show_error_page_and_exit("Something went wrong with the application or version id");
if ($aClean['sSub']) if ($aClean['sSub'])
{ {
@@ -107,7 +107,7 @@ if ($aClean['sSub'])
{ {
$oBuglink = new bug($aClean['iBuglinkId']); $oBuglink = new bug($aClean['iBuglinkId']);
$oBuglink->delete(); $oBuglink->delete();
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId'])); util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
} }
} }
@@ -119,7 +119,7 @@ if ($aClean['sSub'])
{ {
$oBuglink = new bug($aClean['iBuglinkId']); $oBuglink = new bug($aClean['iBuglinkId']);
$oBuglink->unqueue(); $oBuglink->unqueue();
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId'])); util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
} }
} }
@@ -127,13 +127,13 @@ if ($aClean['sSub'])
{ {
$oBuglink = new bug(); $oBuglink = new bug();
$oBuglink->create($aClean['iVersionId'],$aClean['iBuglinkId']); $oBuglink->create($aClean['iVersionId'],$aClean['iBuglinkId']);
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId'])); util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
} }
if($aClean['sSub'] == 'StartMonitoring') if($aClean['sSub'] == 'StartMonitoring')
{ {
$oMonitor = new Monitor(); $oMonitor = new Monitor();
$oMonitor->create($_SESSION['current']->iUserId,$aClean['iAppId'],$aClean['iVersionId']); $oMonitor->create($_SESSION['current']->iUserId,$aClean['iAppId'],$aClean['iVersionId']);
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId'])); util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
} }
if($aClean['sSub'] == 'StopMonitoring') if($aClean['sSub'] == 'StopMonitoring')
{ {
@@ -143,7 +143,7 @@ if ($aClean['sSub'])
{ {
$oMonitor->delete(); $oMonitor->delete();
} }
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId'])); util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
} }
} }
@@ -162,7 +162,7 @@ if($aClean['iAppId'])
} else } else
{ {
// Oops! Called with no params, bad llamah! // Oops! Called with no params, bad llamah!
util_show_error_page('Page Called with No Params!'); util_show_error_page_and_exit('Page Called with No Params!');
} }
apidb_footer(); apidb_footer();

View File

@@ -22,7 +22,7 @@ apidb_header("Comments");
if(!is_numeric($aClean['iAppId']) OR !is_numeric($aClean['iVersionId']) OR (!empty($aClean['iThreadId']) AND !is_numeric($aClean['iThreadId']))) if(!is_numeric($aClean['iAppId']) OR !is_numeric($aClean['iVersionId']) OR (!empty($aClean['iThreadId']) AND !is_numeric($aClean['iThreadId'])))
util_show_error_page("Wrong IDs"); util_show_error_page_and_exit("Wrong IDs");
view_app_comments($aClean['iVersionId'], $aClean['iThreadId']); view_app_comments($aClean['iVersionId'], $aClean['iThreadId']);

View File

@@ -32,7 +32,7 @@ if (!$_SESSION['current']->hasPriv("admin")
&& !$_SESSION['current']->isMaintainer($oComment->iVersionId) && !$_SESSION['current']->isMaintainer($oComment->iVersionId)
&& !$_SESSION['current']->isSuperMaintainer($oComment->iAppId)) && !$_SESSION['current']->isSuperMaintainer($oComment->iAppId))
{ {
util_show_error_page("You don't have sufficient privileges to delete this comment."); util_show_error_page_and_exit("You don't have sufficient privileges to delete this comment.");
} }
// let's show the deletion form if the user want's to explain why he deleted the comment // let's show the deletion form if the user want's to explain why he deleted the comment
@@ -62,6 +62,6 @@ if($_SESSION['current']->getPref("confirm_comment_deletion") != "no" && !isset($
} else } else
{ {
$oComment->delete($aClean['sWhy']); $oComment->delete($aClean['sWhy']);
redirect(apidb_fullurl("appview.php?iVersionId=".$oComment->iVersionId)); util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$oComment->iVersionId));
} }
?> ?>

View File

@@ -20,13 +20,13 @@ $aClean['iDistributionId'] = makeSafe( $_REQUEST['iDistributionId']);
if ($aClean['sSub']) if ($aClean['sSub'])
{ {
if(!$_SESSION['current']->hasPriv("admin")) if(!$_SESSION['current']->hasPriv("admin"))
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
if($aClean['sSub'] == 'delete') if($aClean['sSub'] == 'delete')
{ {
$oDistribution = new distribution($aClean['iDistributionId']); $oDistribution = new distribution($aClean['iDistributionId']);
$oDistribution->delete(); $oDistribution->delete();
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
} }
$oDistribution = new distribution($aClean['iDistributionId']); $oDistribution = new distribution($aClean['iDistributionId']);

View File

@@ -519,7 +519,7 @@ class Application {
/* is this user supposed to view this version? */ /* is this user supposed to view this version? */
if(!$_SESSION['current']->canViewApplication($this)) if(!$_SESSION['current']->canViewApplication($this))
util_show_error_page("Something went wrong with the application or version id"); util_show_error_page_and_exit("Something went wrong with the application or version id");
// show Vote Menu // show Vote Menu
if($_SESSION['current']->isLoggedIn()) if($_SESSION['current']->isLoggedIn())

View File

@@ -18,13 +18,13 @@ function filter_gpc()
if(is_numeric($_REQUEST[$aKeys[$i]])) if(is_numeric($_REQUEST[$aKeys[$i]]))
$aClean[$aKeys[$i]] = $_REQUEST[$aKeys[$i]]; $aClean[$aKeys[$i]] = $_REQUEST[$aKeys[$i]];
else else
util_show_error_page("Fatal error: ".$aKeys[$i]." should be a numeric value."); util_show_error_page_and_exit("Fatal error: ".$aKeys[$i]." should be a numeric value.");
break; break;
case "b": // boolean case "b": // boolean
if($_REQUEST[$aKeys[$i]]=="true" || $_REQUEST[$aKeys[$i]]=="false") if($_REQUEST[$aKeys[$i]]=="true" || $_REQUEST[$aKeys[$i]]=="false")
$aClean[$aKeys[$i]] = $_REQUEST[$aKeys[$i]]; $aClean[$aKeys[$i]] = $_REQUEST[$aKeys[$i]];
else else
util_show_error_page("Fatal error: ".$aKeys[$i]." should be a boolean value."); util_show_error_page_and_exit("Fatal error: ".$aKeys[$i]." should be a boolean value.");
break; break;
case "s": // string case "s": // string
switch($aKeys[$i][1]) switch($aKeys[$i][1])
@@ -39,11 +39,11 @@ function filter_gpc()
break; break;
case "a": // array case "a": // array
if(!is_array($_REQUEST[$aKeys[$i]])) if(!is_array($_REQUEST[$aKeys[$i]]))
util_show_error_page("Fatal error: ".$aKeys[$i]." should be an array."); util_show_error_page_and_exit("Fatal error: ".$aKeys[$i]." should be an array.");
break; break;
default: default:
if($aKeys[$i]!="whq_appdb" && $aKeys[$i]!="MAX_FILE_SIZE") // whq_appdb is the name of the session cookie if($aKeys[$i]!="whq_appdb" && $aKeys[$i]!="MAX_FILE_SIZE") // whq_appdb is the name of the session cookie
util_show_error_page("Fatal error: type of variable ".$aKeys[$i]." is not recognized."); util_show_error_page_and_exit("Fatal error: type of variable ".$aKeys[$i]." is not recognized.");
break; break;
} }
} }

View File

@@ -164,16 +164,6 @@ function apidb_image($name)
} }
/**
* redirect to $url
*/
function redirect($url)
{
header("Location: ".$url);
exit;
}
/** /**
* format a date as required for HTTP by RFC 2068 sec 3.3.1 * format a date as required for HTTP by RFC 2068 sec 3.3.1
*/ */

View File

@@ -2,7 +2,7 @@
/** /**
* display an error page * display an error page
*/ */
function util_show_error_page($text = null, $message = null) function util_show_error_page_and_exit($text = null, $message = null)
{ {
if (!$text) { if (!$text) {
$text = "You must be logged in to perform that operation."; $text = "You must be logged in to perform that operation.";
@@ -15,6 +15,15 @@ function util_show_error_page($text = null, $message = null)
exit; exit;
} }
/**
* redirect to $url
*/
function util_redirect_and_exit($url)
{
header("Location: ".$url);
exit;
}
function makeSafe($var) function makeSafe($var)
{ {
/* Disable addslashes() until we can use more finely grained filtering on user input */ /* Disable addslashes() until we can use more finely grained filtering on user input */

View File

@@ -622,17 +622,17 @@ class Version {
/* is this user supposed to view this version? */ /* is this user supposed to view this version? */
if(!$_SESSION['current']->canViewVersion($this)) if(!$_SESSION['current']->canViewVersion($this))
util_show_error_page("Something went wrong with the application or version id"); util_show_error_page_and_exit("Something went wrong with the application or version id");
$oApp = new Application($this->iAppId); $oApp = new Application($this->iAppId);
// Oops! application not found or other error. do something // Oops! application not found or other error. do something
if(!$oApp->iAppId) if(!$oApp->iAppId)
util_show_error_page('Internal Database Access Error. No App found.'); util_show_error_page_and_exit('Internal Database Access Error. No App found.');
// Oops! Version not found or other error. do something // Oops! Version not found or other error. do something
if(!$this->iVersionId) if(!$this->iVersionId)
util_show_error_page('Internal Database Access Error. No Version Found.'); util_show_error_page_and_exit('Internal Database Access Error. No Version Found.');
// header // header
apidb_header("Viewing App- ".$oApp->sName." Version - ".$this->sName); apidb_header("Viewing App- ".$oApp->sName." Version - ".$this->sName);

View File

@@ -151,14 +151,14 @@ function vote_menu()
function vote_update($vars) function vote_update($vars)
{ {
if(!$_SESSION['current']->isLoggedIn()) if(!$_SESSION['current']->isLoggedIn())
util_show_error_page("You must be logged in to vote"); util_show_error_page_and_exit("You must be logged in to vote");
if( !is_numeric($vars['iAppId']) OR !is_numeric($vars['iSlot'])) if( !is_numeric($vars['iAppId']) OR !is_numeric($vars['iSlot']))
{ {
if(is_numeric($vars['iAppId'])) if(is_numeric($vars['iAppId']))
redirect(apidb_fullurl("appview.php?iAppId=".$vars["iAppId"])); util_redirect_and_exit(apidb_fullurl("appview.php?iAppId=".$vars["iAppId"]));
else else
redirect(apidb_fullurl("index.php")); util_redirect_and_exit(apidb_fullurl("index.php"));
return; return;
} }
@@ -178,7 +178,7 @@ function vote_update($vars)
} }
} }
redirect(apidb_fullurl("appview.php?iAppId=".$vars["iAppId"])); util_redirect_and_exit(apidb_fullurl("appview.php?iAppId=".$vars["iAppId"]));
} }
// tell us if there is a vote in a given slot so we don't // tell us if there is a vote in a given slot so we don't

View File

@@ -31,7 +31,7 @@ $aClean['iConfirmed'] = makeSafe($_POST['iConfirmed']);
$aClean['iSuperMaintainer'] = makeSafe($_POST['iSuperMaintainer']); $aClean['iSuperMaintainer'] = makeSafe($_POST['iSuperMaintainer']);
if(!$_SESSION['current']->isLoggedIn()) if(!$_SESSION['current']->isLoggedIn())
util_show_error_page("You need to be logged in to resign from being a maintainer."); util_show_error_page_and_exit("You need to be logged in to resign from being a maintainer.");
if($aClean['iConfirmed']) if($aClean['iConfirmed'])

View File

@@ -54,7 +54,7 @@ function checkAppMaintainerInput( $maintainReason )
if(!$_SESSION['current']->isLoggedIn()) if(!$_SESSION['current']->isLoggedIn())
util_show_error_page("You need to be logged in to apply to be a maintainer."); util_show_error_page_and_exit("You need to be logged in to apply to be a maintainer.");
/* if we have a versionId to check against see if */ /* if we have a versionId to check against see if */
/* the user is already a maintainer */ /* the user is already a maintainer */
@@ -76,7 +76,7 @@ if( $aClean['sMaintainReason'] )
// check the input for empty/invalid fields // check the input for empty/invalid fields
$errors = checkAppMaintainerInput($aClean['sMaintainReason']); $errors = checkAppMaintainerInput($aClean['sMaintainReason']);
if(!empty($errors)) if(!empty($errors))
util_show_error_page("We found the following errors:","<ul>$errors</ul><br />Please go back and correct them."); util_show_error_page_and_exit("We found the following errors:","<ul>$errors</ul><br />Please go back and correct them.");
// header // header
if($aClean['iSuperMaintainer']) if($aClean['iSuperMaintainer'])

View File

@@ -48,7 +48,7 @@ while(list($key, $value) = each($_REQUEST))
if(!$_SESSION['current']->isLoggedIn()) if(!$_SESSION['current']->isLoggedIn())
util_show_error_page("You must be logged in to edit preferences"); util_show_error_page_and_exit("You must be logged in to edit preferences");
// we come from the administration to edit an user // we come from the administration to edit an user
if($_SESSION['current']->hasPriv("admin") && if($_SESSION['current']->hasPriv("admin") &&
@@ -155,7 +155,7 @@ if($_POST)
$oUser->addPriv("admin"); $oUser->addPriv("admin");
else else
$oUser->delPriv("admin"); $oUser->delPriv("admin");
redirect(BASE."admin/adminUsers.php?iUserId=".$oUser->iUserId."&sSearch=".$aClean['sSearch']."&iLimit=".$aClean['iLimit']."&sOrderBy=".$aClean['sOrderBy']."&sSubmit=true"); util_redirect_and_exit(BASE."admin/adminUsers.php?iUserId=".$oUser->iUserId."&sSearch=".$aClean['sSearch']."&iLimit=".$aClean['iLimit']."&sOrderBy=".$aClean['sOrderBy']."&sSubmit=true");
} }
} }
else else

View File

@@ -54,7 +54,7 @@ if($aClean['sCmd'])
$oScreenshot->delete(); $oScreenshot->delete();
$oScreenshot->free(); $oScreenshot->free();
} }
redirect(apidb_fullurl("screenshots.php?iAppId=".$aClean['iAppId']."&iVersionId=".$aClean['iVersionId'])); util_redirect_and_exit(apidb_fullurl("screenshots.php?iAppId=".$aClean['iAppId']."&iVersionId=".$aClean['iVersionId']));
} }

View File

@@ -53,7 +53,7 @@ if ($aClean['sSub'])
$oTest->update(true); $oTest->update(true);
$oTest->ReQueue(); $oTest->ReQueue();
} }
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} else } else
{ {
$aClean['sSub'] = 'view'; $aClean['sSub'] = 'view';
@@ -69,7 +69,7 @@ if ($aClean['sSub'])
$oTest->delete(); $oTest->delete();
} }
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
// is this an old test? // is this an old test?
@@ -81,7 +81,7 @@ if ($aClean['sSub'])
!$_SESSION['current']->hasAppVersionModifyPermission($oVersion)&& !$_SESSION['current']->hasAppVersionModifyPermission($oVersion)&&
!(($_SESSION['current']->iUserId == $oTest->iSubmitterId) && !($oTest->sQueued == 'false'))) !(($_SESSION['current']->iUserId == $oTest->iSubmitterId) && !($oTest->sQueued == 'false')))
{ {
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
} else } else
$oVersion = new version($oTest->iVersionId); $oVersion = new version($oTest->iVersionId);
} else } else
@@ -161,7 +161,7 @@ if ($aClean['sSub'])
{ {
// error no sub! // error no sub!
addmsg("Internal Routine Not Found!!", "red"); addmsg("Internal Routine Not Found!!", "red");
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
} }
else // if ($aClean['sSub']) is not defined, display the Testing results queue page else // if ($aClean['sSub']) is not defined, display the Testing results queue page

View File

@@ -20,12 +20,12 @@ $oVendor = new Vendor($aClean['iVendorId']);
if ($aClean['sSub']) if ($aClean['sSub'])
{ {
if(!$_SESSION['current']->hasPriv("admin")) if(!$_SESSION['current']->hasPriv("admin"))
util_show_error_page("Insufficient privileges."); util_show_error_page_and_exit("Insufficient privileges.");
if($aClean['sSub'] == 'delete') if($aClean['sSub'] == 'delete')
{ {
$oVendor->delete(); $oVendor->delete();
redirect($_SERVER['PHP_SELF']); util_redirect_and_exit($_SERVER['PHP_SELF']);
} }
} }

View File

@@ -20,7 +20,7 @@ $aClean['iBugId'] = makeSafe($_REQUEST['iBugId']);
/* code to View versions affected by a Bug */ /* code to View versions affected by a Bug */
if(!is_numeric($aClean['iBugId'])) if(!is_numeric($aClean['iBugId']))
util_show_error_page("Something went wrong with the bug ID"); util_show_error_page_and_exit("Something went wrong with the bug ID");
apidb_header("Applications affected by Bug #".$aClean['iBugId']); apidb_header("Applications affected by Bug #".$aClean['iBugId']);
echo '<form method=post action="viewbugs.php?iBugId='.$aClean['iBugId'].'">',"\n"; echo '<form method=post action="viewbugs.php?iBugId='.$aClean['iBugId'].'">',"\n";