/** Check user password * * @param $rt * @return bool|null|string */ public function checkPassword($rt) { /* check if plugin authenticated the user */ if (!$rt || is_array($rt) && !in_array(true, $rt)) { /* check user password - local authentication */ if (!$this->user->passwordMatches($this->givenPassword)) { $this->failedLogin(); return $this->modx->lexicon('login_username_password_incorrect'); } } return false; }
/** * Ensure passwordMatches works * @return void */ public function testPasswordMatches() { $this->assertTrue($this->user->passwordMatches('boogles')); $this->assertFalse($this->user->passwordMatches('bugles')); }