mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
* ask user for timezone on install
* remember status of the installation * moved clients list to the new file * verify if client and timezone is correct on install
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
if(isset($config['installed']) && $config['installed'] && !isset($_SESSION['saved'])) {
|
||||
if(isset($config['installed']) && $config['installed'] && !isset($_SESSION['saved']) && !isset($install_status['step'])) {
|
||||
echo '<p class="warning">' . $locale['already_installed'] . '</p>';
|
||||
}
|
||||
else {
|
||||
|
@@ -1,74 +1,8 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
$clients_list = array(
|
||||
710,
|
||||
740,
|
||||
750,
|
||||
760,
|
||||
770,
|
||||
772,
|
||||
780,
|
||||
792,
|
||||
800,
|
||||
810,
|
||||
821,
|
||||
822,
|
||||
831,
|
||||
840,
|
||||
841,
|
||||
842,
|
||||
850,
|
||||
852,
|
||||
853,
|
||||
854,
|
||||
855,
|
||||
857,
|
||||
860,
|
||||
870,
|
||||
|
||||
900,
|
||||
910,
|
||||
920,
|
||||
930,
|
||||
940,
|
||||
942,
|
||||
944,
|
||||
946,
|
||||
950,
|
||||
952,
|
||||
953,
|
||||
954,
|
||||
960,
|
||||
970,
|
||||
980,
|
||||
|
||||
1000,
|
||||
1010,
|
||||
1021,
|
||||
1031,
|
||||
1034,
|
||||
1041,
|
||||
1050,
|
||||
1053,
|
||||
1054,
|
||||
1058,
|
||||
1075,
|
||||
1077,
|
||||
1079,
|
||||
1080,
|
||||
1090,
|
||||
1093,
|
||||
1094,
|
||||
1095,
|
||||
1096,
|
||||
1097,
|
||||
1098,
|
||||
1100,
|
||||
);
|
||||
|
||||
$clients = array();
|
||||
foreach($clients_list as $client) {
|
||||
foreach($config['clients'] as $client) {
|
||||
$client_version = (string)($client / 100);
|
||||
if(strpos($client_version, '.') == false)
|
||||
$client_version .= '.0';
|
||||
@@ -78,6 +12,7 @@ foreach($clients_list as $client) {
|
||||
|
||||
echo $twig->render('install.config.html.twig', array(
|
||||
'clients' => $clients,
|
||||
'timezones' => DateTimeZone::listIdentifiers(),
|
||||
'locale' => $locale,
|
||||
'session' => $_SESSION,
|
||||
'errors' => isset($errors) ? $errors : null,
|
||||
|
@@ -15,6 +15,10 @@ if(!$error) {
|
||||
$content .= PHP_EOL;
|
||||
$content .= '// place for your configuration directives, so you can later easily update myaac';
|
||||
$content .= PHP_EOL;
|
||||
$content .= '$config[\'installed\'] = true;';
|
||||
$content .= PHP_EOL;
|
||||
$content .= '$config[\'mail_enabled\'] = true;';
|
||||
$content .= PHP_EOL;
|
||||
foreach($_SESSION as $key => $value)
|
||||
{
|
||||
if(strpos($key, 'var_') !== false)
|
||||
@@ -23,14 +27,14 @@ if(!$error) {
|
||||
{
|
||||
$value = str_replace("\\", "/", $value);
|
||||
if($value[strlen($value) - 1] != '/')
|
||||
$value .= "/";
|
||||
$value .= '/';
|
||||
}
|
||||
|
||||
if($key == 'var_usage') {
|
||||
$content .= '$config[\'anonymous_usage_statistics\'] = ' . ((int)$value == 1 ? 'true' : 'false') . ';';
|
||||
$content .= PHP_EOL;
|
||||
}
|
||||
else if($key != 'var_account' && $key != 'var_account_id' && $key != 'var_password') {
|
||||
else if($key != 'var_account' && $key != 'var_account_id' && $key != 'var_password' && $key != 'var_step') {
|
||||
$content .= '$config[\'' . str_replace('var_', '', $key) . '\'] = \'' . $value . '\';';
|
||||
$content .= PHP_EOL;
|
||||
}
|
||||
@@ -224,11 +228,6 @@ if(!$error) {
|
||||
}
|
||||
|
||||
if(!$error) {
|
||||
$content .= '$config[\'installed\'] = true;';
|
||||
$content .= PHP_EOL;
|
||||
|
||||
$content .= '$config[\'mail_enabled\'] = true;';
|
||||
$content .= PHP_EOL;
|
||||
if(!Validator::email($_SESSION['var_mail_admin'])) {
|
||||
error($locale['step_config_mail_admin_error']);
|
||||
$error = true;
|
||||
|
@@ -235,6 +235,9 @@ else {
|
||||
unset($_SESSION[$key]);
|
||||
}
|
||||
unset($_SESSION['saved']);
|
||||
if(file_exists(CACHE . 'install.txt')) {
|
||||
unlink(CACHE . 'install.txt');
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user