diff --git a/config.php b/config.php index dedc467e..f55fa6d5 100644 --- a/config.php +++ b/config.php @@ -230,7 +230,7 @@ $config = array( 'status_port' => '', // other - 'anonymous_usage_statistics' => false, + 'anonymous_usage_statistics' => true, 'email_lai_sec_interval' => 60, // time in seconds between e-mails to one account from lost account interface, block spam 'google_analytics_id' => '', // e.g.: UA-XXXXXXX-X 'experiencetable_columns' => 5, // how many columns to display in experience table page. * experiencetable_rows, 5 = 500 (will show up to 500 level) diff --git a/index.php b/index.php index e1c3044f..4b33b74d 100644 --- a/index.php +++ b/index.php @@ -211,7 +211,8 @@ if(isset($config['anonymous_usage_statistics']) && $config['anonymous_usage_stat } } else { - registerDatabaseConfig('last_usage_report', time()); + registerDatabaseConfig('last_usage_report', time() - ($report_time - (7 * 24 * 60 * 60))); // first report after a week + $should_report = false; } } diff --git a/install/index.php b/install/index.php index 05bd2a12..504ebed6 100644 --- a/install/index.php +++ b/install/index.php @@ -30,16 +30,30 @@ $steps = array(1 => 'welcome', 2 => 'license', 3 => 'requirements', 4 => 'config if(!in_array($step, $steps)) // check if step is valid die('ERROR: Unknown step.'); +$errors = array(); if($step == 'database') { foreach($_POST['vars'] as $key => $value) { - if(empty($value)) + if($key != 'usage' && empty($value)) { - $step = 'config'; - $errors = '

' . $locale['please_fill_all'] . '

'; + $errors[] = $locale['please_fill_all']; break; } + else if($key == 'mail_admin' && !Validator::email($value)) + { + $errors[] = $locale['step_config_mail_admin_error']; + break; + } + else if($key == 'mail_address' && !Validator::email($value)) + { + $errors[] = $locale['step_config_mail_address_error']; + break; + } + } + + if(!empty($errors)) { + $step = 'config'; } } diff --git a/install/steps/config.php b/install/steps/config.php index 650a49e6..2d0a311b 100644 --- a/install/steps/config.php +++ b/install/steps/config.php @@ -79,6 +79,7 @@ echo $twig->render('install.config.html.twig', array( 'clients' => $clients, 'locale' => $locale, 'session' => $_SESSION, + 'errors' => isset($errors) ? $errors : null, 'buttons' => next_buttons() )); ?> \ No newline at end of file diff --git a/system/pages/guilds/save_ranks.php b/system/pages/guilds/save_ranks.php index 00508b1f..55f80e60 100644 --- a/system/pages/guilds/save_ranks.php +++ b/system/pages/guilds/save_ranks.php @@ -10,7 +10,7 @@ */ defined('MYAAC') or die('Direct access not allowed!'); -$guild_name = urldecode($_REQUEST['guild']); +$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null; if(!Validator::guildName($guild_name)) { $errors[] = Validator::get; } diff --git a/system/pages/guilds/show.php b/system/pages/guilds/show.php index a6769401..061cc059 100644 --- a/system/pages/guilds/show.php +++ b/system/pages/guilds/show.php @@ -10,7 +10,7 @@ */ defined('MYAAC') or die('Direct access not allowed!'); -$guild_name = urldecode($_REQUEST['guild']); +$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null; if(!Validator::guildName($guild_name)) $errors[] = Validator::getLastError(); @@ -21,6 +21,7 @@ if(empty($errors)) if(!$guild->isLoaded()) $errors[] = 'Guild with name '.$guild_name.' doesn\'t exist.'; } + if(!empty($errors)) { echo $twig->render('error_box.html.twig', array('errors' => $errors)); diff --git a/system/templates/install.config.html.twig b/system/templates/install.config.html.twig index 5a15246c..90548b19 100644 --- a/system/templates/install.config.html.twig +++ b/system/templates/install.config.html.twig @@ -20,7 +20,7 @@ -
+
@@ -45,5 +46,10 @@ + {% if errors is defined %} + {% for error in errors %} +

{{ error }}

+ {% endfor %} + {% endif %} {{ buttons|raw }} \ No newline at end of file