From: <gem...@li...> - 2011-11-21 10:18:28
|
Revision: 247 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=247&view=rev Author: matijsdejong Date: 2011-11-21 10:18:22 +0000 (Mon, 21 Nov 2011) Log Message: ----------- The plan was to stop using these $this->project|session->variablenames. (Plus I got a warning as session did not exist.) Modified Paths: -------------- trunk/library/classes/Gems/Project/ProjectSettings.php trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php 2011-11-21 09:54:34 UTC (rev 246) +++ trunk/library/classes/Gems/Project/ProjectSettings.php 2011-11-21 10:18:22 UTC (rev 247) @@ -47,6 +47,15 @@ class Gems_Project_ProjectSettings extends ArrayObject { /** + * The default session time out for this project in seconds. + * + * Can be overruled in sesssion.idleTimeout + * + * @var int + */ + protected $defaultSessionTimeout = 1800; + + /** * The minimum length for the password of a super admin * on a production server. * @@ -215,6 +224,20 @@ } /** + * Timeout for sessions in seconds. + * + * @return int + */ + public function getSessionTimeOut() + { + if (isset($this->session, $this->session['idleTimeout'])) { + return $this->session['idleTimeout']; + } else { + return $this->defaultSessionTimeout; + } + } + + /** * Returns the super admin name, if any * * @return string Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-21 09:54:34 UTC (rev 246) +++ trunk/library/classes/GemsEscort.php 2011-11-21 10:18:22 UTC (rev 247) @@ -58,7 +58,7 @@ private $_copyDestinations; private $_startFirebird; - + /** * The menu variable * @@ -89,7 +89,7 @@ $firebug = $application->getOption('firebug'); $this->_startFirebird = $firebug['log']; - + $sessionOptions['name'] = GEMS_PROJECT_NAME_UC . 'SESSID'; $sessionOptions['cookie_path'] = strtr(dirname($_SERVER['SCRIPT_NAME']), '\\', '/'); @@ -385,10 +385,11 @@ */ protected function _initSession() { + $session = new Zend_Session_Namespace('gems.' . GEMS_PROJECT_NAME . '.session'); - - $idleTimeout = ($this->project->session['idleTimeout'] ? $this->project->session['idleTimeout'] : 1800); - + + $idleTimeout = $this->project->getSessionTimeOut(); + $session->setExpirationSeconds($idleTimeout); if (! isset($session->user_role)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |