hg/feature/cdb-packed
botanic 10 years ago
commit fe8cb3595a

@ -36,6 +36,11 @@ class Helpers {
$smarty -> caching = false; $smarty -> caching = false;
$smarty -> cache_lifetime = 5; $smarty -> cache_lifetime = 5;
if (function_exists('apc_cache_info')) {
// production
$smarty->compile_check = false;
}
// needed by smarty. // needed by smarty.
helpers :: create_folders (); helpers :: create_folders ();
global $FORCE_INGAME; global $FORCE_INGAME;

@ -143,7 +143,7 @@ function api_key_management_hook_store_db()
// redirect to the the main page with success code // redirect to the the main page with success code
// 1 refers to the successfull addition of key to the database // 1 refers to the successfull addition of key to the database
header( "Location: index.php?page=layout_plugin&&name=API_key_management&&success=1" ); header( "Location: index.php?page=layout_plugin&&name=API_key_management&&success=1" );
exit; throw new SystemExit();
} }
} }
} }
@ -196,7 +196,7 @@ function api_key_management_hook_update_db()
// redirecting to the API_key_management plugins template with success code // redirecting to the API_key_management plugins template with success code
// 2 refers to the succssfull delete condition // 2 refers to the succssfull delete condition
header( "Location: index.php?page=layout_plugin&&name=API_key_management&&success=2" ); header( "Location: index.php?page=layout_plugin&&name=API_key_management&&success=2" );
exit; throw new SystemExit();
} }
} }

@ -33,13 +33,6 @@ CREATE TABLE IF NOT EXISTS `ams_querycache` (
`db` varchar(80) NOT NULL `db` varchar(80) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `ams_querycache`
--
INSERT INTO `ams_querycache` (`SID`, `type`, `query`, `db`) VALUES
(1, 'createUser', '["admin","WyId5UERpuB4U","localhost@localhost"]', 'shard');
-- -------------------------------------------------------- -- --------------------------------------------------------
-- --
@ -298,13 +291,6 @@ CREATE TABLE IF NOT EXISTS `ticket_user` (
`ExternId` int(10) unsigned NOT NULL `ExternId` int(10) unsigned NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `ticket_user`
--
INSERT INTO `ticket_user` (`TUserId`, `Permission`, `ExternId`) VALUES
(1, 3, 1);
-- -------------------------------------------------------- -- --------------------------------------------------------
-- --

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

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

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

@ -97,29 +97,32 @@ function change_info(){
global $INGAME_WEBPATH; global $INGAME_WEBPATH;
$result['ingame_webpath'] = $INGAME_WEBPATH; $result['ingame_webpath'] = $INGAME_WEBPATH;
helpers :: loadtemplate( 'settings', $result); helpers :: loadtemplate( 'settings', $result);
exit; throw new SystemExit();
}else{ }else{
//ERROR: permission denied! //ERROR: permission denied!
$_SESSION['error_code'] = "403"; $_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error"); header("Location: index.php?page=error");
exit; throw new SystemExit();
} }
}else{ }else{
//ERROR: The form was not filled in correclty //ERROR: The form was not filled in correclty
header("Cache-Control: max-age=1");
header("Location: index.php?page=settings"); header("Location: index.php?page=settings");
exit; throw new SystemExit();
} }
}else{ }else{
//ERROR: user is not logged in //ERROR: user is not logged in
header("Cache-Control: max-age=1");
header("Location: index.php"); header("Location: index.php");
exit; throw new SystemExit();
} }
}catch (PDOException $e) { }catch (PDOException $e) {
//go to error page or something, because can't access website db //go to error page or something, because can't access website db
print_r($e); print_r($e);
exit; throw new SystemExit();
} }
} }

