public function execute(HTTPRequestCustom $request) { parent::load_lang($request); $view = new FileTemplate('install/welcome.tpl'); $this->add_navigation($view); return $this->create_response($view); }
public function execute(HTTPRequestCustom $request) { parent::load_lang($request); $this->build_form(); if ($this->submit->has_been_submited()) { $this->handle_form(); } return $this->create_response(); }
public function execute(HTTPRequestCustom $request) { parent::load_lang($request); $this->build_form(); if ($this->submit_button->has_been_submited() && $this->form->validate()) { $host = $this->form->get_value('host'); $port = $this->form->get_value('port'); $login = $this->form->get_value('login'); $password = $this->form->get_value('password'); $schema = $this->form->get_value('schema'); $tables_prefix = $this->form->get_value('tablesPrefix'); $this->handle_form($host, $port, $login, $password, $schema, $tables_prefix); } return $this->create_response(); }
public function execute(HTTPRequestCustom $request) { parent::load_lang($request); $this->build_form(); if ($this->submit_button->has_been_submited() && $this->form->validate()) { $login = $this->form->get_value('email'); if ($this->form->get_value('custom_login', false)) { $login = $this->form->get_value('login'); } $installation_services = new InstallationServices(); $installation_services->create_admin($login, $this->form->get_value('password'), $this->form->get_value('email'), $this->form->get_value('createSession'), $this->form->get_value('autoconnect')); HtaccessFileCache::regenerate(); AppContext::get_response()->redirect(InstallUrlBuilder::finish()); } return $this->create_response(); }
/** * testIndexInvisibleAfterInstallation * * @author Jun Nishikawa <*****@*****.**> * @return void * @expectedException NotFoundException * @expectedExceptionCode 404 */ public function testIndexInvisibleAfterInstallation() { Configure::write('NetCommons.installed', true); $Install = new InstallController(new CakeRequest('/install/index', false), new CakeResponse()); $Install->beforeFilter(); }
define("ON_ROOT", true); require_once "core-settings.php"; require_once "route-settings.php"; session_start(); if (array_key_exists('module', $_GET) && array_key_exists('action', $_GET) && array_key_exists($_GET['module'], $ROUTES) && array_key_exists($_GET['action'], $ROUTES[$_GET['module']])) { $module = $_GET['module']; $action = $_GET['action']; $controller_setting = $ROUTES[$module][$action]; if (in_array($_SERVER['REQUEST_METHOD'], $controller_setting['methods'])) { require_once "controllers/{$module}/{$action}.php"; $controller = new $controller_setting['controller'](); switch ($_SERVER['REQUEST_METHOD']) { case 'GET': $controller->handleGet(); break; case 'POST': $controller->handlePost(); break; } } else { include 'views/405.php'; } } else { if ('GET' == $_SERVER['REQUEST_METHOD'] && empty($_GET)) { require_once "controllers/admin/install.php"; $controller = new InstallController(); $controller->handleGet(); } else { include 'views/404.php'; } }
$app->get('/user/resetpassword/:id/:token', function ($id, $token) use($app) { $userController = new UserController(); $data = $userController->resetpassword($id, $token); $app->render($data['layout'] . '.php', $data); }); $app->get('/user/forgotpassword', function () use($app) { $userController = new UserController(); $data = $userController->forgotpassword(); $app->render($data['layout'] . '.php', $data); }); // POST route $app->post('/user/forgotpassword', function () use($app) { $userController = new UserController(); $data = $userController->forgotpassword(); $app->render($data['layout'] . '.php', $data); }); $app->get('/install', function () use($app) { $installController = new InstallController(); $data = $installController->install(); $app->render($data['layout'] . '.php', $data); }); // POST route $app->post('/install', function () use($app) { $installController = new InstallController(); $data = $installController->install(); $app->render($data['layout'] . '.php', $data); }); if (file_exists('extensions.php')) { require 'extensions.php'; } $app->run();