本文整理汇总了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) {
}
}
示例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 {
//.........这里部分代码省略.........