Piwik\Plugins\Login\Auth::setPassword PHP Method

setPassword() public method

Sets the password to authenticate with.
public setPassword ( string $password )
$password string
    public function setPassword($password)
    {
        if (empty($password)) {
            $this->hashedPassword = null;
        } else {
            $this->hashedPassword = UsersManager::getPasswordHash($password);
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @group Plugins
  * @see https://github.com/piwik/piwik/issues/8548
  */
 public function test_authenticate_withPasswordIsCaseInsensitiveForLogin()
 {
     $user = $this->_setUpUser();
     $this->auth->setLogin('uSeR');
     $this->auth->setPassword($user['password']);
     $rc = $this->auth->authenticate();
     $this->assertUserLogin($rc);
     // Check that the login + token auth is correct in the result
     $this->assertEquals($user['login'], $rc->getIdentity());
     $this->assertEquals($user['tokenAuth'], $rc->getTokenAuth());
 }
All Usage Examples Of Piwik\Plugins\Login\Auth::setPassword