/** * (non-PHPdoc) * @see Tinebase_Server_Interface::handle() */ public function handle(\Zend\Http\Request $request = null, $body = null) { Tinebase_Session_Abstract::setSessionEnabled('TINE20SETUPSESSID'); if (Tinebase_Session::sessionExists()) { Setup_Core::startSetupSession(); } Setup_Core::initFramework(); if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' is http request. method: ' . $this->getRequestMethod()); } $server = new Tinebase_Http_Server(); $server->setClass('Setup_Frontend_Http', 'Setup'); $server->setClass('Tinebase_Frontend_Http', 'Tinebase'); // needed for fetching translation in DEVELOPMENT mode if (empty($_REQUEST['method'])) { $_REQUEST['method'] = 'Setup.mainScreen'; } $server->handle($_REQUEST); }
/** * cleanup old sessions files => needed only for filesystems based sessions */ public function cleanupSessions() { $config = Tinebase_Core::getConfig(); $backendType = $config->session && $config->session->backend ? ucfirst($config->session->backend) : 'File'; if (strtolower($backendType) == 'file') { $maxLifeTime = $config->session && $config->session->lifetime ? $config->session->lifetime : 86400; $path = Tinebase_Session_Abstract::getSessionDir(); $unlinked = 0; try { $dir = new DirectoryIterator($path); } catch (Exception $e) { if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) { Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ . " Could not cleanup sessions"); } Tinebase_Exception::log($e); return; } foreach ($dir as $fileinfo) { if (!$fileinfo->isDot() && !$fileinfo->isLink() && $fileinfo->isFile()) { if ($fileinfo->getMTime() < Tinebase_DateTime::now()->getTimestamp() - $maxLifeTime) { unlink($fileinfo->getPathname()); $unlinked++; } } } if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) { Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . " Deleted {$unlinked} expired session files"); } Tinebase_Config::getInstance()->set(Tinebase_Config::LAST_SESSIONS_CLEANUP_RUN, Tinebase_DateTime::now()->toString()); } }
/** * */ public function __construct() { if ($this->_supportsSessions) { Tinebase_Session_Abstract::setSessionEnabled('TINE20SETUPSESSID'); } }
/** * activate session and set name in options * * @param $sessionName */ public static function setSessionEnabled($sessionName) { self::setSessionOptions(array('name' => $sessionName)); self::$_sessionEnabled = true; self::$_isSetupSession = $sessionName === 'TINE20SETUPSESSID'; }
<?php /** * Tine 2.0 * * @package setup tests * @subpackage test root * @license http://www.gnu.org/licenses/agpl.html AGPL3 * @copyright Copyright (c) 2008-2016 Metaways Infosystems GmbH (http://www.metaways.de) * @author Philipp Schüle <*****@*****.**> * */ Tinebase_Session_Abstract::setSessionEnabled('TINE20SETUPSESSID'); Setup_TestServer::getInstance()->initFramework();
public static function setSessionEnabled($sessionName) { self::setSessionOptions(array('name' => $sessionName)); self::$_sessionEnabled = true; }