diff --git a/include/class.format.php b/include/class.format.php index a3461bf9d615c857382763c62b8ff49562352648..2c0993c459b108fdbd1bbf3394fb2e7f9ecdff95 100644 --- a/include/class.format.php +++ b/include/class.format.php @@ -200,7 +200,7 @@ class Format { } function userdate($format,$gmtime) { - return Format::date($format,$gmtime,$_SESSION['TZ_OFFSET'],$_SESSION['daylight']); + return Format::date($format,$gmtime,$_SESSION['TZ_OFFSET'],$_SESSION['TZ_DST']); } function date($format,$gmtimestamp,$offset=0,$daylight=false){ diff --git a/include/class.misc.php b/include/class.misc.php index d9f59f47858b23c9c47c2de6ea6c3cedfda61df1..2d8e3e6b52fb9f0377b6e7545c59f7e026c66f35 100644 --- a/include/class.misc.php +++ b/include/class.misc.php @@ -67,7 +67,7 @@ class Misc { $time=Misc::gmtime(); //gm time. else{ //user time to GM. $time=is_int($var)?$var:strtotime($var); - $offset=$_SESSION['TZ_OFFSET']+($_SESSION['daylight']?date('I',$time):0); + $offset=$_SESSION['TZ_OFFSET']+($_SESSION['TZ_DST']?date('I',$time):0); $time=$time-($offset*3600); } //gm to db time diff --git a/include/class.staff.php b/include/class.staff.php index 00554157935ba0d82aa77596bf9c912f0fcf5ad5..cf97785eb8470859a4b8e2206863ee81479e05d2 100644 --- a/include/class.staff.php +++ b/include/class.staff.php @@ -520,7 +520,7 @@ class Staff { $_SESSION['_staff']['userID']=$username; $user->refreshSession(); //set the hash. $_SESSION['TZ_OFFSET']=$user->getTZoffset(); - $_SESSION['daylight']=$user->observeDaylight(); + $_SESSION['TZ_DST']=$user->observeDaylight(); Sys::log(LOG_DEBUG,'Staff login',sprintf("%s logged in [%s]", $user->getUserName(), $_SERVER['REMOTE_ADDR'])); //Debug. $sid=session_id(); //Current ID session_regenerate_id(TRUE); diff --git a/login.php b/login.php index 48dc9ec4aea9a5ab7c427cacc30b17c8005944b5..a1fb02e5ea75175c9956b46f140384e6681622da 100644 --- a/login.php +++ b/login.php @@ -53,7 +53,7 @@ if($_POST && (!empty($_POST['lemail']) && !empty($_POST['lticket']))): $_SESSION['_client']['key'] =$ticket->getExtId(); //Ticket ID --acts as password when used with email. See above. $_SESSION['_client']['token'] =$user->getSessionToken(); $_SESSION['TZ_OFFSET']=$cfg->getTZoffset(); - $_SESSION['daylight']=$cfg->observeDaylightSaving(); + $_SESSION['TZ_DST']=$cfg->observeDaylightSaving(); //Log login info... $msg=sprintf("%s/%s logged in [%s]",$ticket->getEmail(),$ticket->getExtId(),$_SERVER['REMOTE_ADDR']); Sys::log(LOG_DEBUG,'User login',$msg); diff --git a/scp/profile.php b/scp/profile.php index f9dd42a5f19a597e6b40c0e68774dce58d2a4a02..e6506fa6ece8bd0686550cae4810e17a2c76cd6f 100644 --- a/scp/profile.php +++ b/scp/profile.php @@ -29,7 +29,7 @@ if(!$errors && $_POST) { //Handle post $thisstaff->reload(); $staff->reload(); $_SESSION['TZ_OFFSET']=$thisstaff->getTZoffset(); - $_SESSION['daylight']=$thisstaff->observeDaylight(); + $_SESSION['TZ_DST']=$thisstaff->observeDaylight(); }elseif(!$errors['err']) $errors['err']='Profile update error. Try correcting the errors below and try again!'; } diff --git a/scp/staff.inc.php b/scp/staff.inc.php index 7a4dfb9e3a596fcc480894c60ecf2bede2304181..0256ce704649ecf10a7695d951b8624c6b60d72e 100644 --- a/scp/staff.inc.php +++ b/scp/staff.inc.php @@ -71,7 +71,7 @@ if(!$thisstaff->isAdmin()) { } //Staff are not allowed to login in offline mode!! - if($cfg->isHelpDeskOffline() || $cfg->isUpgradePending()) { + if($ost->isHelpDeskOffline() || $ost->isUpgradePending()) { staffLoginPage('System Offline'); exit; } @@ -83,19 +83,18 @@ $thisstaff->refreshSession(); /******* SET STAFF DEFAULTS **********/ //Set staff's timezone offset. $_SESSION['TZ_OFFSET']=$thisstaff->getTZoffset(); -$_SESSION['daylight']=$thisstaff->observeDaylight(); +$_SESSION['TZ_DST']=$thisstaff->observeDaylight(); -define('AUTO_REFRESH_RATE',$thisstaff->getRefreshRate()*60); -define('PAGE_LIMIT',$thisstaff->getPageLimit()?$thisstaff->getPageLimit():DEFAULT_PAGE_LIMIT); +define('PAGE_LIMIT', $thisstaff->getPageLimit()?$thisstaff->getPageLimit():DEFAULT_PAGE_LIMIT); //Clear some vars. we use in all pages. $errors=array(); $msg=$warn=$sysnotice=''; $tabs=array(); $submenu=array(); -if($cfg->isUpgradePending()) { +if($ost->isUpgradePending()) { $errors['err']=$sysnotice='System upgrade is pending <a href="../setup/upgrade.php">Upgrade Now</a>'; -} elseif($cfg->isHelpDeskOffline()) { +} elseif($ost->isHelpDeskOffline()) { $sysnotice='<strong>System is set to offline mode</strong> - Client interface is disabled and ONLY admins can access staff control panel.'; $sysnotice.=' <a href="settings.php">Enable</a>.'; }