From 9a76f69f5db691bd06ef8ef7fc29351a92e7e1b4 Mon Sep 17 00:00:00 2001 From: dlandon Date: Wed, 8 May 2024 09:59:41 -0500 Subject: [PATCH] Display message and disable add share button if there are no mountable array disks. --- emhttp/plugins/dynamix/ShareList.page | 7 ++++++- emhttp/plugins/dynamix/include/DiskList.php | 7 +++++-- emhttp/plugins/dynamix/include/ShareList.php | 4 ++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/emhttp/plugins/dynamix/ShareList.page b/emhttp/plugins/dynamix/ShareList.page index 949d949a5..8b33a5b4a 100644 --- a/emhttp/plugins/dynamix/ShareList.page +++ b/emhttp/plugins/dynamix/ShareList.page @@ -15,6 +15,11 @@ Cond="_var($var,'fsState')!='Stopped' && _var($var,'shareUser')=='e'" * all copies or substantial portions of the Software. */ ?> + + @@ -22,7 +27,7 @@ Cond="_var($var,'fsState')!='Stopped' && _var($var,'shareUser')=='e'" - +> diff --git a/emhttp/plugins/dynamix/include/DiskList.php b/emhttp/plugins/dynamix/include/DiskList.php index c2f7e97a1..eb2b9b683 100644 --- a/emhttp/plugins/dynamix/include/DiskList.php +++ b/emhttp/plugins/dynamix/include/DiskList.php @@ -28,10 +28,13 @@ $var = parse_ini_file('state/var.ini'); $sec = parse_ini_file('state/sec.ini',true); $sec_nfs = parse_ini_file('state/sec_nfs.ini',true); -// exit when no disks -$nodisks = ""; +// exit when no mountable array disks +$nodisks = ""; if (!$disks) die($nodisks); +// No shared disks +$nodisks = ""; + // GUI settings extract(parse_plugin_cfg('dynamix',true)); diff --git a/emhttp/plugins/dynamix/include/ShareList.php b/emhttp/plugins/dynamix/include/ShareList.php index 341542dcb..577464fcb 100644 --- a/emhttp/plugins/dynamix/include/ShareList.php +++ b/emhttp/plugins/dynamix/include/ShareList.php @@ -46,6 +46,10 @@ $var = parse_ini_file('state/var.ini'); $sec = parse_ini_file('state/sec.ini',true); $sec_nfs = parse_ini_file('state/sec_nfs.ini',true); +// exit when no mountable array disks +$nodisks = ""; +if (!$disks) die($nodisks); + // exit when no shares $noshares = ""; if (!$shares) die($noshares);
_(Name)__(Comment)__(SMB)__(NFS)__(Storage)__(Size)__(Free)_
"._('There are no exportable disk shares')."
"._('There are no mountable array or pool disks - cannot add shares').".
"._('There are no exportable disk shares')."
"._('There are no mountable array or pool disks - cannot add shares').".
"._('There are no exportable user shares')."