Move session stuff up so it can be set before its used to determine the conference

This commit is contained in:
james 2010-06-10 19:40:20 +00:00
parent e0efe11f03
commit ba20d1b974

View File

@ -195,6 +195,14 @@ if(get_magic_quotes_gpc()) {
exit;
}
if($config['SFIABDIRECTORY'] == '') {
session_name("SFIABSESSID");
session_set_cookie_params(0,'/');
} else {
session_name("SFIABSESSID".ereg_replace("[^A-Za-z]","_",$config['SFIABDIRECTORY']));
session_set_cookie_params(0,$config['SFIABDIRECTORY']);
}
session_start();
//move the conference stuff before the configuration loading, so we can load the right configuration for the conference :)
if(isset($_GET['switchconference'])) {
@ -223,8 +231,6 @@ else {
$conference['type']="sciencefair";
}
//now pull the rest of the configuration
$q=mysql_query("SELECT * FROM config WHERE year='".$config['FAIRYEAR']."'");
while($r=mysql_fetch_object($q))
@ -248,15 +254,6 @@ require_once("theme/{$config['theme_icons']}/icons.php");
require_once("committee.inc.php");
if($config['SFIABDIRECTORY'] == '') {
session_name("SFIABSESSID");
session_set_cookie_params(0,'/');
} else {
session_name("SFIABSESSID".ereg_replace("[^A-Za-z]","_",$config['SFIABDIRECTORY']));
session_set_cookie_params(0,$config['SFIABDIRECTORY']);
}
session_start();
//detect the browser first, so we know what icons to use - we store this in the config array as well
//even though its not configurable by the fair
if(stristr($_SERVER['HTTP_USER_AGENT'],"MSIE"))