Don't cache redirects

This commit is contained in:
kaetemi 2014-09-03 07:36:10 +02:00
parent 37e0201a5f
commit 88ca2ab7e9
34 changed files with 86 additions and 0 deletions

View file

@ -21,12 +21,14 @@ function activate_plugin() {
if ( $result )
{
// if result is successfull it redirects and shows success message
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=3" );
throw new SystemExit();
}
else
{
//if result is unsuccessfull it redirects and throws error
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=4" );
throw new SystemExit();
}
@ -34,6 +36,7 @@ function activate_plugin() {
else
{
//if $_GET variable is not set it redirects and shows error
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=4" );
throw new SystemExit();
}

View file

@ -30,6 +30,7 @@ function add_sgroup(){
require($SITEBASE . '/inc/sgroup_list.php');
$result= array_merge($result, sgroup_list());
return $result;
header("Cache-Control: max-age=1");
/*if (Helpers::check_if_game_client()) {
header("Location: ".$INGAME_WEBPATH."?page=sgroup_list");
}else{
@ -40,11 +41,13 @@ function add_sgroup(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -29,6 +29,7 @@ function add_user(){
$status = write_user( $edit );
if(Helpers::check_if_game_client()){
//if registering ingame then we have to set the header and dont need to reload the template.
header("Cache-Control: max-age=1");
header('Location: email_sent.php');
throw new SystemExit();
}

View file

@ -36,8 +36,10 @@ function add_user_to_sgroup(){
//$result= array_merge($result, show_sgroup());
//helpers :: loadtemplate( 'show_sgroup', $result);
if (Helpers::check_if_game_client()) {
header("Cache-Control: max-age=1");
header("Location: ".$INGAME_WEBPATH."?page=show_sgroup&id=".$id);
}else{
header("Cache-Control: max-age=1");
header("Location: ".$WEBPATH."?page=show_sgroup&id=".$id);
}
throw new SystemExit();
@ -45,11 +47,13 @@ function add_user_to_sgroup(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -102,17 +102,20 @@ function change_info(){
}else{
//ERROR: permission denied!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: The form was not filled in correclty
header("Cache-Control: max-age=1");
header("Location: index.php?page=settings");
throw new SystemExit();
}
}else{
//ERROR: user is not logged in
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -78,17 +78,20 @@ function change_mail(){
}else{
//ERROR: permission denied!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: The form was not filled in correclty
header("Cache-Control: max-age=1");
header("Location: index.php?page=settings");
throw new SystemExit();
}
}else{
//ERROR: user is not logged in
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -71,17 +71,20 @@ function change_password(){
}else{
//ERROR: permission denied!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: The form was not filled in correclty
header("Cache-Control: max-age=1");
header("Location: index.php?page=settings");
throw new SystemExit();
}
}else{
//ERROR: user is not logged in
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -23,8 +23,10 @@ function change_receivemail(){
WebUsers::setReceiveMail($user_id, $receiveMail);
}
if (Helpers::check_if_game_client()) {
header("Cache-Control: max-age=1");
header("Location: ".$INGAME_WEBPATH."?page=settings&id=".$user_id);
}else{
header("Cache-Control: max-age=1");
header("Location: ".$WEBPATH."?page=settings&id=".$user_id);
}
throw new SystemExit();
@ -32,17 +34,20 @@ function change_receivemail(){
}else{
//ERROR: permission denied!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: The form was not filled in correclty
header("Cache-Control: max-age=1");
header("Location: index.php?page=settings");
throw new SystemExit();
}
}else{
//ERROR: user is not logged in
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -31,8 +31,10 @@ function create_ticket(){
$ticket_id = Ticket::create_Ticket($title, $content, $category, $author, unserialize($_SESSION['ticket_user'])->getTUserId(),0, $_POST);
//redirect to the new ticket.
if (Helpers::check_if_game_client()) {
header("Cache-Control: max-age=1");
header("Location: ".$INGAME_WEBPATH."?page=show_ticket&id=".$ticket_id);
}else{
header("Cache-Control: max-age=1");
header("Location: ".$WEBPATH."?page=show_ticket&id=".$ticket_id);
}
throw new SystemExit();
@ -41,6 +43,7 @@ function create_ticket(){
//ERROR: LIB DB is not online!
print_r($e);
throw new SystemExit();
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}
@ -48,17 +51,20 @@ function create_ticket(){
}else{
//ERROR: permission denied!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: The form was not filled in correclty
header("Cache-Control: max-age=1");
header("Location: index.php?page=create_ticket");
throw new SystemExit();
}
}else{
//ERROR: user is not logged in
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -22,12 +22,15 @@ function deactivate_plugin() {
if ( $result )
{
// if result is successfull it redirects and shows success message
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=5" );
throw new SystemExit();
}
else
{
// if result is unsuccessfull it redirects and shows success message
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=6" );
throw new SystemExit();
@ -36,6 +39,7 @@ function deactivate_plugin() {
else
{
//if $_GET variable is not set it redirects and shows error
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=6" );
throw new SystemExit();
}

View file

@ -29,6 +29,7 @@ function delete_plugin() {
$db -> delete( 'plugins', array( 'id' => $id ), "Id=:id" );
//if result successfull redirect and show success message
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=2" );
throw new SystemExit();
@ -36,6 +37,7 @@ function delete_plugin() {
else
{
// if result unsuccessfull redirect and show error message
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=0" );
throw new SystemExit();
}
@ -44,6 +46,7 @@ function delete_plugin() {
else
{
// if result unsuccessfull redirect and show error message
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=0" );
throw new SystemExit();
}

View file

@ -125,6 +125,7 @@ function install_plugin() {
$dbr -> insert( "plugins", $install_result );
// if everything is successfull redirecting to the plugin template
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=1" );
throw new SystemExit();
}
@ -132,6 +133,7 @@ function install_plugin() {
{
// file .info not exists
rmdir( $target_path );
header("Cache-Control: max-age=1");
header( "Location: index.php?page=install_plugin&result=2" );
throw new SystemExit();
}
@ -139,6 +141,7 @@ function install_plugin() {
} else
{
// extraction failed
header("Cache-Control: max-age=1");
header( "Location: index.php?page=install_plugin&result=0" );
throw new SystemExit();
}
@ -293,6 +296,7 @@ function checkForUpdate( $fileName, $findPath, $tempFile, $tempPath )
$update['UpdatePath'] = $tempPath . "/" . trim( $fileName, ".zip" ) . "_" . $result['Version'] . ".zip";
$update['UpdateInfo'] = json_encode( $result );
$dbr -> insert( "updates", $update );
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=7" );
throw new SystemExit();
}

View file

@ -33,6 +33,7 @@ function login(){
//go back to the index page.
header("Cache-Control: max-age=1");
if (Helpers::check_if_game_client()) {
header( 'Location: '. $INGAME_WEBPATH . $GETString);
}else{

View file

@ -44,6 +44,7 @@ function modify_email_of_sgroup(){
//require_once($SITEBASE . 'inc/show_sgroup.php');
//$result= array_merge($result, show_sgroup());
//helpers :: loadtemplate( 'show_sgroup', $result);
header("Cache-Control: max-age=1");
if (Helpers::check_if_game_client()) {
header("Location: ".$INGAME_WEBPATH."?page=show_sgroup&id=".$sgroupid);
}else{
@ -54,11 +55,13 @@ function modify_email_of_sgroup(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -41,6 +41,7 @@ function reply_on_ticket(){
$newPriority = filter_var($_POST['ChangePriority'], FILTER_SANITIZE_NUMBER_INT);
Ticket::updateTicketStatusAndPriority($ticket_id,$newStatus, $newPriority, $author);
}
header("Cache-Control: max-age=1");
if (Helpers::check_if_game_client()) {
header("Location: ".$INGAME_WEBPATH."?page=show_ticket&id=".$ticket_id);
}else{
@ -58,11 +59,13 @@ function reply_on_ticket(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -30,6 +30,7 @@ function update_plugin() {
$db -> delete( "updates", array( 'id' => $row['s.no'] ), "s.no=:id" );
// if update is installed succesffully redirect to show success message
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=8" );
throw new SystemExit();

View file

@ -22,6 +22,7 @@ function change_permission(){
//execute change.
Ticket_User::change_permission(Ticket_User::constr_ExternId($user_id)->getTUserId(), $value);
header("Cache-Control: max-age=1");
if (Helpers::check_if_game_client()) {
header("Location: ".$INGAME_WEBPATH."?page=show_user&id=".$user_id);
}else{
@ -32,6 +33,7 @@ function change_permission(){
}else{
//ERROR: GET PARAMS not given or trying to change admin
header("Cache-Control: max-age=1");
if (Helpers::check_if_game_client()) {
header("Location: ".$INGAME_WEBPATH."?page=show_user&id=".$user_id);
}else{
@ -43,6 +45,7 @@ function change_permission(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
@ -50,6 +53,7 @@ function change_permission(){
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -17,6 +17,7 @@ function createticket(){
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
@ -47,6 +48,7 @@ function createticket(){
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -29,6 +29,7 @@ function dashboard(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
@ -36,6 +37,7 @@ function dashboard(){
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -17,6 +17,7 @@ function login() {
$_SESSION['id'] = WebUsers::getId($result['name']);
$_SESSION['ticket_user'] = serialize(Ticket_User::constr_ExternId($_SESSION['id']));
//go back to the index page.
header("Cache-Control: max-age=1");
if (Helpers::check_if_game_client()) {
header('Location: ' . $INGAME_WEBPATH);
} else {

View file

@ -32,6 +32,7 @@ function plugins()
} else {
// ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header( "Location: index.php?page=error" );
throw new SystemExit();
}

View file

@ -30,6 +30,7 @@ function plugins_update()
} else {
// ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header( "Location: index.php?page=error" );
throw new SystemExit();
}

View file

@ -25,6 +25,7 @@ function reset_password(){
}else{
global $WEBPATH;
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: ".$WEBPATH."?page=error");
throw new SystemExit();
}

View file

@ -12,6 +12,7 @@ function settings(){
if(($_GET['id'] != $_SESSION['id']) && (!Ticket_User::isMod(unserialize($_SESSION['ticket_user']))) ){
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}else{
@ -47,6 +48,7 @@ function settings(){
}else{
//ERROR: not logged in!
header("Location: index.php");
header("Cache-Control: max-age=1");
throw new SystemExit();
}
}

View file

@ -16,6 +16,7 @@ function sgroup_list(){
if(isset($_GET['delete']) && Ticket_User::isAdmin(unserialize($_SESSION['ticket_user']))){
$delete_id = filter_var($_GET['delete'], FILTER_SANITIZE_NUMBER_INT);
$result['delete'] = Support_Group::deleteSupportGroup( $delete_id);
header("Cache-Control: max-age=1");
if (Helpers::check_if_game_client()) {
header("Location: ".$INGAME_WEBPATH."?page=sgroup_list");
}else{
@ -33,11 +34,13 @@ function sgroup_list(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -148,6 +148,7 @@ function show_queue(){
//ERROR: Doesn't exist!
$_SESSION['error_code'] = "404";
header("Cache-Control: max-age=1");
header("Location: ams?page=error");
throw new SystemExit();
}
@ -155,11 +156,13 @@ function show_queue(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -43,11 +43,13 @@ function show_reply(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -20,6 +20,7 @@ function show_sgroup(){
if(isset($_GET['delete']) && Ticket_User::isAdmin(unserialize($_SESSION['ticket_user']))){
$delete_id = filter_var($_GET['delete'], FILTER_SANITIZE_NUMBER_INT);
$result['delete'] = Support_Group::deleteUserOfSupportGroup( $delete_id, $result['target_id'] );
header("Cache-Control: max-age=1");
if (Helpers::check_if_game_client()) {
header("Location: ".$INGAME_WEBPATH."?page=show_sgroup&id=" . $result['target_id']);
}else{
@ -64,6 +65,7 @@ function show_sgroup(){
//ERROR: No page specified!
$_SESSION['error_code'] = "404";
header("Cache-Control: max-age=1");
header("Location: ams?page=error");
throw new SystemExit();
}
@ -71,11 +73,13 @@ function show_sgroup(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -82,11 +82,13 @@ function show_ticket(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -49,11 +49,13 @@ function show_ticket_info(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -67,11 +67,13 @@ function show_ticket_log(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -41,11 +41,13 @@ function show_user(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}
}else{
//ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php");
throw new SystemExit();
}

View file

@ -30,6 +30,7 @@ function syncing(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}

View file

@ -30,6 +30,7 @@ function userlist(){
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error");
throw new SystemExit();
}