Add extra confirmation before extension removal
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
======================
|
======================
|
||||||
Version Description
|
Version Description
|
||||||
|
|
||||||
|
1.0.56......Add extra confirmation before extension removal.
|
||||||
1.0.55......Add backup path config check.
|
1.0.55......Add backup path config check.
|
||||||
1.0.54......Don't skip ZFS activation if "Available but not enabled" status displayed.
|
1.0.54......Don't skip ZFS activation if "Available but not enabled" status displayed.
|
||||||
1.0.53......Add initial ZFS activation guided support.
|
1.0.53......Add initial ZFS activation guided support.
|
||||||
|
|||||||
@@ -94,48 +94,52 @@ if ($_POST) {
|
|||||||
|
|
||||||
// Remove only extension related files during cleanup.
|
// Remove only extension related files during cleanup.
|
||||||
if (isset($_POST['uninstall']) && $_POST['uninstall']) {
|
if (isset($_POST['uninstall']) && $_POST['uninstall']) {
|
||||||
bindtextdomain("xigmanas", $textdomain);
|
if(isset($_POST['delete_confirm']) && $_POST['delete_confirm']):
|
||||||
if (is_link($textdomain_bastille)) mwexec("rm -f {$textdomain_bastille}", true);
|
bindtextdomain("xigmanas", $textdomain);
|
||||||
if (is_dir($confdir)) mwexec("rm -Rf {$confdir}", true);
|
if (is_link($textdomain_bastille)) mwexec("rm -f {$textdomain_bastille}", true);
|
||||||
mwexec("rm /usr/local/www/bastille_manager_gui.php && rm -R /usr/local/www/ext/bastille", true);
|
if (is_dir($confdir)) mwexec("rm -Rf {$confdir}", true);
|
||||||
mwexec("{$rootfolder}/usr/local/sbin/bastille-init -t", true);
|
mwexec("rm /usr/local/www/bastille_manager_gui.php && rm -R /usr/local/www/ext/bastille", true);
|
||||||
$uninstall_cmd = "echo 'y' | /usr/local/sbin/bastille-init -U";
|
mwexec("{$rootfolder}/usr/local/sbin/bastille-init -t", true);
|
||||||
mwexec($uninstall_cmd, true);
|
$uninstall_cmd = "echo 'y' | /usr/local/sbin/bastille-init -U";
|
||||||
if (is_link("/usr/local/share/{$prdname}")) mwexec("rm /usr/local/share/{$prdname}", true);
|
mwexec($uninstall_cmd, true);
|
||||||
if (is_link("/var/cache/pkg")) mwexec("rm /var/cache/pkg", true);
|
if (is_link("/usr/local/share/{$prdname}")) mwexec("rm /usr/local/share/{$prdname}", true);
|
||||||
if (is_link("/var/db/pkg")) mwexec("rm /var/db/pkg && mkdir /var/db/pkg", true);
|
if (is_link("/var/cache/pkg")) mwexec("rm /var/cache/pkg", true);
|
||||||
|
if (is_link("/var/db/pkg")) mwexec("rm /var/db/pkg && mkdir /var/db/pkg", true);
|
||||||
|
|
||||||
// Remove start postinit cmd in later product versions.
|
// Remove start postinit cmd in later product versions.
|
||||||
if (is_array($config['rc']) && is_array($config['rc']['param'])) {
|
if (is_array($config['rc']) && is_array($config['rc']['param'])) {
|
||||||
$postinit_cmd = "{$rootfolder}/bastille-init";
|
$postinit_cmd = "{$rootfolder}/bastille-init";
|
||||||
$value = $postinit_cmd;
|
$value = $postinit_cmd;
|
||||||
$sphere_array = &$config['rc']['param'];
|
$sphere_array = &$config['rc']['param'];
|
||||||
$updateconfigfile = false;
|
|
||||||
if (false !== ($index = array_search_ex($value, $sphere_array, 'value'))) {
|
|
||||||
unset($sphere_array[$index]);
|
|
||||||
$updateconfigfile = true;
|
|
||||||
}
|
|
||||||
if ($updateconfigfile) {
|
|
||||||
write_config();
|
|
||||||
$updateconfigfile = false;
|
$updateconfigfile = false;
|
||||||
|
if (false !== ($index = array_search_ex($value, $sphere_array, 'value'))) {
|
||||||
|
unset($sphere_array[$index]);
|
||||||
|
$updateconfigfile = true;
|
||||||
|
}
|
||||||
|
if ($updateconfigfile) {
|
||||||
|
write_config();
|
||||||
|
$updateconfigfile = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
// Remove stop postinit cmd in later product versions.
|
||||||
// Remove stop postinit cmd in later product versions.
|
if (is_array($config['rc']) && is_array($config['rc']['param'])) {
|
||||||
if (is_array($config['rc']) && is_array($config['rc']['param'])) {
|
$shutdown_cmd = "{$rootfolder}/bastille-init -p";
|
||||||
$shutdown_cmd = "{$rootfolder}/bastille-init -p";
|
$value = $shutdown_cmd;
|
||||||
$value = $shutdown_cmd;
|
$sphere_array = &$config['rc']['param'];
|
||||||
$sphere_array = &$config['rc']['param'];
|
|
||||||
$updateconfigfile = false;
|
|
||||||
if (false !== ($index = array_search_ex($value, $sphere_array, 'value'))) {
|
|
||||||
unset($sphere_array[$index]);
|
|
||||||
$updateconfigfile = true;
|
|
||||||
}
|
|
||||||
if ($updateconfigfile) {
|
|
||||||
write_config();
|
|
||||||
$updateconfigfile = false;
|
$updateconfigfile = false;
|
||||||
|
if (false !== ($index = array_search_ex($value, $sphere_array, 'value'))) {
|
||||||
|
unset($sphere_array[$index]);
|
||||||
|
$updateconfigfile = true;
|
||||||
|
}
|
||||||
|
if ($updateconfigfile) {
|
||||||
|
write_config();
|
||||||
|
$updateconfigfile = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
header("Location:index.php");
|
||||||
header("Location:index.php");
|
else:
|
||||||
|
$input_errors[] = gtext('Confirmation is required for extension removal.');
|
||||||
|
endif;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['save']) && $_POST['save']) {
|
if (isset($_POST['save']) && $_POST['save']) {
|
||||||
@@ -347,6 +351,7 @@ $(document).ready(function(){
|
|||||||
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
||||||
<?php html_separator();?>
|
<?php html_separator();?>
|
||||||
<?php html_titleline(gtext("Uninstall"));?>
|
<?php html_titleline(gtext("Uninstall"));?>
|
||||||
|
<?php html_checkbox2('delete_confirm',gtext('Uninstall confirm'),'' ? true : false,gtext('Check to confirm extension uninstall. Note: Jail related content will be preserved by default.'),'',false);?>
|
||||||
<?php html_separator();?>
|
<?php html_separator();?>
|
||||||
</table>
|
</table>
|
||||||
<div id="submit1">
|
<div id="submit1">
|
||||||
|
|||||||
Reference in New Issue
Block a user