示例#1
0
 public function authenticate()
 {
     if ($user = parent::authenticate()) {
         $_SESSION["lbcauth"] = array("username" => $user->getUsername(), "password" => $user->getPassword());
         return $user;
     }
     return null;
 }
示例#2
0
文件: Basic.php 项目: sbraz/LBCAlerte
 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);
 }
示例#3
0
 /**
  * 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();
 }