Beispiel #1
0
 /**
  * Set all the session variables for corresponding user.
  * Only called when it is known that the user exists.
  *
  * @param string $username User associated with session.
  */
 public function setSessionVariables($username)
 {
     $user = new User($this->db);
     $userInfo = $user->getBy('name', $username)['data'][0];
     unset($userInfo['password']);
     foreach ($userInfo as $key => $value) {
         $_SESSION[$key] = $value;
     }
 }
Beispiel #2
0
 /**
  * Get the password for the given user.
  *
  * @return string|bool The hashed password or false on error.
  */
 private function getPassword()
 {
     $crud = new User();
     return $crud->getBy('name', $this->user['name']);
 }