SessionController::store(); }); $routes->get('/login', function () { SessionController::create(); }); $routes->get('/logout', function () { SessionController::destroy(); }); $routes->get('/signup', function () { UserController::create(); }); $routes->post('/signup', function () { UserController::store(); }); $routes->get('/user', function () { UserController::index(); }); $routes->get('/user/:id', function ($id) { UserController::show($id); }); $routes->post('/user/:id', function ($id) { UserController::update($id); }); $routes->get('/user/:id/edit', function ($id) { UserController::edit($id); }); $routes->get('/user/:id/destroy', function ($id) { UserController::destroy($id); }); $routes->get('/group', function () { GroupController::index();
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ include_once "includes/sp-load.php"; if (isLoggedIn() && $_GET['sec'] != 'logout') { redirectUrl(SP_WEBPATH . "/"); } include_once SP_CTRLPATH . "/user.ctrl.php"; $controller = new UserController(); $controller->view->menu = 'login'; $controller->set('spTitle', 'Seo Panel: Login section'); $controller->set('spDescription', 'Login to Seo Panel and utilise seo tools and plugins to increase the perfomance of your site.'); $controller->set('spKeywords', 'Seo Panel Login section'); if ($_SERVER['REQUEST_METHOD'] == 'POST') { switch ($_POST['sec']) { case "login": $controller->login(); break; default: $controller->index(); break; } } else { switch ($_GET['sec']) { case "logout": $controller->logout(); break; default: $controller->index(); break; } }
$controller = new UserController(); $controller->view->menu = 'login'; $controller->set('spTitle', 'Seo Panel: Login section'); $controller->set('spDescription', 'Login to Seo Panel and utilise seo tools and plugins to increase the perfomance of your site.'); $controller->set('spKeywords', 'Seo Panel Login section'); if ($_SERVER['REQUEST_METHOD'] == 'POST') { switch ($_POST['sec']) { case "login": $controller->login(); break; case "requestpass": $controller->set('spTitle', 'Seo panel forgot password'); $controller->requestPassword($_POST['email']); break; default: $controller->index(); break; } } else { switch ($_GET['sec']) { case "logout": $controller->logout(); break; case "forgot": $controller->set('spTitle', 'Seo Panel forgot password'); $controller->forgotPasswordForm(); break; default: $controller->index($_GET); break; }
<?php require "vendor/autoload.php"; error_reporting(E_ALL); ini_set("display_errors", "On"); //simpler routing mechanism for serving pages $link = $_SERVER['REQUEST_URI']; $userModel = new UserModel(); $userController = new UserController($userModel); $catalogModel = new CatalogModel(); $catalogModel->setCatalog(); $catalogController = new CatalogController($catalogModel); if ($link === '/') { $userController->index(); } elseif ($link === '/login') { $username = $_POST['username']; $password = $_POST['password']; $form_token = $_POST['form_token']; $userController->login($username, $password, $form_token); } elseif ($link === '/logout') { $userController->logout(); } elseif ($link === '/catalog') { $catalogController->index(); } elseif ($link === '/order') { $json = $_POST['order']; $catalogController->order($json); }