public function authControl() { $this->app_session->logout(); $controller = new PublicTimelineController(true); $controller->addSuccessMessage("You have successfully logged out."); return $controller->go(); }
/** * Bounce user to public page or to error page. * @TODO bounce back to original action once signed in */ protected function bounce() { if (get_class($this) == 'PrivateDashboardController' || get_class($this) == 'PostController') { $controller = new PublicTimelineController(true); return $controller->go(); } else { $config = Config::getInstance(); throw new Exception('You must <a href="' . $config->getValue('site_root_path') . 'session/login.php">log in</a> to do this.'); } }
public function control() { if ($this->isLoggedIn()) { $this->addToView('logged_in_user', $this->getLoggedInUser()); $this->addToViewCacheKey($this->getLoggedInUser()); return $this->authControl(); } else { //@TODO bounce to sign in page and bounce back to original action once signed in if (get_class($this) == 'PrivateDashboardController') { $controller = new PublicTimelineController(true); return $controller->go(); } else { return "You must be logged in to do this"; } } }
<?php require_once 'init.php'; require_once 'controller/class.PublicTimelineController.php'; $controller = new PublicTimelineController(); echo $controller->go();