Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
         $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);
Ejemplo n.º 4
0
 /**
  * Permet de supprimer une clef de la session
  *
  * @param string $name
  */
 public static function unset($name)
 {
     SessionManager::get()->offsetUnset($name);
 }
Ejemplo n.º 5
0
 public static function check()
 {
     return SessionManager::get('user') ? true : false;
 }