X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/4f9997a1d5ecf5ae89ca522d4d095116057c7076..11233d68c69637b4c3eee55ffae78033c5dae1a9:/install.php diff --git a/install.php b/install.php index f83faf0..ae4bd99 100644 --- a/install.php +++ b/install.php @@ -2,6 +2,7 @@ /* * Jirafeau, your web file repository * Copyright (C) 2008 Julien "axolotl" BERNARD + * Copyright (C) 2015 Nicola Spanti (RyDroid) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -14,7 +15,7 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); define ('NL', "\n"); @@ -67,9 +68,7 @@ jirafeau_export_cfg ($cfg) function jirafeau_mkdir ($path) { - if (!file_exists ($path) && !@mkdir ($path, 0755)) - return false; - return true; + return !(!file_exists ($path) && !@mkdir ($path, 0755)); } /** @@ -89,7 +88,7 @@ function jirafeau_check_var_dir ($path) { $mkdir_str1 = t('The following directory could not be created') . ':'; - $mkdir_str2 = t('You should create this directory by hand.'); + $mkdir_str2 = t('You should create this directory manually.'); $write_str1 = t('The following directory is not writable') . ':'; $write_str2 = t('You should give the write permission to the web server on ' . 'this directory.'); @@ -101,7 +100,7 @@ jirafeau_check_var_dir ($path) $path . '
' . $solution_str . '
' . $mkdir_str2); - foreach (array ('files', 'links', 'async') as $subdir) + foreach (array ('files', 'links', 'async', 'alias') as $subdir) { $subpath = $path.$subdir; @@ -136,7 +135,7 @@ if (!file_exists (JIRAFEAU_CFG)) echo '

' . t('The local configuration file could not be created. Create a ' . 'lib/config.local.php file and give the write ' . - 'right to the web server (preferred solution), or give the ' . + 'permission to the web server (preferred solution), or give the ' . 'write permission to the web server on the lib ' . 'directory.') . '

'; @@ -167,7 +166,7 @@ if (isset ($_POST['step']) && isset ($_POST['next'])) break; case 2: - $cfg['admin_password'] = $_POST['admin_password']; + $cfg['admin_password'] = hash('sha256', $_POST['admin_password']); jirafeau_export_cfg ($cfg); break; @@ -182,8 +181,6 @@ if (isset ($_POST['step']) && isset ($_POST['next'])) $cfg['var_root'] = jirafeau_add_ending_slash ($_POST['var_root']); jirafeau_export_cfg ($cfg); break; - - default: break; } } @@ -235,7 +232,7 @@ default: "" />