@ -47,7 +47,7 @@ function change_password(){
$succresult['username'] = $_SESSION['user']; $succresult['username'] = $_SESSION['user'];
$succresult['target_id'] = $_POST['target_id']; $succresult['target_id'] = $_POST['target_id'];
helpers :: loadtemplate( 'settings', $succresult); helpers :: loadtemplate( 'settings', $succresult);
exit; throw new SystemExit();
}else{ }else{
@ -65,31 +65,34 @@ function change_password(){
$result = array_merge($result,$settings); $result = array_merge($result,$settings);
helpers :: loadtemplate( 'settings', $result); helpers :: loadtemplate( 'settings', $result);
exit; throw new SystemExit();
} }
}else{ }else{
//ERROR: permission denied! //ERROR: permission denied!
$_SESSION['error_code'] = "403"; $_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error"); header("Location: index.php?page=error");
exit; throw new SystemExit();
} }
}else{ }else{
//ERROR: The form was not filled in correclty //ERROR: The form was not filled in correclty
header("Cache-Control: max-age=1");
header("Location: index.php?page=settings"); header("Location: index.php?page=settings");
exit; throw new SystemExit();
} }
}else{ }else{
//ERROR: user is not logged in //ERROR: user is not logged in
header("Cache-Control: max-age=1");
header("Location: index.php"); header("Location: index.php");
exit; throw new SystemExit();
} }
}catch (PDOException $e) { }catch (PDOException $e) {
//go to error page or something, because can't access website db //go to error page or something, because can't access website db
print_r($e); print_r($e);
exit; throw new SystemExit();
} }
} }

@ -23,34 +23,39 @@ function change_receivemail(){
WebUsers::setReceiveMail($user_id, $receiveMail); WebUsers::setReceiveMail($user_id, $receiveMail);
} }
if (Helpers::check_if_game_client()) { if (Helpers::check_if_game_client()) {
header("Cache-Control: max-age=1");
header("Location: ".$INGAME_WEBPATH."?page=settings&id=".$user_id); header("Location: ".$INGAME_WEBPATH."?page=settings&id=".$user_id);
}else{ }else{
header("Cache-Control: max-age=1");
header("Location: ".$WEBPATH."?page=settings&id=".$user_id); header("Location: ".$WEBPATH."?page=settings&id=".$user_id);
} }
exit; throw new SystemExit();
}else{ }else{
//ERROR: permission denied! //ERROR: permission denied!
$_SESSION['error_code'] = "403"; $_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error"); header("Location: index.php?page=error");
exit; throw new SystemExit();
} }
}else{ }else{
//ERROR: The form was not filled in correclty //ERROR: The form was not filled in correclty
header("Cache-Control: max-age=1");
header("Location: index.php?page=settings"); header("Location: index.php?page=settings");
exit; throw new SystemExit();
} }
}else{ }else{
//ERROR: user is not logged in //ERROR: user is not logged in
header("Cache-Control: max-age=1");
header("Location: index.php"); header("Location: index.php");
exit; throw new SystemExit();
} }
}catch (PDOException $e) { }catch (PDOException $e) {
//go to error page or something, because can't access website db //go to error page or something, because can't access website db
print_r($e); print_r($e);
exit; throw new SystemExit();
} }
} }

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

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

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

@ -11,7 +11,7 @@ function forgot_password(){
$result['EMAIL_ERROR'] = 'TRUE'; $result['EMAIL_ERROR'] = 'TRUE';
$result['no_visible_elements'] = 'TRUE'; $result['no_visible_elements'] = 'TRUE';
helpers :: loadtemplate( 'forgot_password', $result); helpers :: loadtemplate( 'forgot_password', $result);
exit; throw new SystemExit();
} }
$webUser = new WebUsers($target_id); $webUser = new WebUsers($target_id);
$target_username = $webUser->getUsername(); $target_username = $webUser->getUsername();
@ -44,7 +44,7 @@ function forgot_password(){
$result['prevEmail'] = $email; $result['prevEmail'] = $email;
$result['no_visible_elements'] = 'TRUE'; $result['no_visible_elements'] = 'TRUE';
helpers :: loadtemplate( 'forgot_password', $result); helpers :: loadtemplate( 'forgot_password', $result);
exit; throw new SystemExit();
} }

