Ejemplo n.º 1
0
 public function login()
 {
     header("Content-Type:text/html; charset=utf-8");
     $username = isset($_POST['username']) ? $_POST['username'] : '';
     $password = isset($_POST['password']) ? $_POST['password'] : '';
     //        print_r($username);
     $sqlAuth = new SQLAuthenticator();
     if ($SQLRet = $sqlAuth->authenticate($username, $password)) {
         AuditLog::writeLog('login in', session('userid'));
         $this->getUserPermission();
         $this->success("login success 1  ");
     } else {
         if ($ldapRet = $this->authenticate($username, $password)) {
             AuditLog::writeLog('login in', session('userid'));
             $this->getUserPermission();
             $this->success("login success 2  ");
         } else {
             $this->error('Your account may be disabled or blocked or the username/password you entered is incorrect.');
         }
     }
 }