public function userLoginAction() { if (isset($_POST['username']) and isset($_POST['password'])) { if (User::userLogin($_POST['username'], $_POST['password'])) { $this->view->assign('username', $_POST['username']); $this->view->assign('password', $_POST['password']); $this->render('Home'); } else { $this->render('Index'); $this->render('Error'); } } elseif (isset($_SESSION['UserID'])) { $User = User::getUserData($_SESSION['UserID']); $this->view->assign('username', $User->username); $this->render('Home'); } else { $this->render('Index'); } }