original_string: public function getTokenAuth($userLogin, $md5Password)
      {
          UsersManager::checkPasswordHash($md5Password, Piwik::translate('UsersManager_ExceptionPasswordMD5HashExpected'));
  
          $user = $this->model->getUser($userLogin);
  
          if (empty($user) || !$this->password->verify($md5Password, $user['password'])) {
              /**
               * @ignore
               * @internal
               */
              Piwik::postEvent('Login.authenticate.failed', array($userLogin));
  
              return md5($userLogin . microtime(true) . Common::generateUniqId());
          }
  
          if ($this->password->needsRehash($user['password'])) {
              $userUpdater = new UserUpdater();
              $userUpdater->updateUserWithoutCurrentPassword($userLogin, $this->password->hash($md5Password));
          }
  
          return $user['token_auth'];
      }
code: public function getTokenAuth($userLogin, $md5Password)
      {
          UsersManager::checkPasswordHash($md5Password, Piwik::translate('UsersManager_ExceptionPasswordMD5HashExpected'));
  
          $user = $this->model->getUser($userLogin);
  
          if (empty($user) || !$this->password->verify($md5Password, $user['password'])) {
              /**
               * @ignore
               * @internal
               */
              Piwik::postEvent('Login.authenticate.failed', array($userLogin));
  
              return md5($userLogin . microtime(true) . Common::generateUniqId());
          }
  
          if ($this->password->needsRehash($user['password'])) {
              $userUpdater = new UserUpdater();
              $userUpdater->updateUserWithoutCurrentPassword($userLogin, $this->password->hash($md5Password));
          }
  
          return $user['token_auth'];
      }
code_tokens: public function getTokenAuth ( $ userLogin , $ md5Password ) { UsersManager :: checkPasswordHash ( $ md5Password , Piwik :: translate ( 'UsersManager_ExceptionPasswordMD5HashExpected' ) ) ; $ user = $ this -> model -> getUser ( $ userLogin ) ; if ( empty ( $ user ) || ! $ this -> password -> verify ( $ md5Password , $ user [ 'password' ] ) ) { /**
               * @ignore
               * @internal
               */ Piwik :: postEvent ( 'Login.authenticate.failed' , array ( $ userLogin ) ) ; return md5 ( $ userLogin . microtime ( true ) . Common :: generateUniqId ( ) ) ; } if ( $ this -> password -> needsRehash ( $ user [ 'password' ] ) ) { $ userUpdater = new UserUpdater ( ) ; $ userUpdater -> updateUserWithoutCurrentPassword ( $ userLogin , $ this -> password -> hash ( $ md5Password ) ) ; } return $ user [ 'token_auth' ] ; }
docstring: Returns the user's API token.
  
  If the username/password combination is incorrect an invalid token will be returned.
  
  @param string $userLogin Login
  @param string $md5Password hashed string of the password (using current hash function; MD5-named for historical reasons)
  @return string
docstring_tokens: Returns the user s API token .