=_var($var,'NAME')?>
-=_var($var,'COMMENT')?>
+=htmlspecialchars(_var($var,'COMMENT'))?>
@@ -216,7 +216,7 @@ switch ($theme) {
-
=_var($var,'SYS_MODEL')?:'---'?>
+
=htmlspecialchars(_var($var,'SYS_MODEL'))?:'---'?>
Unraid OS
=_var($var,'regTy')?>
@@ -464,10 +464,10 @@ if (_var($var,'shareSMBEnabled')=='yes') {
$list = "$name ";
if ($share['luksStatus']>0) $list = str_replace('blue-text','green-text',$list);
elseif ($share['useCache']=='only') $list = str_replace('blue-text','orange-text',$list);
- $comment = $share['comment'] ?: ' ';
+ $comment = $share['comment'] ?: '-';
$security = export_settings(_var($var,'shareSMBEnabled'), $sec[$name]);
$last = $name==array_key_last($shares) ? ' last' : '';
- echo " $list$comment $security 0 ";
+ echo " $list".htmlspecialchars($comment)." $security 0 ";
}
if (!count($shares)) echo ""._("No shares present")." ";
}
@@ -476,10 +476,10 @@ if (_var($var,'shareNFSEnabled')=='yes') {
$list = "$name ";
if ($share['luksStatus']>0) $list = str_replace('blue-text','green-text',$list);
elseif ($share['useCache']=='only') $list = str_replace('blue-text','orange-text',$list);
- $comment = $share['comment'] ?: ' ';
+ $comment = $share['comment'] ?: '-';
$security = export_settings(_var($var,'shareNFSEnabled'), $sec_nfs[$name]);
$last = $name==array_key_last($shares) ? ' last' : '';
- echo " $list$comment $security - ";
+ echo " $list".htmlspecialchars($comment)." $security - ";
}
if (!count($shares)) echo ""._("No shares present")." ";
}
@@ -488,8 +488,8 @@ if (!$group) {
$list = "$name ";
if ($share['luksStatus']>0) $list = str_replace('blue-text','green-text',$list);
elseif ($share['useCache']=='only') $list = str_replace('blue-text','orange-text',$list);
- $comment = $share['comment'] ?: ' ';
- echo " $list$comment - - ";
+ $comment = $share['comment'] ?: '-';
+ echo " $list".htmlspecialchars($comment)." - - ";
}
if (!count($shares)) echo ""._("No shares present")." ";
}
@@ -519,7 +519,7 @@ if (_var($var,'shareSMBEnabled')=='yes') {
foreach ($users as $user) {
$name = $user['name'];
$list = "$name ";
- $desc = $user['desc'] ?: ' ';
+ $desc = $user['desc'] ?: '-';
if ($name=='root') {
$write = $read = '-';
} else {
@@ -544,27 +544,27 @@ if (_var($var,'shareSMBEnabled')=='yes') {
}
if ($user['passwd']!='yes') $list = str_replace('blue-text','orange-text',$list);
$last = $name==array_key_last($users) ? ' last' : '';
- echo " $list$desc $write $read ";
+ echo " $list".htmlspecialchars($desc)." $write $read ";
}
}
if (_var($var,'shareNFSEnabled')=='yes') {
foreach ($users as $user) {
$name = $user['name'];
$list = "$name ";
- $desc = $user['desc'] ?: ' ';
+ $desc = $user['desc'] ?: '-';
$write = '-'; $read = '-';
if ($user['passwd']!='yes') $list = str_replace('blue-text','orange-text',$list);
$last = $name==array_key_last($users) ? ' last' : '';
- echo " $list$desc $write $read ";
+ echo " $list".htmlspecialchars($desc)." $write $read ";
}
}
if (!$group) {
foreach ($users as $user) {
$name = $user['name'];
$list = "$name ";
- $desc = $user['desc'] ?: ' ';
+ $desc = $user['desc'] ?: '-';
if ($user['passwd']!='yes') $list = str_replace('blue-text','orange-text',$list);
- echo " $list$desc - - ";
+ echo " $list".htmlspecialchars($desc)." - - ";
}
}
?>
diff --git a/emhttp/plugins/dynamix/DeviceAttributes.page b/emhttp/plugins/dynamix/DeviceAttributes.page
index e66d84764..02e3b2bd1 100644
--- a/emhttp/plugins/dynamix/DeviceAttributes.page
+++ b/emhttp/plugins/dynamix/DeviceAttributes.page
@@ -1,7 +1,7 @@
Menu="Device New"
Title="Attributes"
Tag="address-card-o"
-Cond="strpos(_var($disks[$name],'status'),'_NP')===false"
+Cond="array_key_exists($name, $disks) || array_key_exists($name, $devs)"
---
_(Existing content is permanently lost)_
",
html:true,
type:'input',
- inputPlaceholder:"=sprintf(_('To confirm type: %s'),$name)?>",
+ inputPlaceholder:"=sprintf(_('To confirm type: %s'),htmlspecialchars($name))?>",
showCancelButton:true,
closeOnConfirm:false,
confirmButtonText:"_(Proceed)_",
@@ -641,7 +642,7 @@ function eraseDisk(name) {
$('#eraseButton').prop('disabled',true);
$('#removeButton').prop('disabled',true);
$('div.spinner.fixed').show();
- $.post("/update.htm",{cmdWipefs:name},function(){
+ $.post("/update.htm",{cmdWipefs:"=$name?>"},function(){
$('div.spinner.fixed').hide();
refresh();
});
@@ -650,13 +651,13 @@ function eraseDisk(name) {
}
});
}
-function removePool(name) {
+function removePool() {
swal({
title:"_(Remove pool)_?",
text:"=$textDelete?>",
html:true,
type:'input',
- inputPlaceholder:"=sprintf(_('To confirm type: %s'),$name)?>",
+ inputPlaceholder:"=sprintf(_('To confirm type: %s'),htmlspecialchars($name))?>",
showCancelButton:true,
closeOnConfirm:false,
confirmButtonText:"_(Proceed)_",
@@ -669,22 +670,22 @@ function removePool(name) {
$('#eraseButton').prop('disabled',true);
$('#removeButton').prop('disabled',true);
$('div.spinner.fixed').show();
- $.post("/update.htm",{changeSlots:"apply",poolName:name,poolSlots:0},function(){
+ $.post("/update.htm",{changeSlots:"apply",poolName:"=$name?>",poolSlots:0},function(){
$('div.spinner.fixed').hide();
- refresh();
+ done();
});
} else {
if (confirm.length) swal({title:"_(Incorrect confirmation)_",text:"_(Please try again)_!",type:'error',html:true,confirmButtonText:"_(Ok)_"});
}
});
}
-function upgradeZpool(name) {
+function upgradeZpool() {
swal({
title:"_(Upgrade ZFS Pool)_?",
text:"_(This operation cannot be reversed)_. _(After upgrading the volume may not be mountable in previous versions of Unraid)_._(The ZFS volume will be upgraded)_
",
html:true,
type:'input',
- inputPlaceholder:"=sprintf(_('To confirm type: %s'),$name)?>",
+ inputPlaceholder:"=sprintf(_('To confirm type: %s'),htmlspecialchars($name))?>",
showCancelButton:true,
closeOnConfirm:false,
confirmButtonText:"_(Proceed)_",
@@ -697,7 +698,7 @@ function upgradeZpool(name) {
$('#eraseButton').prop('disabled',true);
$('#deleteButton').prop('disabled',true);
$('div.spinner.fixed').show();
- $.post("/webGui/include/zfs_upgrade.php",{name:name},function(){
+ $.post("/webGui/include/zfs_upgrade.php",{name:"=$name?>"},function(){
$('div.spinner.fixed').hide();
refresh();
});
@@ -711,11 +712,11 @@ function upgradeZpool(name) {
@@ -1143,7 +1144,7 @@ _(zfs pool status)_:
:
-
+
:info_zfs_scrub_help:
@@ -1458,7 +1459,7 @@ _(SMART attribute notifications)_:
_(Caution)_: _(Renaming the pool will change the share storage allocations)_. _(After renaming the pool, check that your shares are assigned to the proper primary and secondary storage locations)_.
_(Name)_:
-:
+:
diff --git a/emhttp/plugins/dynamix/DiskSettings.page b/emhttp/plugins/dynamix/DiskSettings.page
index 8c6ad60d3..a5cb7cdf8 100644
--- a/emhttp/plugins/dynamix/DiskSettings.page
+++ b/emhttp/plugins/dynamix/DiskSettings.page
@@ -169,12 +169,12 @@ _(Default file system for Array disks)_:
:disk_default_file_system_help:
_(Shutdown time-out)_ (_(seconds)_):
-:
+:
:disk_shutdown_timeout_help:
_(Tunable (poll_attributes))_:
-:
+:
:disk_tunable_poll_attributes_help:
@@ -187,7 +187,7 @@ _(Tunable (enable NCQ))_:
:disk_tunable_enable_ncq_help:
_(Tunable (nr_requests))_:
-:
+:
:disk_tunable_nr_requests_help:
@@ -203,17 +203,17 @@ _(Tunable (scheduler))_:
:disk_tunable_scheduler_help:
_(Tunable (md_num_stripes))_:
-:
+:
:disk_tunable_md_num_stripes_help:
_(Tunable (md_queue_limit))_:
-:
+:
:disk_tunable_md_queue_limit_help:
_(Tunable (md_sync_limit))_:
-:
+:
:disk_tunable_md_sync_limit_help:
@@ -376,7 +376,7 @@ _(Default SMART controller type)_:
:disk_default_smart_controller_help:
_(Default SMART attribute notifications)_:
-: _(Custom attributes (use comma to separate numbers))_
+: _(Custom attributes (use comma to separate numbers))_
diff --git a/emhttp/plugins/dynamix/NFS.page b/emhttp/plugins/dynamix/NFS.page
index a2d25ecb9..dd7ef6a23 100644
--- a/emhttp/plugins/dynamix/NFS.page
+++ b/emhttp/plugins/dynamix/NFS.page
@@ -41,7 +41,7 @@ _(Enable NFS)_:
:nfs_enable_help:
_(Tunable (fuse_remember))_:
-: =htmlspecialchars($var['fuse_remember_status']);?>
+: =_($var['fuse_remember_status'])?>
:nfs_tunable_fuse_remember_help:
diff --git a/emhttp/plugins/dynamix/NetworkExtra.page b/emhttp/plugins/dynamix/NetworkExtra.page
index b821b0350..82f928436 100644
--- a/emhttp/plugins/dynamix/NetworkExtra.page
+++ b/emhttp/plugins/dynamix/NetworkExtra.page
@@ -93,12 +93,12 @@ _(Current listening interfaces)_:
_(Include listening interfaces)_:
-:
+:
:eth_network_extra_include_help:
_(Exclude listening interfaces)_:
-:
+:
:eth_network_extra_exclude_help:
diff --git a/emhttp/plugins/dynamix/Selftest.page b/emhttp/plugins/dynamix/Selftest.page
index bd6e212a8..63f2981aa 100644
--- a/emhttp/plugins/dynamix/Selftest.page
+++ b/emhttp/plugins/dynamix/Selftest.page
@@ -1,7 +1,7 @@
Menu="Device:2 New:2"
Title="Self-Test"
Tag="wrench"
-Cond="strpos(_var($disks[$name],'status'),'_NP')===false"
+Cond="array_key_exists($name, $disks) || array_key_exists($name, $devs)"
---
"",
"name" => "",
"comment" => "",
diff --git a/emhttp/plugins/dynamix/SysDevs.page b/emhttp/plugins/dynamix/SysDevs.page
index 7101f00ca..dce5eb649 100644
--- a/emhttp/plugins/dynamix/SysDevs.page
+++ b/emhttp/plugins/dynamix/SysDevs.page
@@ -34,7 +34,7 @@ function applyCfg() {
if (string === "BIND=") {
string = "";
}
- $.get( "/plugins/dynamix/include/update.vfio-pci-cfg.php", { cfg: string } )
+ $.post( "/plugins/dynamix/include/update.vfio-pci-cfg.php", { cfg: string } )
.done(function(d) {
if (d==1) {
addRebootNotice(message);
diff --git a/emhttp/plugins/dynamix/Syslinux.page b/emhttp/plugins/dynamix/Syslinux.page
index 15acdbf09..94d4f40ed 100644
--- a/emhttp/plugins/dynamix/Syslinux.page
+++ b/emhttp/plugins/dynamix/Syslinux.page
@@ -194,15 +194,15 @@ _(Syslinux configuration)_:
$label = ($i) ? array_shift($area):$title;
$start = in_array($menu,$area);
if ($start) unset($area[array_search($menu,$area)]);
-?>=$label?>
+?>=htmlspecialchars($label)?>
title="_(Set default boot menu)_" onchange="changeMenu(this.form,this.id,true)">
-
+
_(Syslinux configuration)_:
-:
+:
_(Server boot mode)_:
diff --git a/emhttp/plugins/dynamix/SyslogSettings.page b/emhttp/plugins/dynamix/SyslogSettings.page
index 9029986d1..0914c7088 100644
--- a/emhttp/plugins/dynamix/SyslogSettings.page
+++ b/emhttp/plugins/dynamix/SyslogSettings.page
@@ -95,7 +95,7 @@ _(Local syslog server)_:
=mk_option(_var($syslog,'server_protocol'), "tcp", _("TCP"))?>
=mk_option(_var($syslog,'server_protocol'), "both", _("Both"))?>
-
+
:syslog_local_server_help:
@@ -155,7 +155,7 @@ _(Local syslog number of files)_:
_(Remote syslog server)_:
-:
+:
=mk_option(_var($syslog,'remote_protocol'), "udp", _("UDP"))?>
=mk_option(_var($syslog,'remote_protocol'), "tcp", _("TCP"))?>
diff --git a/emhttp/plugins/dynamix/UserEdit.page b/emhttp/plugins/dynamix/UserEdit.page
index 6cdfe1370..b9d846184 100644
--- a/emhttp/plugins/dynamix/UserEdit.page
+++ b/emhttp/plugins/dynamix/UserEdit.page
@@ -14,12 +14,11 @@ Tag="user"
* all copies or substantial portions of the Software.
*/
?>
-
- =sprintf(_('User %s has been deleted'),htmlspecialchars($name))?>.
-
-
-
+if (!array_key_exists($name, $users)) {
+ echo "";
+ return;
+}
$user = "/boot/config/plugins/dynamix/users/$name.png";
$void = " ";
$icon = " ";
diff --git a/emhttp/plugins/dynamix/UserList.page b/emhttp/plugins/dynamix/UserList.page
index c81cfdc46..963e6ee6a 100644
--- a/emhttp/plugins/dynamix/UserList.page
+++ b/emhttp/plugins/dynamix/UserList.page
@@ -15,19 +15,17 @@ Tag="users"
*/
?>
-$submenu = !empty($display['users']) && substr($display['users'],0,5)!='Tasks';
-if ($submenu) $path = './Users';
ksort($users);
?>
_(Management Access)_
$img = "/boot/config/plugins/dynamix/users/root.png"?>
-
+
_(Shares Access)_
$img = "/boot/config/plugins/dynamix/users/{$user['name']}.png"?>
-
+
@@ -35,6 +33,6 @@ _(No users are defined)_. _(Click **Add User** to create a user for remote share
-
diff --git a/emhttp/plugins/dynamix/include/.login.php b/emhttp/plugins/dynamix/include/.login.php
index 6f0805707..73b6b554b 100644
--- a/emhttp/plugins/dynamix/include/.login.php
+++ b/emhttp/plugins/dynamix/include/.login.php
@@ -480,10 +480,10 @@ $theme_dark = in_array($display['theme'], ['black', 'gray']);
- =$var['NAME']?>
+ =htmlspecialchars($var['NAME'])?>
- =$var['COMMENT']?>
+ =htmlspecialchars($var['COMMENT'])?>
diff --git a/emhttp/plugins/dynamix/include/.set-password.php b/emhttp/plugins/dynamix/include/.set-password.php
index 2717eb0f6..091f31be3 100644
--- a/emhttp/plugins/dynamix/include/.set-password.php
+++ b/emhttp/plugins/dynamix/include/.set-password.php
@@ -306,8 +306,8 @@ $THEME_DARK = in_array($display['theme'],['black','gray']);
- =$var['NAME']?>
- =$var['COMMENT']?>
+ =htmlspecialchars($var['NAME'])?>
+ =htmlspecialchars($var['COMMENT'])?>
=_('Please set a password for the root user account')?>.
=_('Max password length is 128 characters')?>.
diff --git a/emhttp/plugins/dynamix/include/DefaultPageLayout.php b/emhttp/plugins/dynamix/include/DefaultPageLayout.php
index 1c3de385d..6cb750a5c 100644
--- a/emhttp/plugins/dynamix/include/DefaultPageLayout.php
+++ b/emhttp/plugins/dynamix/include/DefaultPageLayout.php
@@ -720,7 +720,7 @@ if (isset($myPage['Load']) && $myPage['Load']>0) echo "\n
+