mirror of
https://github.com/JRGTH/xigmanas-bastille-extension.git
synced 2025-12-11 09:21:09 +01:00
Plugin/template icons code changes
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
======================
|
||||
Version Description
|
||||
|
||||
1.0.44......Plugin/template icons code changes.
|
||||
1.0.43......Add Swedish translation, thanks to Anders Malm.
|
||||
1.0.42......Update to new simplified bastille config, obsolete code cleanup.
|
||||
1.0.41......Set target jail path on advanced config editor by default.
|
||||
|
||||
@@ -212,9 +212,11 @@ function get_jail_infos() {
|
||||
$r['stat'] = $img_path['dis'];
|
||||
endif;
|
||||
// Display custom template icons if available.
|
||||
$item = $item;
|
||||
$template_icon = "{$image_dir}/{$item}_icon.png";
|
||||
$template_icon = "{$jail_dir}/{$item}/plugin_icon.png";
|
||||
if(file_exists($template_icon)):
|
||||
if(!file_exists("{$image_dir}/{$item}_icon.png")):
|
||||
copy("$template_icon", "{$image_dir}/{$item}_icon.png");
|
||||
endif;
|
||||
$r['logo'] = "{$image_dir}/{$item}_icon.png";
|
||||
else:
|
||||
// Display standard FreeBSD icon.
|
||||
@@ -225,5 +227,4 @@ function get_jail_infos() {
|
||||
endforeach;
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -291,6 +291,7 @@ if($_POST):
|
||||
$container['jailname'] = $_POST['jailname'];
|
||||
$confirm_name = $pconfig['confirmname'];
|
||||
$item = $container['jailname'];
|
||||
$plugin_icon = "{$image_dir}/{$item}_icon.png";
|
||||
|
||||
if(strcmp($confirm_name, $item) !== 0):
|
||||
$input_errors[] = gtext("Failed to destroy container, name confirmation is required.");
|
||||
@@ -304,6 +305,9 @@ if($_POST):
|
||||
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
||||
if($retval == 0):
|
||||
exec("/usr/sbin/sysrc -f {$configfile} -qx {$item}_AUTO_START");
|
||||
if(file_exists($plugin_icon)):
|
||||
unlink($plugin_icon);
|
||||
endif;
|
||||
header('Location: bastille_manager_gui.php');
|
||||
exit;
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user