function processData() { switch ($this->mode) { case moduleLogin::MODE_SUBMIT: $this->viewer->assumeValidSession(); if ($this->viewer->validateLogin($this->userID, $this->passWord)) { $this->processForms(); } else { $this->errorMessages = 'Invalid UserID & Password.'; } break; case moduleLogin::MODE_FORM: if ($this->viewer->isAuthenticated() == false) { $this->mode = moduleLogin::MODE_DISPLAY; } break; case moduleLogin::MODE_LOGOUT: $this->viewer->deleteSession(); CASUser::logout(); // now redirect the page BACK to the LOGIN page header("Location:" . Page::getLoginURL()); break; } }