public function Run() { $url = $_SERVER['REQUEST_URI']; if (strlen(self::$BasePath) > strlen($url)) { throw new \Exception("Requested path canot be resolved to this application."); } $baseUrl = substr($url, 0, strlen(self::$BasePath)); if (strtolower($baseUrl) != strtolower(self::$BasePath)) { throw new \Exception("Document root does not match current path."); } $url = substr($url, strlen(self::$BasePath)); self::$Method = ucfirst(strtolower($_SERVER['REQUEST_METHOD'])); $urlParts = explode('/', $url); array_shift($urlParts); if (!(self::$Controller = array_shift($urlParts))) { self::$Controller = 'Home'; } if (!(self::$Action = array_shift($urlParts))) { self::$Action = 'Index'; } $controllerAction = $this->GetControllerAction(); if ($this->IsAuthenticated()) { $currentUser = self::$Session->user; if (!$controllerAction->IsAuthorized($currentUser)) { self::Redirect('~/Error/Code400', 400); } } elseif (!$controllerAction->IsAuthorized()) { self::Redirect("~/Account/Login", 307); } $arguments = $this->GetParametersFor($controllerAction, $urlParts); $actionResult = Controller::Execute($controllerAction, $arguments); $actionResult->Output(); }
function ExecutePage() { $this->template->setVar('VERSION', VERSION); parent::Execute($this->template); }
$lastact = $databaseobject->set_lastaction(); if ($_POST['login'] || $_POST['login_x']) { $a = session_id(); $_SESSION[session_id() . 'useremail'] = $_POST['useremail']; $na = "'" . $_POST['useremail'] . "'"; $chk = "select * from " . $_POST['usertype'] . " where email=" . $na; $chk1 = @mysql_query($chk); if (@mysql_num_rows($chk1) > 0) { $tt = "test"; } else { $sql = "INSERT INTO temp_email(email,e_date) VALUES ('" . $_POST['email'] . "','" . time() . "')"; mysql_query($sql); } $sql = "INSERT INTO temp_session(svalue) VALUES ('" . $a . "')"; mysql_query($sql); } if ($databaseobject->get_login_id() && $_SERVER['QUERY_STRING'] == '=') { //2nd arg logout button event if ($databaseobject->unset_login_id()) { // print_r($_SESSION); $databaseobject->redirect(HREF_LINK); } } else { /* Controller classes */ require_once $class_path . 'controller.class.php'; //require_once($class_path.'views.class.php'); /* Initialize Controller */ $controller = new Controller($_SERVER['REQUEST_URI']); /* End Controller */ $controller->Execute(); }
public function ExecutePage() { //$timer = new Timer; $session = new Session(); $dba = DBA::Open(); global $settings; foreach ($settings as $key => $val) { $this->template[$key] = $val; } $this->template['date'] = strftime("%a, %B %d"); $this->template['num_queries'] = $dba->NumQueries(); $this->template['IMG_DIR'] = !$session['user'] instanceof Member ? $this->template['imageset'] : $session['user']['imgset']; $this->template['VERSION'] = VERSION; if ($session['user'] instanceof Member) { if ($this->template['checknewpm'] == 1) { if ($dba->GetValue("SELECT COUNT(*) FROM " . PMSGS . " WHERE (poster_id = " . $session['user']['id'] . " AND saved = 1 AND new_reply = 1) OR ((member_id = " . $session['user']['id'] . " OR member_id = 0) AND member_has_read = 0)") == 0) { $this->template->new_pms = array('hide' => TRUE); } } } else { $this->template->new_pms = array('hide' => TRUE); } /* Navigation */ if ($this->template['enablememberlist'] == 0) { $this->template->memberlist_link = array('hide' => TRUE); } if ($this->template['calendarenabled'] == 0) { $this->template->calendar_link = array('hide' => TRUE); } $default_theme = $this->template['styleset']; $styleset = !$session['user'] instanceof Member ? $default_theme : $dba->GetValue("SELECT name FROM " . STYLES . " WHERE id = " . $session['user']['styleset']); $this->template['imageset'] = !$session['user'] instanceof Member ? $this->template['imageset'] : $session['user']['imgset']; $this->template->css_styles = $dba->Query("SELECT * FROM " . CSS . " WHERE style_id = (SELECT id FROM " . STYLES . " WHERE name = '" . $styleset . "') ORDER BY name ASC"); $this->template['load_time'] = $this->timer->__toString(); parent::Execute($this->template, $session); }