summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-acl/htdocs/luci-static
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-acl/htdocs/luci-static')
-rw-r--r--applications/luci-app-acl/htdocs/luci-static/resources/view/system/acl.js41
1 files changed, 20 insertions, 21 deletions
diff --git a/applications/luci-app-acl/htdocs/luci-static/resources/view/system/acl.js b/applications/luci-app-acl/htdocs/luci-static/resources/view/system/acl.js
index 52ce13c766..50e6075fbb 100644
--- a/applications/luci-app-acl/htdocs/luci-static/resources/view/system/acl.js
+++ b/applications/luci-app-acl/htdocs/luci-static/resources/view/system/acl.js
@@ -73,16 +73,16 @@ var cbiACLSelect = form.Value.extend({
var readMatches = globListToRegExp(section_id, 'read'),
writeMatches = globListToRegExp(section_id, 'write');
- var table = E('div', { 'class': 'table' }, [
- E('div', { 'class': 'tr' }, [
- E('div', { 'class': 'th' }, [ _('ACL group') ]),
- E('div', { 'class': 'th' }, [ _('Description') ]),
- E('div', { 'class': 'th' }, [ _('Access level') ])
+ var table = E('table', { 'class': 'table' }, [
+ E('tr', { 'class': 'tr' }, [
+ E('th', { 'class': 'th' }, [ _('ACL group') ]),
+ E('th', { 'class': 'th' }, [ _('Description') ]),
+ E('th', { 'class': 'th' }, [ _('Access level') ])
]),
- E('div', { 'class': 'tr' }, [
- E('div', { 'class': 'td' }, [ '' ]),
- E('div', { 'class': 'td' }, [ '' ]),
- E('div', { 'class': 'td' }, [
+ E('tr', { 'class': 'tr' }, [
+ E('td', { 'class': 'td' }, [ '' ]),
+ E('td', { 'class': 'td' }, [ '' ]),
+ E('td', { 'class': 'td' }, [
_('Set all: ', 'Set all permissions in the table below to one of the given values'),
E('a', { 'href': '#', 'click': function() {
table.querySelectorAll('select').forEach(function(select) { select.value = select.options[0].value });
@@ -102,10 +102,10 @@ var cbiACLSelect = form.Value.extend({
isReadable = (readMatches[0].test(aclGroupName) && !readMatches[1].test(aclGroupName)) || null,
isWritable = (writeMatches[0].test(aclGroupName) && !writeMatches[1].test(aclGroupName)) || null;
- table.appendChild(E('div', { 'class': 'tr' }, [
- E('div', { 'class': 'td' }, [ aclGroupName ]),
- E('div', { 'class': 'td' }, [ aclList[aclGroupName].description || '-' ]),
- E('div', { 'class': 'td' }, [
+ table.appendChild(E('tr', { 'class': 'tr' }, [
+ E('td', { 'class': 'td' }, [ aclGroupName ]),
+ E('td', { 'class': 'td' }, [ aclList[aclGroupName].description || '-' ]),
+ E('td', { 'class': 'td' }, [
E('select', { 'data-acl-group': aclGroupName }, [
isRequired ? E([]) : E('option', { 'value': '' }, [ _('denied', 'No permissions granted') ]),
E('option', { 'value': 'read', 'selected': isReadable }, [ _('readonly', 'Only read permissions granted') ]),
@@ -146,6 +146,9 @@ var cbiACLSelect = form.Value.extend({
},
write: function(section_id, value) {
+ uci.unset('rpcd', section_id, 'read');
+ uci.unset('rpcd', section_id, 'write');
+
if (L.isObject(value) && Array.isArray(value.read))
uci.set('rpcd', section_id, 'read', value.read);
@@ -216,16 +219,13 @@ return view.extend({
o.modalonly = true;
o.value('shadow', _('Use UNIX password in /etc/shadow'));
o.value('crypted', _('Use encrypted password hash'));
- o.value('plain', _('Use plain password'));
o.cfgvalue = function(section_id) {
var value = uci.get('rpcd', section_id, 'password') || '';
if (value.substring(0, 3) == '$p$')
return 'shadow';
- else if (value.substring(0, 3) == '$1$' || value == null)
- return 'crypted';
else
- return 'plain';
+ return 'crypted';
};
o.write = function() {};
@@ -246,7 +246,6 @@ return view.extend({
o.password = true;
o.rmempty = false;
o.depends('_variant', 'crypted');
- o.depends('_variant', 'plain');
o.cfgvalue = function(section_id) {
var value = uci.get('rpcd', section_id, 'password') || '';
return (value.substring(0, 3) == '$p$') ? '' : value;
@@ -319,12 +318,12 @@ return view.extend({
o.write = function(section_id) {
switch (this.formvalue(section_id)) {
case 'write':
- uci.set('rpcd', section_id, 'read', '*');
- uci.set('rpcd', section_id, 'write', '*');
+ uci.set('rpcd', section_id, 'read', ['*']);
+ uci.set('rpcd', section_id, 'write', ['*']);
break;
case 'read':
- uci.set('rpcd', section_id, 'read', '*');
+ uci.set('rpcd', section_id, 'read', ['*']);
uci.unset('rpcd', section_id, 'write');
break;
}