diff --git a/engine/Monstra.php b/engine/Monstra.php index d2a7bb6..ca627c3 100644 --- a/engine/Monstra.php +++ b/engine/Monstra.php @@ -31,7 +31,7 @@ class Monstra /** * The version of Monstra */ - const VERSION = '3.0.1'; + const VERSION = '3.0.2'; /** diff --git a/install.php b/install.php index 010fd65..e8b5cb6 100644 --- a/install.php +++ b/install.php @@ -5,10 +5,18 @@ */ // Main engine defines - if ( ! defined('DS')) define('DS', DIRECTORY_SEPARATOR); - if ( ! defined('ROOT')) define('ROOT', rtrim(dirname(__FILE__), '\\/')); - if ( ! defined('BACKEND')) define('BACKEND', false); - if ( ! defined('MONSTRA_ACCESS')) define('MONSTRA_ACCESS', true); + if (! defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); + } + if (! defined('ROOT')) { + define('ROOT', rtrim(dirname(__FILE__), '\\/')); + } + if (! defined('BACKEND')) { + define('BACKEND', false); + } + if (! defined('MONSTRA_ACCESS')) { + define('MONSTRA_ACCESS', true); + } // Load bootstrap file require_once(ROOT . DS . 'engine' . DS . '_init.php'); @@ -16,9 +24,13 @@ // Get array with the names of all modules compiled and loaded $php_modules = get_loaded_extensions(); - // Get server port - if ($_SERVER["SERVER_PORT"] == "80") $port = ""; else $port = ':'.$_SERVER["SERVER_PORT"]; - + // Get server port + if ($_SERVER["SERVER_PORT"] == "80") { + $port = ""; + } else { + $port = ':'.$_SERVER["SERVER_PORT"]; + } + // Get site URL $site_url = 'http://'.$_SERVER["SERVER_NAME"].$port.str_replace(array("index.php", "install.php"), "", $_SERVER['PHP_SELF']); @@ -35,7 +47,7 @@ $dir_array = array('public', 'storage', 'backups', 'tmp'); // Languages array - $languages_array = array('en', 'ru', 'fr', 'de', 'it', 'es', 'lt', 'pl', 'pt-br', 'hu', 'fa' , 'sk', 'uk', 'nl', 'sr-yu', 'id', 'ja', 'zh-cn', 'tr'); + $languages_array = array('en', 'ru', 'fr', 'de', 'it', 'es', 'lt', 'pl', 'pt-br', 'hu', 'fa' , 'sk', 'uk', 'nl', 'sr', 'id', 'ja', 'zh-cn', 'tr'); // Select Monstra language if (Request::get('language')) { @@ -55,23 +67,54 @@ // If pressed button then try to install 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; + 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; + } // If errors is 0 then install cms if (count($errors) == 0) { @@ -104,14 +147,14 @@ $htaccess = file_get_contents('.htaccess'); $save_htaccess_content = str_replace("/%siteurlhere%/", $rewrite_base, $htaccess); - $handle = fopen ('.htaccess', "w"); + $handle = fopen('.htaccess', "w"); fwrite($handle, $save_htaccess_content); fclose($handle); // Installation done :) header("location: index.php?install=done"); - } else { - Notification::setNow('errors', $errors); + } else { + Notification::setNow('errors', $errors); } } ?> @@ -144,7 +187,7 @@ .monstra-dialog, .install-block-footer { margin: 0 auto; - width: 600px; + width: 600px; } .install-block-footer { @@ -152,7 +195,7 @@ margin-bottom: 20px; } - .well { + .well { border: none; border-radius: 0px; background: #fff; @@ -200,7 +243,7 @@ .language-link img { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; - filter: alpha(opacity=30); + filter: alpha(opacity=30); -khtml-opacity: 0.3; -moz-opacity:0.3; opacity: 0.3; @@ -241,19 +284,19 @@ } if (in_array('SimpleXML', $php_modules)) { - $errors['simplexml'] = ''; + $errors['simplexml'] = ''; } else { - $errors['simplexml'] = 'error'; + $errors['simplexml'] = 'error'; } if (function_exists('apache_get_modules')) { - if ( ! in_array('mod_rewrite', apache_get_modules())) { + if (! in_array('mod_rewrite', apache_get_modules())) { $errors['mod_rewrite'] = 'error'; } else { - $errors['mod_rewrite'] = ''; + $errors['mod_rewrite'] = ''; } } else { - $errors['mod_rewrite'] = ''; + $errors['mod_rewrite'] = ''; } if (is_writable(__FILE__)) { @@ -294,24 +337,40 @@ $action = ''; } ?> - - <?php echo $lang_code?> - - - -
+ + <?php echo $lang_code?> + +
+ +
@@ -330,7 +389,9 @@
- +
@@ -340,7 +401,9 @@
- +
@@ -442,17 +505,22 @@
- -
+ +
-
+
-
+
    '.__('Apache Mod Rewrite is required', 'system').''; } else { echo '
  • '.__('Module Mod Rewrite is installed', 'system').'
  • '; @@ -510,26 +578,38 @@ echo '
  • '.__('Main .htaccess file not writable', 'system').'
  • '; } - if (isset($errors['sitename'])) echo '
  • '.$errors['sitename'].'
  • '; - if (isset($errors['siteurl'])) echo '
  • '.$errors['siteurl'].'
  • '; - if (isset($errors['login'])) echo '
  • '.$errors['login'].'
  • '; - if (isset($errors['password'])) echo '
  • '.$errors['password'].'
  • '; - if (isset($errors['email'])) echo '
  • '.$errors['email'].'
  • '; - if (isset($errors['email_valid'])) echo '
  • '.$errors['email_valid'].'
  • '; + if (isset($errors['sitename'])) { + echo '
  • '.$errors['sitename'].'
  • '; + } + if (isset($errors['siteurl'])) { + echo '
  • '.$errors['siteurl'].'
  • '; + } + if (isset($errors['login'])) { + echo '
  • '.$errors['login'].'
  • '; + } + if (isset($errors['password'])) { + echo '
  • '.$errors['password'].'
  • '; + } + if (isset($errors['email'])) { + echo '
  • '.$errors['email'].'
  • '; + } + if (isset($errors['email_valid'])) { + echo '
  • '.$errors['email_valid'].'
  • '; + } ?>
- +