/** * Get the time to view pages at. * * @return DateTime */ public function getTime() { // Time should only be used with the history state. if (!$this->isHistory()) { return new DateTime('now'); } $timestamp = $this->session->get($this->timePersistenceKey, time()); return (new DateTime())->setTimestamp($timestamp); }
public function Init() { $xmlFiles = $this->sessionManager->get("xml"); $this->fileParams["filePath"] = $xmlFiles->xml_menus; $this->fileParams["rootNode"] = "menu"; $this->fileParams["menuId"] = "side"; $this->xml = new XmlLoader($this->fileParams); $this->Render(); }
$adoptSession = true; } else { writeErrorOutput($operationManager, new WebServiceException(WebServiceErrorCode::$AUTHREQUIRED, "Authentication required")); return; } } $sid = $sessionManager->startSession($sessionId, $adoptSession); if (!$sessionId && !$operationManager->isPreLoginOperation()) { writeErrorOutput($operationManager, new WebServiceException(WebServiceErrorCode::$AUTHREQUIRED, "Authentication required")); return; } if (!$sid) { writeErrorOutput($operationManager, $sessionManager->getError()); return; } $userid = $sessionManager->get("authenticatedUserId"); if ($userid) { $seed_user = new Users(); $current_user = $seed_user->retrieveCurrentUserInfoFromFile($userid); } else { $current_user = null; } $operationInput = $operationManager->sanitizeOperation($input); $includes = $operationManager->getOperationIncludes(); foreach ($includes as $ind => $path) { checkFileAccessForInclusion($path); require_once $path; } cbEventHandler::do_action('corebos.audit.action', array(isset($current_user) ? $current_user->id : 0, 'Webservice', $operation, 0, date('Y-m-d H:i:s'))); $rawOutput = $operationManager->runOperation($operationInput, $current_user); writeOutput($operationManager, $rawOutput);
/** * Permet de supprimer une clef de la session * * @param string $name */ public static function unset($name) { SessionManager::get()->offsetUnset($name); }
public static function check() { return SessionManager::get('user') ? true : false; }