@ -59,17 +59,17 @@ function install_plugin() {
if ( $x == '1' ) if ( $x == '1' )
{ {
echo "update found"; echo "update found";
exit(); throw new SystemExit();
} }
else if ( $x == '2' ) else if ( $x == '2' )
{ {
echo "Plugin already exists with same name ."; echo "Plugin already exists with same name .";
exit(); throw new SystemExit();
} }
else if ( $x == '3' ) else if ( $x == '3' )
{ {
echo "Update info is not present in the update"; echo "Update info is not present in the update";
exit(); throw new SystemExit();
} }
@ -80,18 +80,18 @@ function install_plugin() {
{ {
if ( move_uploaded_file( $fileTmpLoc, $temp_path . "/" . $fileName ) ) { if ( move_uploaded_file( $fileTmpLoc, $temp_path . "/" . $fileName ) ) {
echo "$fileName upload is complete.</br>" . "<button type='submit' class='btn btn-primary' style='margin-left:5px; margin-top:10px;' name='install_plugin'>Install Plugin</button></br>"; echo "$fileName upload is complete.</br>" . "<button type='submit' class='btn btn-primary' style='margin-left:5px; margin-top:10px;' name='install_plugin'>Install Plugin</button></br>";
exit(); throw new SystemExit();
} }
else else
{ {
echo "Error in uploading file."; echo "Error in uploading file.";
exit(); throw new SystemExit();
} }
} }
else else
{ {
echo "Please select a file with .zip extension to upload."; echo "Please select a file with .zip extension to upload.";
exit(); throw new SystemExit();
} }
} }
else else
@ -125,29 +125,32 @@ function install_plugin() {
$dbr -> insert( "plugins", $install_result ); $dbr -> insert( "plugins", $install_result );
// if everything is successfull redirecting to the plugin template // if everything is successfull redirecting to the plugin template
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=1" ); header( "Location: index.php?page=plugins&result=1" );
exit; throw new SystemExit();
} }
else else
{ {
// file .info not exists // file .info not exists
rmdir( $target_path ); rmdir( $target_path );
header("Cache-Control: max-age=1");
header( "Location: index.php?page=install_plugin&result=2" ); header( "Location: index.php?page=install_plugin&result=2" );
exit; throw new SystemExit();
} }
} else } else
{ {
// extraction failed // extraction failed
header("Cache-Control: max-age=1");
header( "Location: index.php?page=install_plugin&result=0" ); header( "Location: index.php?page=install_plugin&result=0" );
exit; throw new SystemExit();
} }
} }
} }
else else
{ {
echo "Please Browse for a file before clicking the upload button"; echo "Please Browse for a file before clicking the upload button";
exit(); throw new SystemExit();
} }
} }
} }
@ -279,7 +282,7 @@ function checkForUpdate( $fileName, $findPath, $tempFile, $tempPath )
if ( pluginUpdateExists( $info['Id'], $tempPath . "/" . trim( $fileName, ".zip" ) . "_" . $result['Version'] . ".zip" ) ) if ( pluginUpdateExists( $info['Id'], $tempPath . "/" . trim( $fileName, ".zip" ) . "_" . $result['Version'] . ".zip" ) )
{ {
echo "Update already exists"; echo "Update already exists";
exit; throw new SystemExit();
} }
else { else {
// removing the preivous update // removing the preivous update
@ -293,8 +296,9 @@ function checkForUpdate( $fileName, $findPath, $tempFile, $tempPath )
$update['UpdatePath'] = $tempPath . "/" . trim( $fileName, ".zip" ) . "_" . $result['Version'] . ".zip"; $update['UpdatePath'] = $tempPath . "/" . trim( $fileName, ".zip" ) . "_" . $result['Version'] . ".zip";
$update['UpdateInfo'] = json_encode( $result ); $update['UpdateInfo'] = json_encode( $result );
$dbr -> insert( "updates", $update ); $dbr -> insert( "updates", $update );
header("Cache-Control: max-age=1");
header( "Location: index.php?page=plugins&result=7" ); header( "Location: index.php?page=plugins&result=7" );
exit; throw new SystemExit();
} }
} }
} }

