forked from Mirrors/nas4free-onebuttoninstaller
force common directory to set below /mnt/
This commit is contained in:
33
OBI.php
33
OBI.php
@@ -76,21 +76,26 @@ 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 (!is_dir($config['onebuttoninstaller']['storage_path'])) mkdir($config['onebuttoninstaller']['storage_path'], 0775, true);
|
||||
change_perms($config['onebuttoninstaller']['storage_path']);
|
||||
$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);
|
||||
if ($return_val == 0) {
|
||||
chmod("{$install_dir}onebuttoninstaller/onebuttoninstaller-install.php", 0775);
|
||||
require_once("{$install_dir}onebuttoninstaller/onebuttoninstaller-install.php");
|
||||
if (strpos($config['onebuttoninstaller']['storage_path'], "/mnt/") === false) {
|
||||
$input_errors[] = gettext("The common directory for all extensions MUST be set to a directory below <b>'/mnt/'</b> to prevent to loose the extensions after a reboot on embedded systems!");
|
||||
}
|
||||
else {
|
||||
$input_errors[] = sprintf(gettext("Installation file %s not found, installation aborted!"), "{$install_dir}onebuttoninstaller/onebuttoninstaller-install.php");
|
||||
exit;
|
||||
else {
|
||||
if (!is_dir($config['onebuttoninstaller']['storage_path'])) mkdir($config['onebuttoninstaller']['storage_path'], 0775, true);
|
||||
change_perms($config['onebuttoninstaller']['storage_path']);
|
||||
$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);
|
||||
if ($return_val == 0) {
|
||||
chmod("{$install_dir}onebuttoninstaller/onebuttoninstaller-install.php", 0775);
|
||||
require_once("{$install_dir}onebuttoninstaller/onebuttoninstaller-install.php");
|
||||
}
|
||||
else {
|
||||
$input_errors[] = sprintf(gettext("Installation file %s not found, installation aborted!"), "{$install_dir}onebuttoninstaller/onebuttoninstaller-install.php");
|
||||
exit;
|
||||
}
|
||||
mwexec("rm -Rf ext/OBI; rm -f OBI.php", true);
|
||||
header("Location:onebuttoninstaller-config.php");
|
||||
}
|
||||
mwexec("rm -Rf ext/OBI; rm -f OBI.php", true);
|
||||
header("Location:onebuttoninstaller-config.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +116,7 @@ include("fbegin.inc"); ?>
|
||||
<?php if (!empty($savemsg)) print_info_box($savemsg);?>
|
||||
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
||||
<?php html_titleline($application);?>
|
||||
<?php html_filechooser("storage_path", gettext("Common directory"), $pconfig['storage_path'], gettext("Common root directory for all extensions (a persistant place where all extensions are/should be - a directory below <b>/mnt/</b>)."), $pconfig['storage_path'], true, 60);?>
|
||||
<?php html_filechooser("storage_path", gettext("Common directory"), $pconfig['storage_path'], gettext("Common directory for all extensions (a persistant place where all extensions are/should be - a directory below <b>/mnt/</b>)."), $pconfig['storage_path'], true, 60);?>
|
||||
</table>
|
||||
<div id="submit">
|
||||
<input id="save" name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>"/>
|
||||
|
||||
@@ -82,10 +82,15 @@ if (isset($_POST['save']) && $_POST['save']) {
|
||||
$config['onebuttoninstaller']['enable'] = isset($_POST['enable']) ? true : false;
|
||||
$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 (!is_dir($config['onebuttoninstaller']['storage_path'])) mkdir($config['onebuttoninstaller']['storage_path'], 0775, true);
|
||||
change_perms($_POST['storage_path']);
|
||||
$config['onebuttoninstaller']['auto_update'] = isset($_POST['auto_update']) ? true : false;
|
||||
$savemsg .= get_std_save_message(write_config());
|
||||
if (strpos($config['onebuttoninstaller']['storage_path'], "/mnt/") === false) {
|
||||
$input_errors[] = gettext("The common directory for all extensions MUST be set to a directory below <b>'/mnt/'</b> 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($_POST['storage_path']);
|
||||
$config['onebuttoninstaller']['auto_update'] = isset($_POST['auto_update']) ? true : false;
|
||||
$savemsg .= get_std_save_message(write_config());
|
||||
}
|
||||
} // end of empty input_errors
|
||||
}
|
||||
|
||||
@@ -126,7 +131,7 @@ function enable_change(enable_change) {
|
||||
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
||||
<?php html_titleline_checkbox("enable", gettext("OneButtonInstaller"), $pconfig['enable'], gettext("Enable"), "enable_change(false)");?>
|
||||
<?php html_text("installation_directory", gettext("Installation directory"), sprintf(gettext("The extension is installed in %s."), $config['onebuttoninstaller']['rootfolder']));?>
|
||||
<?php html_filechooser("storage_path", gettext("Common directory"), $pconfig['storage_path'], gettext("Common root directory for all extensions (a persistant place where all extensions are/should be - a directory below <b>/mnt/</b>)."), $pconfig['storage_path'], true, 60);?>
|
||||
<?php html_filechooser("storage_path", gettext("Common directory"), $pconfig['storage_path'], gettext("Common directory for all extensions (a persistant place where all extensions are/should be - a directory below <b>/mnt/</b>)."), $pconfig['storage_path'], true, 60);?>
|
||||
<?php html_checkbox("auto_update", gettext("Update"), $pconfig['auto_update'], gettext("Update extensions list automatically."), "", false);?>
|
||||
</table>
|
||||
<div id="submit">
|
||||
|
||||
@@ -232,9 +232,9 @@ bindtextdomain("nas4free", "/usr/local/share/locale-obi"); ?>
|
||||
</table>
|
||||
<div id="remarks">
|
||||
<?php html_remark("note", gettext("Note"), gettext("After successful installation extensions can be found under the 'Extensions' entry in the navigation bar.")."<br /><b>".gettext("Some extensions need to finish their installation procedures on their own extension page before they will be shown as installed!")."</b><br /><br />");?>
|
||||
<?php html_remark("legend", sprintf(gettext("Icons in the %s column"), gettext("Install")), "");?>
|
||||
<img src='images/status_disabled.png' border='0' alt='' title='' /> <?php echo "... ".gettext("The extension can not be installed because of an unsupported architecture/platform/release of the system. Hover with the mouse over the icon to see what is unsupported.");?><br />
|
||||
<img src='images/status_enabled.png' border='0' alt='' title='' /> <?php echo "... ".gettext("The extension is already installed."); ?><br /><br />
|
||||
<?php html_remark("legend", sprintf(gettext("Icons in the %s column"), "'".gettext("Install")."'"), "");?>
|
||||
<img src='<?=$image_path?>status_disabled.png' border='0' alt='' title='' /> <?php echo "... ".gettext("The extension can not be installed because of an unsupported architecture/platform/release of the system. Hover with the mouse over the icon to see what is unsupported.");?><br />
|
||||
<img src='<?=$image_path?>status_enabled.png' border='0' alt='' title='' /> <?php echo "... ".gettext("The extension is already installed."); ?><br /><br />
|
||||
</div>
|
||||
<div id="submit">
|
||||
<input name="install" type="submit" class="formbtn" title="<?=gettext("Install extensions");?>" value="<?=gettext("Install");?>" onclick="return confirm('<?=gettext("Ready to install the selected extensions?");?>')" />
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user