From b03a4e436b0646dcdc1495b732404a6ecf91028c Mon Sep 17 00:00:00 2001 From: Tom Mortensen Date: Mon, 17 Mar 2025 12:18:39 -0700 Subject: [PATCH] fix: if singled disabled array disk, should still be able to create shares --- emhttp/plugins/dynamix/ShareList.page | 27 ++++++++------------ emhttp/plugins/dynamix/include/DiskList.php | 27 ++++++++------------ emhttp/plugins/dynamix/include/ShareList.php | 13 +++------- 3 files changed, 25 insertions(+), 42 deletions(-) diff --git a/emhttp/plugins/dynamix/ShareList.page b/emhttp/plugins/dynamix/ShareList.page index b97e27954..ce6d30037 100644 --- a/emhttp/plugins/dynamix/ShareList.page +++ b/emhttp/plugins/dynamix/ShareList.page @@ -16,23 +16,16 @@ Cond="_var($var,'fsState')!='Stopped' && _var($var,'shareUser')=='e'" */ ?> "._('There are no mountable array or pool disks - cannot add shares')."."; +$nodisks = ""._('There are no mounted array or pool disks - cannot add shares')."."; if (!checkDisks($disks)) die($nodisks); // No shared disks @@ -45,23 +45,18 @@ $nodisks = ""; +$nodisks = ""._('There are no mounted array or pool disks - cannot add shares')."."; if (!checkDisks($disks)) die($nodisks); // exit when no shares @@ -128,18 +128,13 @@ extract(parse_plugin_cfg('dynamix',true)); // Natural sorting of share names uksort($shares,'strnatcasecmp'); -/* Function to filter out unwanted disks, check if any valid disks exist, and ignore disks with a blank device. */ -function checkDisks($disks) { - global $pools; - +/* Function to test if any Mouned volumes exist. */ +function checkDisks(&$disks) { $rc = false; foreach ($disks as $disk) { - /* Check the disk type, fsStatus, and ensure the device is not blank. */ - if (!in_array($disk['name'], ['flash', 'parity', 'parity2']) && strpos($disk['fsStatus'], 'Unmountable') === false && !empty($disk['device'])) { - /* A valid disk with a non-blank device is found. */ + if ($disk['name']!=='flash' && _var($disk,'fsStatus',"")==='Mounted') { $rc = true; - break; } }