Ejemplo n.º 1
0
 protected function doLogin($handle, $password)
 {
     $this->logout();
     if (!isset($handle) || !isset($password)) {
         return false;
     }
     $handle = trim($handle);
     $password = trim($password);
     if (!isset($this->tableName) || !isset($this->sessionName)) {
         return false;
     }
     if (empty($handle)) {
         return false;
     }
     if ($this->doBWLogin($handle, $password)) {
         parent::doLogin($handle, $password);
         $this->setupBWSession($handle);
         $this->updateUser($handle, $password);
         parent::doLogin($handle, $password);
         // Sanity check
         if (!$this->isBWLoggedIn('NeedMore,Pending')) {
             throw new PException('Login sanity check failed miserably!');
         }
         if ($this->_immediateRedirect !== '') {
             header("Location: " . $this->_immediateRedirect);
             exit(0);
         }
         return true;
     }
     return true;
 }