diff --git a/OBI.php b/OBI.php index f0a51e5..c4182a4 100644 --- a/OBI.php +++ b/OBI.php @@ -76,12 +76,13 @@ if (isset($_POST['save']) && $_POST['save']) { if (empty($input_errors)) { $config['onebuttoninstaller']['storage_path'] = !empty($_POST['storage_path']) ? $_POST['storage_path'] : $g['media_path']; $config['onebuttoninstaller']['storage_path'] = rtrim($config['onebuttoninstaller']['storage_path'],'/'); // ensure to have NO trailing slash - if (strpos($config['onebuttoninstaller']['storage_path'], "/mnt/") === false) { + if (!isset($_POST['path_check']) && (strpos($config['onebuttoninstaller']['storage_path'], "/mnt/") === false)) { $input_errors[] = gettext("The common directory for all extensions MUST be set to a directory below '/mnt/' to prevent to loose the extensions after a reboot on embedded systems!"); } else { if (!is_dir($config['onebuttoninstaller']['storage_path'])) mkdir($config['onebuttoninstaller']['storage_path'], 0775, true); change_perms($config['onebuttoninstaller']['storage_path']); + $config['onebuttoninstaller']['path_check'] = isset($_POST['path_check']) ? true : false; $install_dir = $config['onebuttoninstaller']['storage_path']."/"; // get directory where the installer script resides if (!is_dir("{$install_dir}onebuttoninstaller/log")) { mkdir("{$install_dir}onebuttoninstaller/log", 0775, true); } $return_val = mwexec("fetch {$verify_hostname} -vo {$install_dir}onebuttoninstaller/onebuttoninstaller-install.php 'https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/onebuttoninstaller-install.php'", true); @@ -91,7 +92,7 @@ if (isset($_POST['save']) && $_POST['save']) { } else { $input_errors[] = sprintf(gettext("Installation file %s not found, installation aborted!"), "{$install_dir}onebuttoninstaller/onebuttoninstaller-install.php"); - exit; + return; } mwexec("rm -Rf ext/OBI; rm -f OBI.php", true); header("Location:onebuttoninstaller-config.php"); @@ -107,6 +108,7 @@ if (isset($_POST['cancel']) && $_POST['cancel']) { } $pconfig['storage_path'] = !empty($config['onebuttoninstaller']['storage_path']) ? $config['onebuttoninstaller']['storage_path'] : $g['media_path']; +$pconfig['path_check'] = isset($config['onebuttoninstaller']['path_check']) ? true : false; include("fbegin.inc"); ?>