From a72d99c4ddbd3f8002f361ce9dab93f6becb020f Mon Sep 17 00:00:00 2001 From: Awilum Date: Tue, 25 Sep 2012 19:36:24 +0300 Subject: [PATCH] Install Script Improvments --- install.php | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/install.php b/install.php index 4f2a4a6..680d585 100644 --- a/install.php +++ b/install.php @@ -13,8 +13,8 @@ // Set default timezone $system_timezone = 'Kwajalein'; - // Include engine core - include 'monstra/bootstrap.php'; + // Load bootstrap file + require_once(ROOT . DS . 'monstra' . DS . 'bootstrap.php'); // Setting error display depending on debug mode or not // Get php version id @@ -38,9 +38,9 @@ $dir_array = array('public', 'storage', 'backups', 'tmp'); // Select Monstra language - if (isset($_GET['language'])) { - if (in_array($_GET['language'], array('en', 'ru'))) { - if (Option::update('language', $_GET['language'])) { + if (Request::get('language')) { + if (in_array(Request::get('language'), array('en', 'ru'))) { + if (Option::update('language', Request::get('language'))) { Request::redirect($site_url); } } else { @@ -49,23 +49,24 @@ } // If pressed button then try to install - if (isset($_POST['install_submit'])) { - if (empty($_POST['sitename'])) $errors['sitename'] = __('Field "Site name" is empty', 'system'); - if (empty($_POST['siteurl'])) $errors['siteurl'] = __('Field "Site url" is empty', 'system'); - if (empty($_POST['login'])) $errors['login'] = __('Field "Username" is empty', 'system'); - if (empty($_POST['password'])) $errors['password'] = __('Field "Password" is empty', 'system'); - if (empty($_POST['email'])) $errors['email'] = __('Field "Email" is empty', 'system'); - if ( ! Valid::email($_POST['email'])) $errors['email_valid'] = __('Email not valid', 'system'); - if (trim($_POST['php']) !== '') $errors['php'] = true; - if (trim($_POST['simplexml']) !== '') $errors['simplexml'] = true; - if (trim($_POST['mod_rewrite']) !== '') $errors['mod_rewrite'] = true; - if (trim($_POST['htaccess']) !== '') $errors['htaccess'] = true; - if (trim($_POST['sitemap']) !== '') $errors['sitemap'] = true; - if (trim($_POST['install']) !== '') $errors['install'] = true; - if (trim($_POST['public']) !== '') $errors['public'] = true; - if (trim($_POST['storage']) !== '') $errors['storage'] = true; - if (trim($_POST['backups']) !== '') $errors['backups'] = true; - if (trim($_POST['tmp']) !== '') $errors['tmp'] = true; + if (Request::post('install_submit')) { + + if (Request::post('sitename') == '') $errors['sitename'] = __('Field "Site name" is empty', 'system'); + if (Request::post('siteurl') == '') $errors['siteurl'] = __('Field "Site url" is empty', 'system'); + if (Request::post('login') == '') $errors['login'] = __('Field "Username" is empty', 'system'); + if (Request::post('password') == '') $errors['password'] = __('Field "Password" is empty', 'system'); + if (Request::post('email') == '') $errors['email'] = __('Field "Email" is empty', 'system'); + if ( ! Valid::email(Request::post('email'))) $errors['email_valid'] = __('Email not valid', 'system'); + if (trim(Request::post('php') !== '')) $errors['php'] = true; + if (trim(Request::post('simplexml') !== '')) $errors['simplexml'] = true; + if (trim(Request::post('mod_rewrite') !== '')) $errors['mod_rewrite'] = true; + if (trim(Request::post('htaccess') !== '')) $errors['htaccess'] = true; + if (trim(Request::post('sitemap') !== '')) $errors['sitemap'] = true; + if (trim(Request::post('install') !== '')) $errors['install'] = true; + if (trim(Request::post('public') !== '')) $errors['public'] = true; + if (trim(Request::post('storage') !== '')) $errors['storage'] = true; + if (trim(Request::post('backups') !== '')) $errors['backups'] = true; + if (trim(Request::post('tmp') !== '')) $errors['tmp'] = true; @@ -250,13 +251,13 @@ - +

- +
@@ -352,7 +353,7 @@ - +