From ba20d1b97464baf4cbb97111b8adea7f116961f8 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 10 Jun 2010 19:40:20 +0000 Subject: [PATCH] Move session stuff up so it can be set before its used to determine the conference --- common.inc.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/common.inc.php b/common.inc.php index bba0a08..fef939d 100644 --- a/common.inc.php +++ b/common.inc.php @@ -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"))