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


PHP API::getTokenAuth方法代码示例

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


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

示例1: _checkUserHasNotChanged

 private function _checkUserHasNotChanged($user, $newPassword, $newEmail = null, $newAlias = null)
 {
     if (is_null($newEmail)) {
         $newEmail = $user['email'];
     }
     if (is_null($newAlias)) {
         $newAlias = $user['alias'];
     }
     $userAfter = $this->api->getUser($user["login"]);
     unset($userAfter['date_registered']);
     // we now compute what the token auth should be, it should always be a hash of the login and the current password
     // if the password has changed then the token_auth has changed!
     $user['token_auth'] = $this->api->getTokenAuth($user["login"], md5($newPassword));
     $user['password'] = md5($newPassword);
     $user['email'] = $newEmail;
     $user['alias'] = $newAlias;
     $user['superuser_access'] = 0;
     $this->assertEquals($user, $userAfter);
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:19,代码来源:UsersManagerTest.php

示例2: doAuthenticateSession

 /**
  * Authenticates the user.
  *
  * Derived classes can override this method to customize authentication logic or impose
  * extra requirements on the user trying to login.
  *
  * @param AuthInterface $auth The Auth implementation to use when authenticating.
  * @return AuthResult
  */
 protected function doAuthenticateSession(AuthInterface $auth)
 {
     $login = $auth->getLogin();
     $tokenAuthSecret = null;
     try {
         $tokenAuthSecret = $auth->getTokenAuthSecret();
     } catch (Exception $ex) {
         Log::debug("SessionInitializer::doAuthenticateSession: token_auth secret for %s not available before user" . " is authenticated.", $login);
     }
     $tokenAuth = empty($tokenAuthSecret) ? null : $this->usersManagerAPI->getTokenAuth($login, $tokenAuthSecret);
     /**
      * @deprecated Create a custom SessionInitializer instead.
      */
     Piwik::postEvent('Login.authenticate', array($auth->getLogin(), $tokenAuth));
     return $auth->authenticate();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:25,代码来源:SessionInitializer.php

示例3: makeSuccessLogin

 protected function makeSuccessLogin($userInfo)
 {
     $successCode = $userInfo['superuser_access'] ? AuthResult::SUCCESS_SUPERUSER_AUTH_CODE : AuthResult::SUCCESS;
     $tokenAuth = $this->usersManagerAPI->getTokenAuth($userInfo['login'], $this->getTokenAuthSecret());
     return new AuthResult($successCode, $userInfo['login'], $tokenAuth);
 }
开发者ID:heiglandreas,项目名称:plugin-LoginLdap,代码行数:6,代码来源:Base.php


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