Example #1
0
 /**
  * Accept $username and $password and pass them to
  * the Model to compare against stored values
  * @param $username
  * @param $password
  * @return bool
  */
 public function login($username, $password)
 {
     // Logged in user's can't login again.
     if ($this->check()) {
         return false;
     }
     $model = new ModelUser($this->dbh);
     $user = $model->login($username, $password);
     if (isset($user->id)) {
         $this->setUserSessionInfo($user);
         return true;
     } else {
         return false;
     }
 }