Piwik\Plugins\UsersManager\Model::updateUserTokenAuth PHP Method

updateUserTokenAuth() public method

public updateUserTokenAuth ( $userLogin, $tokenAuth )
    public function updateUserTokenAuth($userLogin, $tokenAuth)
    {
        $this->updateUserFields($userLogin, array('token_auth' => $tokenAuth));
    }

Usage Example

Example #1
0
File: API.php Project: piwik/piwik
 /**
  * Regenerate the token_auth associated with a user.
  *
  * If the user currently logged in regenerates his own token, he will be logged out.
  * His previous token will be rendered invalid.
  *
  * @param   string  $userLogin
  * @throws  Exception
  */
 public function regenerateTokenAuth($userLogin)
 {
     $this->checkUserIsNotAnonymous($userLogin);
     Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
     $this->model->updateUserTokenAuth($userLogin, $this->createTokenAuth($userLogin));
 }