mirror of
https://github.com/unraid/webgui.git
synced 2026-02-27 12:48:41 -06:00
@@ -2003,8 +2003,10 @@
|
||||
if (is_file($disk)) unlink($disk);
|
||||
if (is_file($cfg)) unlink($cfg);
|
||||
if (is_file($xml)) unlink($xml);
|
||||
#if (is_dir($dir) && $this->is_dir_empty($dir)) rmdir($dir);
|
||||
if (is_dir($dir) && $this->is_dir_empty($dir)) my_rmdir($dir);
|
||||
if (is_dir($dir) && $this->is_dir_empty($dir)) {
|
||||
$error = my_rmdir($dir);
|
||||
qemu_log("$domain","delete empty $dir $error");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -2845,7 +2845,7 @@ function check_zfs_name($zfsname, $storage="default") {
|
||||
$storage=transpose_user_path($storage);
|
||||
$fstype = trim(shell_exec(" stat -f -c '%T' $storage"));
|
||||
#Check if ZFS.
|
||||
$allowed_chars = "/^[A-Za-z0-9\-_.:]+$/";
|
||||
$allowed_chars = "/^[A-Za-z0-9][A-Za-z0-9\-_.: ]*$/";
|
||||
if ($fstype == "zfs" && !preg_match($allowed_chars, $zfsname)) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -2015,7 +2015,7 @@ function checkName(name) {
|
||||
/* Declare variables at the function scope */
|
||||
var isValidName
|
||||
$('#zfs-name').hide();
|
||||
isValidName = /^[A-Za-z0-9][A-Za-z0-9\-_.:]*$/.test(name);
|
||||
isValidName = /^[A-Za-z0-9][A-Za-z0-9\-_.: ]*$/.test(name);
|
||||
if (isValidName) {
|
||||
$('#btnSubmit').prop("disabled", false);
|
||||
} else {
|
||||
|
||||
@@ -356,8 +356,9 @@ function my_rmdir($dirname) {
|
||||
$rtncode = false;
|
||||
switch ($fstype) {
|
||||
case "zfs":
|
||||
$zfsdataset = trim(shell_exec("zfs list -H -o name $dirname")) ;
|
||||
$rtncode=exec("zfs destroy \"$zfsdataset\"");
|
||||
$zfsoutput = array();
|
||||
$zfsdataset = trim(shell_exec("zfs list -H -o name \"$dirname\"")) ;
|
||||
exec("zfs destroy \"$zfsdataset\"",$zfsoutput,$rtncode);
|
||||
break;
|
||||
case "btrfs":
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user