From fa4ee5bd4d909dd54c86de3c0608036697747ac6 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 1 Oct 2013 16:21:42 +0000 Subject: [PATCH] luci2: fix CBI crash when deleting last remaining uci section in login management view --- luci2/htdocs/luci2/view/system.users.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/luci2/htdocs/luci2/view/system.users.js b/luci2/htdocs/luci2/view/system.users.js index ed53ab5..ebf3751 100644 --- a/luci2/htdocs/luci2/view/system.users.js +++ b/luci2/htdocs/luci2/view/system.users.js @@ -223,7 +223,6 @@ L.ui.view.extend({ var m = new L.cbi.Map('rpcd', { caption: L.tr('Guest Logins'), description: L.tr('Manage user accounts and permissions for accessing the LuCI ui.'), - collabsible: true, readonly: !self.options.acls.users }); @@ -232,6 +231,7 @@ L.ui.view.extend({ var u = sid ? this.fields.username.textvalue(sid) : undefined; return u ? L.tr('Login "%s"').format(u) : L.tr('New login'); }, + collabsible: true, addremove: true, add_caption: L.tr('Add new user …'), teasers: [ '__shadow', '__acls' ] @@ -278,6 +278,9 @@ L.ui.view.extend({ var sh = this.section.fields.__shadow.formvalue(sid); var pw = this.section.fields.password.formvalue(sid); + if (!sh && !pw) + return; + if (sh) pw = '$p$' + this.section.fields.username.formvalue(sid); -- 2.11.0