当前位置: 首页>>代码示例>>PHP>>正文


PHP Kernel::exitSystemMode方法代码示例

本文整理汇总了PHP中Kernel::exitSystemMode方法的典型用法代码示例。如果您正苦于以下问题:PHP Kernel::exitSystemMode方法的具体用法?PHP Kernel::exitSystemMode怎么用?PHP Kernel::exitSystemMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kernel的用法示例。


在下文中一共展示了Kernel::exitSystemMode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processRequest

 public function processRequest(MMapRequest $request, MMapResponse $response)
 {
     ob_start('mb_output_handler');
     MMapManager::startSession();
     MMapManager::checkSessionExpiration();
     $username = $request->issetPOST('username') ? $request->getPOST('username') : '';
     $password = $request->issetPOST('password') ? $request->getPOST('password') : '';
     $loginPage = $request->issetPOST('loginPage') ? $request->getPOST('loginPage') : '';
     $subject = new Subject();
     $loginContext = new LoginContext('eyeos-login', $subject);
     $cred = new EyeosPasswordCredential();
     $cred->setUsername($username);
     $cred->setPassword($password, true);
     $subject->getPrivateCredentials()->append($cred);
     try {
         $loginContext->login();
         $memoryManager = MemoryManager::getInstance();
         Kernel::enterSystemMode();
         $memoryManager->set('isExternLogin', 1);
         $memoryManager->set('username', $username);
         $memoryManager->set('password', $password);
         $memoryManager->set('loginPage', $loginPage);
         Kernel::exitSystemMode();
         header("Location: index.php");
     } catch (Exception $e) {
         header("Location:" . $loginPage . "?errorLogin=1");
     }
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:28,代码来源:MMapExternLogin.php

示例2: checkSessionExpiration

 /**
  * @throws EyeSessionExpiredException
  */
 public static function checkSessionExpiration()
 {
     Kernel::enterSystemMode();
     $regenerated = MemoryManager::getInstance()->get('regenerated', 1);
     Kernel::exitSystemMode();
     if ($regenerated == 1) {
         MemoryManager::getInstance()->reset();
         throw new EyeSessionExpiredException('Session expired.');
     }
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:13,代码来源:MMapManager.php

示例3: __run

 public static function __run(AppExecutionContext $context, MMapResponse $response)
 {
     $myMemoryManager = MemoryManager::getInstance();
     Kernel::enterSystemMode();
     $isExternLogin = $myMemoryManager->get('isExternLogin');
     $loginPage = $myMemoryManager->get('loginPage');
     Kernel::exitSystemMode();
     $context->getArgs()->append($isExternLogin);
     if ($isExternLogin) {
         $context->getArgs()->append($loginPage);
     }
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:12,代码来源:logout.php

示例4: __run

 public static function __run(AppExecutionContext $context, MMapResponse $response)
 {
     $memoryManager = MemoryManager::getInstance();
     Kernel::enterSystemMode();
     $isExternLogin = $memoryManager->get('isExternLogin');
     Kernel::exitSystemMode();
     $list = new ArrayList();
     $list->append($isExternLogin);
     if ($isExternLogin) {
         Kernel::enterSystemMode();
         $username = $memoryManager->get('username');
         $password = $memoryManager->get('password');
         Kernel::exitSystemMode();
         $list->append($username);
         $list->append($password);
     }
     $context->setArgs($list);
     $response->appendToBody('eyeos.isRegisterActive=' . self::isRegisterActive() . ';');
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:19,代码来源:login.php

示例5: processRequest

 public function processRequest(MMapRequest $request, MMapResponse $response)
 {
     $urlName = $request->getGET('download');
     if (is_array($urlName)) {
         exit;
     }
     $urlShare = new UrlShare();
     $urlShare->setName($urlName);
     $urlShareController = UrlShareController::getInstance();
     $urlShare = current($urlShareController->searchUrl($urlShare));
     if ($urlShare) {
         if ($urlShare->getExpirationDate() < time()) {
             self::renderErrorMessage($response, 'Url Expired');
             return;
         }
         $file = new UrlFile();
         $file->setId($urlShare->getFileId());
         $urlShareController->readFile($file);
         if ($file) {
             $fileName = basename($file->getPath());
             $currentFile = FSI::getFile($file->getPath());
             $size = $currentFile->getSize();
             $unim = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
             $c = 0;
             while ($size >= 1024) {
                 $c++;
                 $size = $size / 1024;
             }
             $size = number_format($size, $c ? 2 : 0, ',', '.') . ' ' . $unim[$c];
             if ($request->issetGET('wrongPassword')) {
                 $wrongPassword = $request->getGET('wrongPassword');
             } else {
                 $wrongPassword = 0;
             }
             Kernel::exitSystemMode();
             self::renderFoundFile($fileName, $size, $urlName, $response, $urlShare->getPassword(), $wrongPassword);
         } else {
             self::renderErrorMessage($response, 'File not available');
         }
     } else {
         self::renderErrorMessage($response, 'File not available');
     }
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:43,代码来源:MMapUrlShareDownload.php

示例6: setProcessLoginContext

 /**
  * Change the LoginContext associated with an existing process
  * 
  * @param int $pid
  * @param LoginContext $loginContext
  * @throws EyeInvalidArgumentException If the arguments are incorrect
  * @throws EyeProcException If there is no such process with the given pid
  */
 public function setProcessLoginContext($pid, LoginContext $loginContext)
 {
     $processTable = $this->getProcessesTable();
     if (!isset($processTable[$pid])) {
         throw new EyeProcException('Process $proc with PID ' . $pid . ' not found.');
     }
     $processTable[$pid]->setLoginContext($loginContext);
     if ($this->currentProcess->getPid() == $pid) {
         $this->currentProcess = $processTable[$pid];
     }
     Kernel::enterSystemMode();
     $this->memoryManager->set('processTable', $processTable);
     Kernel::exitSystemMode();
     $this->fireEvent('loginContextChanged', new ProcEvent($processTable[$pid]));
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:23,代码来源:ProcManager.php


注:本文中的Kernel::exitSystemMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。