X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/c2127a10a2623c1be83a66b17e1c5a5b38ed5c62..37a47dbd255874bcdfc14f2e7a5dc1461ddd145e:/install.php diff --git a/install.php b/install.php index 6dbefb5..ebda6f5 100644 --- a/install.php +++ b/install.php @@ -2,7 +2,8 @@ /* * Jirafeau, your web file repository * Copyright (C) 2008 Julien "axolotl" BERNARD - * Copyright (C) 2015 Nicola Spanti (RyDroid) + * Copyright (C) 2015 Jerome Jutteau + * Copyright (C) 2024 Jirafeau project (see AUTHORS.md) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -62,26 +63,26 @@ if (!is_writable(JIRAFEAU_CFG) && !@chmod(JIRAFEAU_CFG, '0666')) { if (isset($_POST['step']) && isset($_POST['next'])) { switch ($_POST['step']) { - case 1: - if (strlen($_POST['admin_password'])) { - $cfg['admin_password'] = hash('sha256', $_POST['admin_password']); - } else { - $cfg['admin_password'] = ''; - } - jirafeau_export_cfg($cfg); - break; - - case 2: - $cfg['web_root'] = jirafeau_add_ending_slash($_POST['web_root']); - $cfg['var_root'] = jirafeau_add_ending_slash($_POST['var_root']); - jirafeau_export_cfg($cfg); - break; - - case 3: - $cfg['web_root'] = jirafeau_add_ending_slash($_POST['web_root']); - $cfg['var_root'] = jirafeau_add_ending_slash($_POST['var_root']); - jirafeau_export_cfg($cfg); - break; + case 1: + if (strlen($_POST['admin_password'])) { + $cfg['admin_password'] = hash('sha256', $_POST['admin_password']); + } else { + $cfg['admin_password'] = ''; + } + jirafeau_export_cfg($cfg); + break; + + case 2: + $cfg['web_root'] = jirafeau_add_ending_slash($_POST['web_root']); + $cfg['var_root'] = jirafeau_add_ending_slash($_POST['var_root']); + jirafeau_export_cfg($cfg); + break; + + case 3: + $cfg['web_root'] = jirafeau_add_ending_slash($_POST['web_root']); + $cfg['var_root'] = jirafeau_add_ending_slash($_POST['var_root']); + jirafeau_export_cfg($cfg); + break; } } @@ -95,20 +96,20 @@ if (isset($_POST['next'])) { } switch ($current) { -case 1: -default: - ?>

+ ?> @@ -117,90 +118,90 @@ default:

+ ?> + echo(empty($cfg['web_root']) ? jirafeau_default_web_root() : $cfg['web_root']); + ?>" size = "40" /> + ?> + ?>" size = "40" />
+ echo t('PREV_STEP'); ?>" />

+ ?>" />

'.$err['why'].'
'.NL; ?>

'.$err['why'].'
'.NL; ?>

'; - } else { - $cfg['installation_done'] = true; - jirafeau_export_cfg($cfg); - echo '

' . - t('JI_FONCTIONAL') . ':' . - '
' . - $cfg['web_root'].'

'; - } -break; + } else { + $cfg['installation_done'] = true; + jirafeau_export_cfg($cfg); + echo '

' . + t('JI_FONCTIONAL') . ':' . + '
' . + $cfg['web_root'].'

'; + } + break; } require(JIRAFEAU_ROOT . 'lib/template/footer.php');