@ -33,26 +33,27 @@ function login(){
//go back to the index page. //go back to the index page.
header("Cache-Control: max-age=1");
if (Helpers::check_if_game_client()) { if (Helpers::check_if_game_client()) {
header( 'Location: '. $INGAME_WEBPATH . $GETString); header( 'Location: '. $INGAME_WEBPATH . $GETString);
}else{ }else{
header( 'Location: '. $WEBPATH . $GETString); header( 'Location: '. $WEBPATH . $GETString);
} }
exit; throw new SystemExit();
}else{ }else{
//handle login failure //handle login failure
$result = Array(); $result = Array();
$result['login_error'] = 'TRUE'; $result['login_error'] = 'TRUE';
$result['no_visible_elements'] = 'TRUE'; $result['no_visible_elements'] = 'TRUE';
helpers :: loadtemplate( 'login', $result); helpers :: loadtemplate( 'login', $result);
exit; throw new SystemExit();
} }
}catch (PDOException $e) { }catch (PDOException $e) {
//go to error page or something, because can't access website db //go to error page or something, because can't access website db
print_r($e); print_r($e);
exit; throw new SystemExit();
} }
} }

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

@ -41,30 +41,33 @@ function reply_on_ticket(){
$newPriority = filter_var($_POST['ChangePriority'], FILTER_SANITIZE_NUMBER_INT); $newPriority = filter_var($_POST['ChangePriority'], FILTER_SANITIZE_NUMBER_INT);
Ticket::updateTicketStatusAndPriority($ticket_id,$newStatus, $newPriority, $author); Ticket::updateTicketStatusAndPriority($ticket_id,$newStatus, $newPriority, $author);
} }
header("Cache-Control: max-age=1");
if (Helpers::check_if_game_client()) { if (Helpers::check_if_game_client()) {
header("Location: ".$INGAME_WEBPATH."?page=show_ticket&id=".$ticket_id); header("Location: ".$INGAME_WEBPATH."?page=show_ticket&id=".$ticket_id);
}else{ }else{
header("Location: ".$WEBPATH."?page=show_ticket&id=".$ticket_id); header("Location: ".$WEBPATH."?page=show_ticket&id=".$ticket_id);
} }
exit; throw new SystemExit();
}catch (PDOException $e) { }catch (PDOException $e) {
//ERROR: LIB DB is not online! //ERROR: LIB DB is not online!
print_r($e); print_r($e);
//header("Location: index.php"); //header("Location: index.php");
exit; throw new SystemExit();
} }
}else{ }else{
//ERROR: No access! //ERROR: No access!
$_SESSION['error_code'] = "403"; $_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error"); header("Location: index.php?page=error");
exit; throw new SystemExit();
} }
}else{ }else{
//ERROR: not logged in! //ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php"); header("Location: index.php");
exit; throw new SystemExit();
} }
} }

@ -24,7 +24,7 @@ function reset_password(){
} }
$result['no_visible_elements'] = 'TRUE'; $result['no_visible_elements'] = 'TRUE';
helpers :: loadtemplate( 'reset_success', $result); helpers :: loadtemplate( 'reset_success', $result);
exit; throw new SystemExit();
} }
$GETString = ""; $GETString = "";
foreach($_GET as $key => $value){ foreach($_GET as $key => $value){
@ -38,7 +38,7 @@ function reset_password(){
$result['prevConfirmNewPass'] = $confirmpass; $result['prevConfirmNewPass'] = $confirmpass;
$result['no_visible_elements'] = 'TRUE'; $result['no_visible_elements'] = 'TRUE';
helpers :: loadtemplate( 'reset_password', $result); helpers :: loadtemplate( 'reset_password', $result);
exit; throw new SystemExit();
} }
} }

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

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

@ -17,8 +17,9 @@ function createticket(){
//ERROR: No access! //ERROR: No access!
$_SESSION['error_code'] = "403"; $_SESSION['error_code'] = "403";
header("Cache-Control: max-age=1");
header("Location: index.php?page=error"); header("Location: index.php?page=error");
exit; throw new SystemExit();
}else{ }else{
//if user_id is given, then set it as the target_id //if user_id is given, then set it as the target_id
@ -47,8 +48,9 @@ function createticket(){
}else{ }else{
//ERROR: not logged in! //ERROR: not logged in!
header("Cache-Control: max-age=1");
header("Location: index.php"); header("Location: index.php");
exit; throw new SystemExit();
} }
} }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -14,10 +14,14 @@
// load required pages and turn error reporting on/off // load required pages and turn error reporting on/off
error_reporting( E_ALL ); error_reporting( E_ALL );
ini_set( 'display_errors', 'on' ); ini_set( 'display_errors', 'on' );
class SystemExit extends Exception {}
try {
if (!file_exists( '../is_installed')) { if (!file_exists( '../is_installed')) {
header("Cache-Control: max-age=1"); header("Cache-Control: max-age=1");
header('Location: ../setup', true, 303); header('Location: ../setup', true, 303);
die(); throw new SystemExit();
} }
require( '../config.php' ); require( '../config.php' );
@ -129,3 +133,6 @@ foreach( $hook_content as $key => $value )
// load the template with the variables in the $return array // load the template with the variables in the $return array
helpers :: loadTemplate( $page , $return ); helpers :: loadTemplate( $page , $return );
}
catch (SystemExit $e) { /* do nothing */ }

