Ejemplo n.º 1
0
 /**
  * Check a username/password combination for validity.
  *
  * @param string $username The username
  * @param string $password The password
  *
  * @return boolean Whether the password matches the user.
  */
 public static function checkCredentials($username, $password)
 {
     $user = new Phprojekt_User_User();
     $userId = $user->findIdByUsername($username);
     if (0 == $userId) {
         return false;
     }
     $setting = new Phprojekt_Setting();
     $setting->setModule('User');
     return self::_compareStringWithPassword($password, $setting->getSetting("password", $userId));
 }