Monstra General Updates
@@ -31,7 +31,7 @@ class Monstra
|
||||
/**
|
||||
* The version of Monstra
|
||||
*/
|
||||
const VERSION = '3.0.1';
|
||||
const VERSION = '3.0.2';
|
||||
|
||||
|
||||
/**
|
||||
|
160
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');
|
||||
@@ -17,7 +25,11 @@
|
||||
$php_modules = get_loaded_extensions();
|
||||
|
||||
// Get server port
|
||||
if ($_SERVER["SERVER_PORT"] == "80") $port = ""; else $port = ':'.$_SERVER["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 <Install> 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) {
|
||||
@@ -294,12 +337,27 @@
|
||||
$action = '';
|
||||
}
|
||||
?>
|
||||
<?php foreach ($languages_array as $lang_code) { ?>
|
||||
<a data-placement="top" data-toggle="tooltip" class="language-link<?php if (Option::get('language') == $lang_code) echo ' language-link-current';?>" title="<?php echo I18n::$locales[$lang_code]; ?>" href="<?php echo $site_url.'/?language=' . $lang_code.$action; ?>"><img src="<?php echo $site_url; ?>/public/assets/img/flags/<?php echo $lang_code?>.png" alt="<?php echo $lang_code?>"></a>
|
||||
<?php } ?>
|
||||
<?php foreach ($languages_array as $lang_code) {
|
||||
?>
|
||||
<a data-placement="top" data-toggle="tooltip" class="language-link<?php if (Option::get('language') == $lang_code) {
|
||||
echo ' language-link-current';
|
||||
}
|
||||
?>" title="<?php echo I18n::$locales[$lang_code];
|
||||
?>" href="<?php echo $site_url.'/?language=' . $lang_code.$action;
|
||||
?>"><img src="<?php echo $site_url;
|
||||
?>/public/assets/img/flags/<?php echo $lang_code?>.png" alt="<?php echo $lang_code?>"></a>
|
||||
<?php
|
||||
|
||||
} ?>
|
||||
</div>
|
||||
|
||||
<div class="install-block <?php if(Request::get('action') && Request::get('action') == 'install') { ?><?php } else { ?> hide <?php } ?>">
|
||||
<div class="install-block <?php if (Request::get('action') && Request::get('action') == 'install') {
|
||||
?><?php
|
||||
|
||||
} else {
|
||||
?> hide <?php
|
||||
|
||||
} ?>">
|
||||
|
||||
<ul class="list-unstyled">
|
||||
<?php
|
||||
@@ -307,11 +365,12 @@
|
||||
if (Notification::get('errors') && count(Notification::get('errors') > 0)) {
|
||||
foreach (Notification::get('errors') as $error) {
|
||||
?>
|
||||
<li class="error alert alert-danger"><?php echo $error; ?></li>
|
||||
<li class="error alert alert-danger"><?php echo $error;
|
||||
?></li>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
@@ -330,7 +389,9 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Site Name', 'system'); ?></label>
|
||||
<input class="form-control" name="sitename" type="text" value="<?php if (Request::post('sitename')) echo Html::toText(Request::post('sitename')); ?>" />
|
||||
<input class="form-control" name="sitename" type="text" value="<?php if (Request::post('sitename')) {
|
||||
echo Html::toText(Request::post('sitename'));
|
||||
} ?>" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@@ -340,7 +401,9 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Username', 'users'); ?></label>
|
||||
<input class="form-control login" name="login" value="<?php if(Request::post('login')) echo Html::toText(Request::post('login')); ?>" type="text" />
|
||||
<input class="form-control login" name="login" value="<?php if (Request::post('login')) {
|
||||
echo Html::toText(Request::post('login'));
|
||||
} ?>" type="text" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@@ -442,7 +505,9 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Email', 'users'); ?></label>
|
||||
<input name="email" class="form-control" value="<?php if (Request::post('email')) echo Html::toText(Request::post('email')); ?>" type="text" />
|
||||
<input name="email" class="form-control" value="<?php if (Request::post('email')) {
|
||||
echo Html::toText(Request::post('email'));
|
||||
} ?>" type="text" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" class="btn btn-primary" name="install_submit" value="<?php echo __('Install', 'system'); ?>" />
|
||||
@@ -452,7 +517,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="monstra-dialog <?php if(Request::get('action') && Request::get('action') == 'install') { ?>hide<?php } ?>">
|
||||
<div class="monstra-dialog <?php if (Request::get('action') && Request::get('action') == 'install') {
|
||||
?>hide<?php
|
||||
|
||||
} ?>">
|
||||
<ul class="list-unstyled">
|
||||
<?php
|
||||
|
||||
@@ -510,12 +578,24 @@
|
||||
echo '<li class="error alert alert-danger">'.__('Main .htaccess file not writable', 'system').'</li>';
|
||||
}
|
||||
|
||||
if (isset($errors['sitename'])) echo '<li class="error">'.$errors['sitename'].'</li>';
|
||||
if (isset($errors['siteurl'])) echo '<li class="error">'.$errors['siteurl'].'</li>';
|
||||
if (isset($errors['login'])) echo '<li class="error">'.$errors['login'].'</li>';
|
||||
if (isset($errors['password'])) echo '<li class="error">'.$errors['password'].'</li>';
|
||||
if (isset($errors['email'])) echo '<li class="error">'.$errors['email'].'</li>';
|
||||
if (isset($errors['email_valid'])) echo '<li class="error">'.$errors['email_valid'].'</li>';
|
||||
if (isset($errors['sitename'])) {
|
||||
echo '<li class="error">'.$errors['sitename'].'</li>';
|
||||
}
|
||||
if (isset($errors['siteurl'])) {
|
||||
echo '<li class="error">'.$errors['siteurl'].'</li>';
|
||||
}
|
||||
if (isset($errors['login'])) {
|
||||
echo '<li class="error">'.$errors['login'].'</li>';
|
||||
}
|
||||
if (isset($errors['password'])) {
|
||||
echo '<li class="error">'.$errors['password'].'</li>';
|
||||
}
|
||||
if (isset($errors['email'])) {
|
||||
echo '<li class="error">'.$errors['email'].'</li>';
|
||||
}
|
||||
if (isset($errors['email_valid'])) {
|
||||
echo '<li class="error">'.$errors['email_valid'].'</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<a href="install.php?action=install" class="btn btn-primary continue"><?php echo __('Continue', 'system'); ?></a>
|
||||
@@ -523,7 +603,7 @@
|
||||
|
||||
<div class="install-block-footer login-footer">
|
||||
<div class="text-center">
|
||||
<span>© 2012 - 2014 <a href="http://monstra.org" class="small-grey-text" target="_blank">Monstra</a> – <?php echo __('Version', 'system'); ?> <?php echo Monstra::VERSION; ?></span>
|
||||
<span>© 2012 - 2015 <a href="http://monstra.org" class="small-grey-text" target="_blank">Monstra</a> – <?php echo __('Version', 'system'); ?> <?php echo Monstra::VERSION; ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
0
public/assets/img/flags/de.png
Normal file → Executable file
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
0
public/assets/img/flags/en.png
Normal file → Executable file
Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 389 B |
0
public/assets/img/flags/es.png
Normal file → Executable file
Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 398 B |
0
public/assets/img/flags/fa.png
Normal file → Executable file
Before Width: | Height: | Size: 459 B After Width: | Height: | Size: 459 B |
0
public/assets/img/flags/fr.png
Normal file → Executable file
Before Width: | Height: | Size: 356 B After Width: | Height: | Size: 356 B |
0
public/assets/img/flags/hu.png
Normal file → Executable file
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 295 B |
0
public/assets/img/flags/id.png
Normal file → Executable file
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 290 B |
0
public/assets/img/flags/it.png
Normal file → Executable file
Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 359 B |
0
public/assets/img/flags/ja.png
Normal file → Executable file
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 341 B |
0
public/assets/img/flags/lt.png
Normal file → Executable file
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 290 B |
0
public/assets/img/flags/nl.png
Normal file → Executable file
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 295 B |
0
public/assets/img/flags/pl.png
Normal file → Executable file
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 289 B |
0
public/assets/img/flags/pt-br.png
Normal file → Executable file
Before Width: | Height: | Size: 515 B After Width: | Height: | Size: 515 B |
0
public/assets/img/flags/ru.png
Normal file → Executable file
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 282 B |
0
public/assets/img/flags/sk.png
Normal file → Executable file
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 441 B |
0
public/assets/img/flags/tr.png
Normal file → Executable file
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 489 B |
0
public/assets/img/flags/uk.png
Normal file → Executable file
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 290 B |
0
public/assets/img/flags/zh-cn.png
Normal file → Executable file
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 503 B |