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


PHP Tinebase_Core::inMaintenanceMode方法代码示例

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


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

示例1: validate

 /**
  * validate if user is allowed to use the software in maintenance mode
  *
  * @return bool
  */
 public function validate()
 {
     if (Tinebase_Core::inMaintenanceMode()) {
         $currentAccount = Tinebase_User::getInstance()->getFullUserById($this->getValidData());
         if (!$currentAccount->hasRight('Tinebase', Tinebase_Acl_Rights::MAINTENANCE)) {
             return false;
         }
     }
     return true;
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:15,代码来源:MaintenanceMode.php

示例2: login

 /**
  * create new user session
  *
  * @param   string                           $loginName
  * @param   string                           $password
  * @param   Zend_Controller_Request_Abstract $request
  * @param   string                           $clientIdString
  *
  * @return  bool
  * @throws  Tinebase_Exception_MaintenanceMode
  *
  * TODO what happened to the $securitycode parameter?
  *  ->  @param   string                           $securitycode   the security code(captcha)
  */
 public function login($loginName, $password, \Zend\Http\Request $request, $clientIdString = NULL)
 {
     $authResult = Tinebase_Auth::getInstance()->authenticate($loginName, $password);
     $accessLog = Tinebase_AccessLog::getInstance()->getAccessLogEntry($loginName, $authResult, $request, $clientIdString);
     $user = $this->_validateAuthResult($authResult, $accessLog);
     if (!$user instanceof Tinebase_Model_FullUser) {
         return false;
     }
     if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) {
         Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . " Login with username {$accessLog->login_name} from {$accessLog->ip} succeeded.");
     }
     if (Tinebase_Core::inMaintenanceMode()) {
         if (!$user->hasRight('Tinebase', Tinebase_Acl_Rights::MAINTENANCE)) {
             throw new Tinebase_Exception_MaintenanceMode();
         }
     }
     Tinebase_AccessLog::getInstance()->setSessionId($accessLog);
     $this->initUser($user);
     $this->_updateCredentialCache($user->accountLoginName, $password);
     $this->_updateAccessLog($user, $accessLog);
     return true;
 }
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:36,代码来源:Controller.php

示例3: initSyncrotonRegistry

 public static function initSyncrotonRegistry()
 {
     Syncroton_Registry::setDatabase(Tinebase_Core::getDb());
     Syncroton_Registry::setTransactionManager(Tinebase_TransactionManager::getInstance());
     Syncroton_Registry::set(Syncroton_Registry::DEVICEBACKEND, new Syncroton_Backend_Device(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
     Syncroton_Registry::set(Syncroton_Registry::FOLDERBACKEND, new Syncroton_Backend_Folder(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
     Syncroton_Registry::set(Syncroton_Registry::SYNCSTATEBACKEND, new Syncroton_Backend_SyncState(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
     Syncroton_Registry::set(Syncroton_Registry::CONTENTSTATEBACKEND, new Syncroton_Backend_Content(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
     Syncroton_Registry::set(Syncroton_Registry::POLICYBACKEND, new Syncroton_Backend_Policy(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
     Syncroton_Registry::set(Syncroton_Registry::LOGGERBACKEND, Tinebase_Core::getLogger());
     Syncroton_Registry::set(Syncroton_Registry::SESSION_VALIDATOR, function () {
         return !Tinebase_Core::inMaintenanceMode();
     });
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:14,代码来源:Controller.php


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