@ -101,7 +101,7 @@ function ryzom_app_authenticate(&$user, $ask_login=true, $welcome_message='', $w
$c .= '<div style="text-align: center"><strong style="color: #FF5555">'._t($user['message']).'</strong></div><br />'; $c .= '<div style="text-align: center"><strong style="color: #FF5555">'._t($user['message']).'</strong></div><br />';
$c .= ryzom_render_login_form($name, false); $c .= ryzom_render_login_form($name, false);
echo ryzom_app_render(_t('app_'.APP_NAME), $c); echo ryzom_app_render(_t('app_'.APP_NAME), $c);
exit; die();
} }
return false; return false;
} }

@ -328,10 +328,10 @@ function ryzom_redirect($url, $group='', $extra_lua='') {
$lua .= 'getUI("ui:interface:'.$group.':content:html"):browse("'.str_replace('&', '&amp;', $url).'")'; $lua .= 'getUI("ui:interface:'.$group.':content:html"):browse("'.str_replace('&', '&amp;', $url).'")';
} }
echo '<lua>'.$lua.'</lua>'; echo '<lua>'.$lua.'</lua>';
exit(); die();
} else { } else {
header('Location: '.$url); header('Location: '.$url);
exit(); die();
} }
} }

@ -10,7 +10,7 @@
$MY_PATH = dirname(__FILE__); $MY_PATH = dirname(__FILE__);
if(file_exists("parser.stop")) { if(file_exists("parser.stop")) {
exit(0); die();
} }
require_once("class/mySQL_class.php"); require_once("class/mySQL_class.php");
@ -360,5 +360,5 @@ for($dtrun=0;$dtrun<2;$dtrun++) {
#$log->logf("Run complete; exiting..."); #$log->logf("Run complete; exiting...");
$log->close(); $log->close();
exit(0); die();
?> ?>

@ -37,5 +37,5 @@
echo "</ryzom_progress>"; echo "</ryzom_progress>";
exit(0); die();
?> ?>

@ -109,5 +109,5 @@
echo "</ryzom_achievements>"; echo "</ryzom_achievements>";
exit(0); die();
?> ?>

@ -63,14 +63,14 @@ if ( isset( $_GET['search'] ) && isset( $_GET['format'] ) )
$response = $c; $response = $c;
// sending the response // sending the response
echo( $response ); echo( $response );
exit; die();
} }
} }
else else
{ {
echo 'Invalid response'; echo 'Invalid response';
exit; die();
} }

@ -139,7 +139,7 @@ function joinShardFromId( $userId, $domainId, $destSessionId )
// Note: the answer is a joinSessionResult message // Note: the answer is a joinSessionResult message
echo "No response from server, joinShard failed<br>"; echo "No response from server, joinShard failed<br>";
} }
exit; die();
} }
/** /**
@ -166,7 +166,7 @@ function getShardList($userId, $domainId)
{ {
echo "No response from server, getShards failed<br>"; echo "No response from server, getShards failed<br>";
} }
exit; die();
} }
/** /**
@ -211,7 +211,7 @@ function displayAllShards(&$onlineShardsBySessionId)
//echo "<input type='submit' name='button' value='Teleport' />"; //echo "<input type='submit' name='button' value='Teleport' />";
//echo "</form></font>"; //echo "</form></font>";
exit; die();
} }

Loading…
Cancel
Save