Skip to content
Snippets Groups Projects
Commit 23f8dbad authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge pull request #19 from protich/feature/installer-global-variables

Support register_globals PHP ini setting from the installer
parents 27959672 1f4663e5
No related branches found
No related tags found
No related merge requests found
<?php <?php
if(!defined('SETUPINC')) die('Kwaheri!'); if(!defined('SETUPINC')) die('Kwaheri!');
$info=($_POST && $errors)?Format::htmlchars($_POST):array('prefix'=>'ost_','dbhost'=>'localhost'); $info=($_POST && $errors)?Format::htmlchars($_POST):array('prefix'=>'ost_','dbhost'=>'localhost');
//XXX: Remove b4 release.
if($_SESSION['installer']['info'] && !$_POST)
$info=$_SESSION['installer']['info'];
?> ?>
<div id="main" class="step2"> <div id="main" class="step2">
<h1>osTicket Basic Installation</h1> <h1>osTicket Basic Installation</h1>
......
<?php <?php
if(!defined('SETUPINC')) die('Kwaheri!'); if(!defined('SETUPINC')) die('Kwaheri!');
$msg = $_SESSION['upgrader']['msg']; $msg = $_SESSION['ost_upgrader']['msg'];
?> ?>
<div id="main"> <div id="main">
<h1>Attachments Migration</h1> <h1>Attachments Migration</h1>
......
...@@ -29,11 +29,11 @@ $wizard['menu']=array('Installation Guide'=>'http://osticket.com/wiki/Installati ...@@ -29,11 +29,11 @@ $wizard['menu']=array('Installation Guide'=>'http://osticket.com/wiki/Installati
if($_POST && $_POST['s']) { if($_POST && $_POST['s']) {
$errors = array(); $errors = array();
$_SESSION['installer']['s']=$_POST['s']; $_SESSION['ost_installer']['s']=$_POST['s'];
switch(strtolower($_POST['s'])) { switch(strtolower($_POST['s'])) {
case 'prereq': case 'prereq':
if($installer->check_prereq()) if($installer->check_prereq())
$_SESSION['installer']['s']='config'; $_SESSION['ost_installer']['s']='config';
else else
$errors['prereq']='Minimum requirements not met!'; $errors['prereq']='Minimum requirements not met!';
break; break;
...@@ -43,7 +43,7 @@ if($_POST && $_POST['s']) { ...@@ -43,7 +43,7 @@ if($_POST && $_POST['s']) {
elseif(!$installer->config_writable()) elseif(!$installer->config_writable())
$errors['err']='Write access required to continue'; $errors['err']='Write access required to continue';
else else
$_SESSION['installer']['s']='install'; $_SESSION['ost_installer']['s']='install';
break; break;
case 'install': case 'install':
if($installer->install($_POST)) { if($installer->install($_POST)) {
...@@ -51,7 +51,7 @@ if($_POST && $_POST['s']) { ...@@ -51,7 +51,7 @@ if($_POST && $_POST['s']) {
'email' =>$_POST['admin_email'], 'email' =>$_POST['admin_email'],
'URL'=>URL); 'URL'=>URL);
//TODO: Go to subscribe step. //TODO: Go to subscribe step.
$_SESSION['installer']['s']='done'; $_SESSION['ost_installer']['s']='done';
} elseif(!($errors=$installer->getErrors()) || !$errors['err']) { } elseif(!($errors=$installer->getErrors()) || !$errors['err']) {
$errors['err']='Error installing osTicket - correct the errors below and try again.'; $errors['err']='Error installing osTicket - correct the errors below and try again.';
} }
...@@ -69,16 +69,16 @@ if($_POST && $_POST['s']) { ...@@ -69,16 +69,16 @@ if($_POST && $_POST['s']) {
$errors['notify'] = 'Check one or more'; $errors['notify'] = 'Check one or more';
if(!$errors) if(!$errors)
$_SESSION['installer']['s'] = 'done'; $_SESSION['ost_installer']['s'] = 'done';
break; break;
} }
}elseif($_GET['s'] && $_GET['s']=='ns' && $_SESSION['installer']['s']=='subscribe') { }elseif($_GET['s'] && $_GET['s']=='ns' && $_SESSION['ost_installer']['s']=='subscribe') {
$_SESSION['installer']['s']='done'; $_SESSION['ost_installer']['s']='done';
} }
switch(strtolower($_SESSION['installer']['s'])) { switch(strtolower($_SESSION['ost_installer']['s'])) {
case 'config': case 'config':
case 'install': case 'install':
if(!$installer->config_exists()) { if(!$installer->config_exists()) {
......
...@@ -15,13 +15,21 @@ ...@@ -15,13 +15,21 @@
**********************************************************************/ **********************************************************************/
#inits #inits
error_reporting(E_ALL ^ E_NOTICE); //turn on errors error_reporting(E_ALL ^ E_NOTICE); //turn on errors??
ini_set('magic_quotes_gpc', 0); ini_set('magic_quotes_gpc', 0);
ini_set('session.use_trans_sid', 0); ini_set('session.use_trans_sid', 0);
ini_set('session.cache_limiter', 'nocache'); ini_set('session.cache_limiter', 'nocache');
ini_set('display_errors',1); //We want the user to see errors during install process. ini_set('display_errors',1); //We want the user to see errors during install process.
ini_set('display_startup_errors',1); ini_set('display_startup_errors',1);
#Disable Globals if enabled
if(ini_get('register_globals')) {
ini_set('register_globals',0);
foreach($_REQUEST as $key=>$val)
if(isset($$key))
unset($$key);
}
#start session #start session
session_start(); session_start();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment