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


PHP AuthService::bufferedMessage方法代码示例

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


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

示例1: init

 public function init($options)
 {
     parent::init($options);
     $this->useQueue = $this->pluginConf["USE_QUEUE"];
     try {
         $this->msgExchanger = ConfService::instanciatePluginFromGlobalParams($this->pluginConf["UNIQUE_MS_INSTANCE"], "AJXP_MessageExchanger");
         if (AuthService::$bufferedMessage != null && AuthService::getLoggedUser() != null) {
             $this->sendInstantMessage(AuthService::$bufferedMessage, ConfService::getCurrentRepositoryId(), AuthService::getLoggedUser()->getId());
             AuthService::$bufferedMessage = null;
         }
     } catch (Exception $e) {
     }
 }
开发者ID:floffel03,项目名称:pydio-core,代码行数:13,代码来源:class.MqManager.php

示例2: logUser

 /**
  * Log the user from its credentials
  * @static
  * @param string $user_id The user id
  * @param string $pwd The password
  * @param bool $bypass_pwd Ignore password or not
  * @param bool $cookieLogin Is it a logging from the remember me cookie?
  * @param string $returnSeed The unique seed
  * @return int
  */
 public static function logUser($user_id, $pwd, $bypass_pwd = false, $cookieLogin = false, $returnSeed = "")
 {
     $user_id = self::filterUserSensitivity($user_id);
     if ($cookieLogin && !isset($_COOKIE["AjaXplorer-remember"])) {
         return -5;
         // SILENT IGNORE
     }
     if ($cookieLogin) {
         list($user_id, $pwd) = explode(":", $_COOKIE["AjaXplorer-remember"]);
     }
     $confDriver = ConfService::getConfStorageImpl();
     if ($user_id == null) {
         if (self::$useSession) {
             if (isset($_SESSION["AJXP_USER"]) && is_object($_SESSION["AJXP_USER"])) {
                 /**
                  * @var AbstractAjxpUser $u
                  */
                 $u = $_SESSION["AJXP_USER"];
                 if ($u->reloadRolesIfRequired()) {
                     ConfService::getInstance()->invalidateLoadedRepositories();
                     self::$bufferedMessage = AJXP_XMLWriter::reloadRepositoryList(false);
                     $_SESSION["AJXP_USER"] = $u;
                 }
                 return 1;
             }
         } else {
             if (isset(self::$currentUser) && is_object(self::$currentUser)) {
                 return 1;
             }
         }
         if (ConfService::getCoreConf("ALLOW_GUEST_BROWSING", "auth") && !isset($_SESSION["CURRENT_MINISITE"])) {
             $authDriver = ConfService::getAuthDriverImpl();
             if (!$authDriver->userExists("guest")) {
                 self::createUser("guest", "");
                 $guest = $confDriver->createUserObject("guest");
                 $guest->save("superuser");
             }
             self::logUser("guest", null);
             return 1;
         }
         return -1;
     }
     $authDriver = ConfService::getAuthDriverImpl();
     // CHECK USER PASSWORD HERE!
     $loginAttempt = self::getBruteForceLoginArray();
     $bruteForceLogin = self::checkBruteForceLogin($loginAttempt);
     self::setBruteForceLoginArray($loginAttempt);
     if (!$authDriver->userExists($user_id)) {
         AJXP_Logger::warning(__CLASS__, "Login failed", array("user" => AJXP_Utils::sanitize($user_id, AJXP_SANITIZE_EMAILCHARS), "error" => "Invalid user"));
         if ($bruteForceLogin === FALSE) {
             return -4;
         } else {
             return -1;
         }
     }
     if (!$bypass_pwd) {
         if (!self::checkPassword($user_id, $pwd, $cookieLogin, $returnSeed)) {
             AJXP_Logger::warning(__CLASS__, "Login failed", array("user" => AJXP_Utils::sanitize($user_id, AJXP_SANITIZE_EMAILCHARS), "error" => "Invalid password"));
             if ($bruteForceLogin === FALSE) {
                 return -4;
             } else {
                 if ($cookieLogin) {
                     return -5;
                 }
                 return -1;
             }
         }
     }
     // Successful login attempt
     unset($loginAttempt[$_SERVER["REMOTE_ADDR"]]);
     self::setBruteForceLoginArray($loginAttempt);
     // Setting session credentials if asked in config
     if (ConfService::getCoreConf("SESSION_SET_CREDENTIALS", "auth")) {
         list($authId, $authPwd) = $authDriver->filterCredentials($user_id, $pwd);
         AJXP_Safe::storeCredentials($authId, $authPwd);
     }
     $user = $confDriver->createUserObject($user_id);
     if ($user->getLock() == "logout") {
         AJXP_Logger::warning(__CLASS__, "Login failed", array("user" => AJXP_Utils::sanitize($user_id, AJXP_SANITIZE_EMAILCHARS), "error" => "Locked user"));
         return -1;
     }
     if (AuthService::$useSession && ConfService::getCoreConf("ALLOW_GUEST_BROWSING", "auth")) {
         ConfService::getInstance()->invalidateLoadedRepositories();
     }
     if ($authDriver->isAjxpAdmin($user_id)) {
         $user->setAdmin(true);
     }
     if (self::$useSession) {
         $_SESSION["AJXP_USER"] = $user;
     } else {
//.........这里部分代码省略.........
开发者ID:Nanomani,项目名称:pydio-core,代码行数:101,代码来源:class.AuthService.php


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