Ejemplo n.º 1
0
 /**
  * Create HTTP response
  *
  * Should be called after a login attempt has been determined
  *
  * @return  void BUT writes to standard output and cookies!
  */
 public function response()
 {
     $response = "";
     $this->setMessage();
     if (isset($_GET['register'])) {
         $response = $this->generateRegisterFormHTML($this->message);
     } else {
         if ($this->SessionManager->SessionGetSuccessfulRegistrationUsername() != null) {
             self::$keepName = $this->SessionManager->SessionGetSuccessfulRegistrationUsername();
             $this->SessionManager->SessionUnsetSuccessfulRegistrationUsername();
         } else {
             self::$keepName = $this->getInputUname();
         }
         $response .= $this->generateLoginFormHTML($this->message);
     }
     return $response;
 }
Ejemplo n.º 2
0
 /**
  * Create HTTP response
  *
  * Should be called after a login attempt has been determined
  *
  * @return  void BUT writes to standard output and cookies!
  */
 public function response()
 {
     $response = "";
     $this->setMessage();
     if (isset($_GET['register'])) {
         $response = $this->generateRegisterFormHTML($this->message);
     } else {
         if ($this->LoginModel->isUserLoggedIn()) {
             $response .= $this->generateLogoutButtonHTML($this->message);
         } else {
             if (isset($_SESSION['successfulRegistrationUsername'])) {
                 self::$keepName = $_SESSION['successfulRegistrationUsername'];
                 unset($_SESSION['successfulRegistrationUsername']);
             } else {
                 self::$keepName = $this->getInputUname();
             }
             $response .= $this->generateLoginFormHTML($this->message);
         }
     }
     return $response;
 }