public function authenticate() { if ($user = parent::authenticate()) { $_SESSION["lbcauth"] = array("username" => $user->getUsername(), "password" => $user->getPassword()); return $user; } return null; }
public function __construct(\App\Storage\User $storage) { if (!$this->_username && isset($_SERVER["PHP_AUTH_USER"])) { $this->setUsername($_SERVER["PHP_AUTH_USER"]); } if (!$this->_password && isset($_SERVER["PHP_AUTH_PW"])) { $this->setPassword(sha1($_SERVER["PHP_AUTH_PW"])); } parent::__construct($storage); }
/** * Constructor, checks whether the user is logged in and passes this to * the template. * * @return void */ function User() { parent::Controller(); // check login status and fill the 'logged' parameter in the template $this->user_model->logStatus(); }