openwrt / luci

LuCI - OpenWrt Configuration Interface
Apache License 2.0
6.14k stars 2.48k forks source link

Discussion on Luci multi-user features #623

Closed hnyman closed 4 years ago

hnyman commented 8 years ago

@Hostle has created a functional system for enabling handling multiple users in Luci.

@Hostle has actually created two alternative methods for a year-old Luci (from March 2015, CC15.05 development cycle) into his Github repo. I have imported the changes into up-to-date DD trunk and have also squashed and polished the commits for discussion purposes to have minimal diffs.

Hostle thinks that the newer method is better, so I will present that here.

Original discussion at forum: https://forum.openwrt.org/viewtopic.php?id=54593 Discussion also at: https://github.com/Hostle/luci/commit/c1ba7d780fbafba1d882e3d05ff96baeaee131f3#commitcomment-15451559

"New method":

"New" original, commits from Hostle, updated in April 2017: https://github.com/Fire-WRT/luci/commits/multi4

"New" cleaned-up version from my repo, "multi4-clean" branch, contains four squashed commits targeting LEDE & Openwrt DD trunk/master: https://github.com/hnyman/luci/commits/multi4-clean (March2018: I have rebased multi4 branch history with the LuCI of June 2017.)

Trying the code:

If you want to try the multi-user code, you can easily add my Luci repo as a remote to your own git and then pull from "multi4-clean" branch. The multi4-clean branch contains up-to-date LuCI of 26 June 2017.

I used these commands to import this to my own Openwrt build. (I also created a new branch "multiuser" at my local feed repo so that I easily push the changes aside by "git checkout master"):

 cd feeds/luci
 git checkout 6047dacb6253c
 git checkout -b multiuser
 git remote add hnyman https://github.com/hnyman/luci.git
 git pull hnyman multi4-clean
 git log --oneline

Alternatively, you can download the 4 commits as patches from github and apply them manually. (just add .patch to the end of the commit's page address and you get a patch that can be download with wget.)

Identified problems/challenges:

NOTE: old, reflects 2015 observations

Screenshot from trunk Designated Driver r48235: multiuser1

RJRvdMeer commented 7 years ago

Update by software in router menu is working. System->software. Thx :)

Is there a way to get the option in menuconfig? Love to learn this.

Op 28 sep. 2016 om 15:52 heeft Hannu Nyman notifications@github.com het volgende geschreven:

You need to install the material theme separately.

ah ok. any tips on that? j

If trunk are running trunk just do

opkg update opkg install luci-theme-material Or do the same actions in Luci (System -> Software).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

RJRvdMeer commented 7 years ago

@hnyman

Is there a way to get luci-theme-material in menuconfig? 'Cause it isn't there after update and install, using src-git luci https://github.com/Hostle/openwrt-luci-multi-user.git in feeds.conf.default

hnyman commented 7 years ago

Is there a way to get luci-theme-material in menuconfig? 'Cause it isn't there after update and install, using src-git luci https://github.com/Hostle/openwrt-luci-multi-user.git in feeds.conf.default

Well, whole that repo is very old LuCI code that has not been updated since Oct 2015. That repo does not even contain the current Luci (for DD trunk), so there is no Material theme.

Hostle worked actively with multi-user in Jan-Feb 2016 using https://github.com/Hostle/luci , which commits I have imported into my own repo (see the first post), fixed the uci-defaults error (still there in Hostle's repo) and rebased every now and then to the top of the current Luci repo. I have not tested that code in 6 months, but that might still be your best bet if you are using Openwrt DD trunk (or LEDE).

src-git luci https://github.com/hnyman/luci.git;multi3

That is current LuCI DD trunk / LEDE plus the multi-user components for DD trunk from hostle as of Feb 2016.

The developments during this summer for 15.05.1 (discussed between Hostle and tcpipchip) are probably in https://github.com/Fire-Wrt-2016/luci/tree/luci-multi-user-15.05.1 , but I haven't checked the exact nature of the changes.

Luci for DD trunk & LEDE has some differences compared to Luci for CC15.05, so the CC code might not run on DD and vice versa.

Hostle commented 7 years ago
                                                                                  I will look at updating the current trunk with the new commits made to the CC code for the services menus.                                                                                                                                                                                                                                                                                                                                         Sent from my BlackBerry 10 smartphone on the Rogers network.                                                                                                                                                                                                                From: Hannu NymanSent: Tuesday, October 4, 2016 10:22 AMTo: openwrt/luciReply To: openwrt/luciCc: Hostle; MentionSubject: Re: [openwrt/luci] Discussion on Luci multi-user features (#623)

Is there a way to get luci-theme-material in menuconfig? 'Cause it isn't there after update and install, using src-git luci https://github.com/Hostle/openwrt-luci-multi-user.git in feeds.conf.default

Well, whole that repo is very old LuCI code that has not been updated since Oct 2015. That repo does not even contain the current Luci (for DD trunk), so there is no Material theme.

Hostle worked actively with multi-user in Jan-Feb 2016 using https://github.com/Hostle/luci , which commits I have imported into my own repo (see the first post), fixed the uci-defaults error (still there in Hostle's repo) and rebased every now and then to the top of the current Luci repo. I have not tested that code in 6 months, but that might still be your best bet if you are using Openwrt DD trunk (or LEDE).

src-git luci https://github.com/hnyman/luci.git;multi3

That is current LuCI DD trunk / LEDE plus the multi-user components for DD trunk from hostle as of Feb 2016.

The developments during this summer for 15.05.1 (discussed between Hostle and tcpipchip) are probably in https://github.com/Fire-Wrt-2016/luci/tree/luci-multi-user-15.05.1 , but I haven't checked the exact nature of the changes.

Luci for DD trunk & LEDE has some differences compared to Luci for CC15.05, so the CC code might not run on DD and vice versa.

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openwrt/luci","title":"openwrt/luci","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/openwrt/luci"}},"updates":{"snippets":[{"icon":"PERSON","message":"@hnyman in #623: \u003e Is there a way to get luci-theme-material in menuconfig? 'Cause it isn't there after update and install, using src-git luci https://github.com/Hostle/openwrt-luci-multi-user.git in feeds.conf.default \r\n\r\nWell, whole that repo is very old LuCI code that has not been updated since Oct 2015. That repo does not even contain the current Luci (for DD trunk), so there is no Material theme. \r\n\r\nHostle worked actively with multi-user in Jan-Feb 2016 using https://github.com/Hostle/luci , which commits I have imported into my own repo (see the first post), fixed the uci-defaults error (still there in Hostle's repo) and rebased every now and then to the top of the current Luci repo. I have not tested that code in 6 months, but that might still be your best bet if you are using Openwrt DD trunk (or LEDE).\r\n\r\nsrc-git luci https://github.com/hnyman/luci.git;multi3\r\n\r\nThat is current LuCI DD trunk / LEDE plus the multi-user components for DD trunk from hostle as of Feb 2016.\r\n\r\nThe developments during this summer for 15.05.1 (discussed between Hostle and tcpipchip) are probably in https://github.com/Fire-Wrt-2016/luci/tree/luci-multi-user-15.05.1 , but I haven't checked the exact nature of the changes.\r\n\r\nLuci for DD trunk \u0026 LEDE has some differences compared to Luci for CC15.05, so the CC code might not run on DD and vice versa.\r\n"}],"action":{"name":"View Issue","url":"https://github.com/openwrt/luci/issues/623#issuecomment-251400463"}}}

tcpipchip commented 7 years ago

It´s working very very nice on CHAOS!

RJRvdMeer commented 7 years ago

@hnyman, @Hostle : Thx I'm too new to this project to find a good starting point so I go for LEDE reboot. Maybe yours (@hnyman) is better for me to start with? Anyway, if I can assist in any way ( @Hostle ) let me know.

gianlucads commented 7 years ago

Hi I added and use very well luci multi user.... now I want create backup of all file for restore configuration (user , pass and page enabled ) to another device, which file need to save?

/etc/passwd and after?

ths for support Gianluca

tcpipchip commented 7 years ago

do you want to back all your linkit flash and restore into other linkit devices ?


De: gianlucadisimone notifications@github.com Enviado: quarta-feira, 23 de novembro de 2016 19:56 Para: openwrt/luci Cc: tcpipchip; Comment Assunto: Re: [openwrt/luci] Discussion on Luci multi-user features (#623)

Hi I added and use very well luci multi user.... now I want create backup of all file for restore configuration (user , pass and page enabled ) to another device, which file need to save?

/etc/passwd and after?

ths for support Gianluca

You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/openwrt/luci/issues/623#issuecomment-262615921, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AK9MzILwduQ0ze1jcKvXvrfWNhbUDFwfks5rBJpzgaJpZM4HFCc0.

gianlucads commented 7 years ago

I want create backup ( backup configuration into openwrt) and after restore to device all file that use multi user package.

tcpipchip commented 7 years ago

i did that for gang production.

Please, send a e-mail to tcpipchip@hotmail.com and i will send you the 2 scripts. To backup and restore the FLASH!

Miguel


De: gianlucadisimone notifications@github.com Enviado: quarta-feira, 23 de novembro de 2016 20:55 Para: openwrt/luci Cc: tcpipchip; Comment Assunto: Re: [openwrt/luci] Discussion on Luci multi-user features (#623)

I want create backup ( backup configuration into openwrt) and after restore to device all file that use multi user package.

You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/openwrt/luci/issues/623#issuecomment-262627835, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AK9MzMUMUtz7EbXMu0OPGsrRIyiWACM7ks5rBKhHgaJpZM4HFCc0.

jack338c commented 7 years ago

@Hostle Hello Mr Hostle I'm using your luci --src-git luci https://github.com/hnyman/luci.git;multi3 both on lede and openwrt but foudn some issue: 1 system--Mount Point (can not show this items ) 2.Services--all items(can not show) Hope you can fix these when you have free time thanks for your everthing !

Jack

Hostle commented 7 years ago
                                                                                  That's not my repo, that's Hnyman's repo. What branch of openwrt are you using?                                                                                                                                                                                                                                                                                                                                         Sent from my BlackBerry 10 smartphone on the Rogers network.                                                                                                                                                                                                                From: jack338cSent: Saturday, November 26, 2016 12:36 AMTo: openwrt/luciReply To: openwrt/luciCc: Hostle; MentionSubject: Re: [openwrt/luci] Discussion on Luci multi-user features (#623)@Hostle

Hello Mr Hostle I'm using your luci --src-git luci https://github.com/hnyman/luci.git;multi3 but foudn some issue: 1 system--Mount Point (can not show this items ) 2.Services--all items(can not show) Hope you can fix these when you have free time thanks for your everthing ! Jack

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openwrt/luci","title":"openwrt/luci","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/openwrt/luci"}},"updates":{"snippets":[{"icon":"PERSON","message":"@jack338c in #623: @Hostle \r\nHello Mr Hostle\r\nI'm using your luci --src-git luci https://github.com/hnyman/luci.git;multi3\r\nbut foudn some issue: 1 system--Mount Point (can not show this items ) 2.Services--all items(can not show)\r\nHope you can fix these when you have free time\r\nthanks for your everthing !\r\n\r\nJack"}],"action":{"name":"View Issue","url":"https://github.com/openwrt/luci/issues/623#issuecomment-263045498"}}}

jack338c commented 7 years ago

@Hostle Hi,Hostel ! I'm sorry, I mixed up you with Mr hnyman Actually,I always use your repo :src-git luci https://github.com/Fire-Wrt-2016/luci;luci-multi-user-15.05.1 until asking your above question It's almost perfect,except it can not show "Unmount" button while accessing to "mount Point" ,and it's a little complex while setting up in "Repeater"model,but the lede or the newest openwrt are very simple I'm not sure,whether only me meet these issue or not thanks for your attention and Help ! Jack

hnyman commented 7 years ago

I think that your issues are not related for the multi-user feature by itself, but just reflect that Hostle's repo is based on the stable for-1505 branch, to which no new features are generally added

Luci master (in LEDE and newest Openwrt) has more fixes than the old for-15.05 branch. Thatswhy I copied (and cleaned) in Feb 2016 Hostle's commits to my multi3 branch, which is based on the LuCI master. That multi3 branch reflects the current Luci + the multi-user changes in Feb2016. But I have not updated the branch with possible new developments from Hostle since Feb2016.

jack338c commented 7 years ago

@hnyman I think that your issues are not related for the multi-user feature by itself, but just reflect that Hostle's repo is based on the stable for-1505 branch, to which no new features are generally added (yes, I did use LEDE or newest Openwrt with Hostle's repo before)

Now I understood why your repo did not fit for my requires

thank you hnyman !

gianlucads commented 7 years ago

Hi I installed multi user 4 day ago and work very well on 15.05

Gianluca

Il 27/Nov/2016 11:43, "jack338c" notifications@github.com ha scritto:

@hnyman https://github.com/hnyman I think that your issues are not related for the multi-user feature by itself, but just reflect that Hostle's repo is based on the stable for-1505 branch, to which no new features are generally added (yes, I did use LEDE or newest Openwrt with Hostle's repo before)

Now I understood why your repo did not fit for my requires

thank you hnyman !

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/openwrt/luci/issues/623#issuecomment-263114960, or mute the thread https://github.com/notifications/unsubscribe-auth/AV81y6sSB87QX8Uz76_B0JzrbMJYu7zdks5rCV7qgaJpZM4HFCc0 .

mirjafarabedi commented 7 years ago

Hi , i read some comments on this discussion, but i can't install multi user on my luci, any one can help me ? Thanks in advance

mirjafarabedi commented 7 years ago

Is it possible to make my own openWrt image multi user, without building a new image ? or if i want multi user option i should build a new image of openwrt ?

hnyman commented 7 years ago

If you want multiuser LuCI, you need to compile your own LuCI package, either part of Openwrt image, or you can just install the luci*.ipk packages to a running router with opkg after compilation. But you need to compile LuCI (and thus also Openwrt) first.

jack338c commented 7 years ago

@hnyman Dear hnyman,,if you have time,Will you make the menu"severice" hideble in lede or OpenWrt DD later ? this function is arractive,and I can hardly wait to hear the good news from you ! thank you for your hard work !

hnyman commented 7 years ago

I have not been developing this. I just cleaned up hostle's commits a bit (squashed with git rebase) to clarify the history, and imported them to my repo as a branch.

jack338c commented 7 years ago

hi hnyman How are you? any news for multi3

Hope everything is ok to you and thanks for your great job

hnyman commented 7 years ago

any news for multi3

Well, I just refreshed it to the top of the current LuCI master and pushed, so it should now be updated to the current Luci. But I have not tested it. There has not been such commits for ages that would have broken this multiuser stuff, so I guess that it should work ok.

jack338c commented 7 years ago

I will complie to my router tonight and test it ! it's an exciting new to me,thank you hnyman .you are great !

stephengroat commented 7 years ago

has there been any thought on porting this to lede project?

On Tue, Mar 28, 2017 at 7:03 AM jack338c notifications@github.com wrote:

I will complie to my router tonight and test it ! it's an exciting new to me,thank you hnyman .you are great !

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openwrt/luci/issues/623#issuecomment-289779996, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGv4owgPXnVKo0Ebqn4lAwkLi5YWJrnks5rqRNBgaJpZM4HFCc0 .

hnyman commented 7 years ago

has there been any thought on porting this to lede project?

LuCI is common to both Openwrt and LEDE. No porting is needed. But this is still more or less in experimental stage.

jack338c commented 7 years ago

@hnyman Hi hnyman ,I'm testing multi3 on LEDE Reboot 17.01-SNAPSHOT r3291-910a943,it looks everything is fine.but it's a little pity to me that there is no 'enable services menu" yet.hope it will come soon

RJRvdMeer commented 7 years ago

@hnyman Hi Hannu, I'm running multi3 on LEDE-v1701 and it's just what I need. Thx!

What I like to do now is to copy my created users into my source tree. So I copy /etc/config/users /etc/shadow,passwd,group and /home to my source/target/linux/ar71xx/base-files. After compiling and loading the new bin to the router, the users are there, but the settings per user aren't. What do I miss, what am I doing wrong?

Please some advise, BR, Robert

hnyman commented 7 years ago

hmm. first guess is that base-files Makefile has no logic to copy & install the multi-user specific /etc/config/users file (that contains the menu settings).

I think that easier approach would be to install the files as "custom files", i.e. place them in new files/etc directory. https://lede-project.org/docs/guide-developer/use-buildsystem#custom_files

RJRvdMeer commented 7 years ago

I tried your suggestion but no luck. So I copied the users to myusers and placed it also in source/files/etc/config After compile I updated the router with new bin. Logging in on console after boot I have an almost empty users (only config user 'new') and a complete myusers. If I now remove users and rename myusers to users, everything is OK.

Question : does luci create new users file after first boot? And if so, can I skip it?

Hostle commented 7 years ago

There is a UCI default script that creates the /etc/config/users file. You can remove this script but your users file must contain the user 'new' entry.

hnyman commented 7 years ago

Question : does luci create new users file after first boot? And if so, can I skip it?

I haven't used the multi-user stuff for a year, so this is just based on 1-minute source looking: looks like the multi-user modules overwrites the user file (with just the user new): https://github.com/hnyman/luci/blob/multi3/applications/luci-app-multi-user/root/etc/uci-defaults/09_users

Like hostle suggested a few seconds ago (while I was writing this), you might delete that from your build. Or you might change the ">" to ">>" to append into the file instead of overwriting it. (not sure how the code would react to double "new" user there.

Hostle commented 7 years ago

I will update the uci script to check for the file and then check for the new entry.

RJRvdMeer commented 7 years ago

FYI : Deleting 09_users does the trick for me, of course Changing ">" to ">>" gives me two "new" user entries and it seems the software doesn't care about it. I can still remove, add and change users

Fire-WRT commented 7 years ago

I have created a new repo, https://github.com/Fire-WRT/luci I added a new branch named multi 4 which contains the new code to enable menu administration for any package ...including services. I also ported these changes to the for 15-05 mullti4 branch. I have tested the 15.05 branch but have not had a chance to test the new multi4 yet ...

jack338c commented 7 years ago

Wow, awesome Thank you so much !

On Apr 1, 2017 12:24 AM, "Fire-WRT" notifications@github.com wrote:

I have created a new repo, https://github.com/Fire-WRT/luci I added a new branch named multi 4 which contains the new code to enable menu administration for any package ...including services. I also ported these changes to the for 15-05 mullti4 branch. I have tested the 15.05 branch but have not had a chance to test the new multi4 yet ...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openwrt/luci/issues/623#issuecomment-290760356, or mute the thread https://github.com/notifications/unsubscribe-auth/AKSHek2_XJRJM7KNDqYFf64H0Iania_rks5rrSisgaJpZM4HFCc0 .

jack338c commented 7 years ago

@Fire-WRT is that only fit for 15.05,not for lede ?I did not test successfully on lede

/usr/lib/lua/luci/ccache.lua:70: error loading module 'luci.controller.admin.status' from file '/usr/lib/lua/luci/controller/admin/status.lua': /usr/lib/lua/luci/controller/admin/status.lua:9: '(' expected near 'entry' stack traceback: [C]: in function 'loader' /usr/lib/lua/luci/ccache.lua:70: in function </usr/lib/lua/luci/ccache.lua:61> [C]: in function 'require' /usr/lib/lua/luci/dispatcher.lua:517: in function 'createindex' /usr/lib/lua/luci/dispatcher.lua:544: in function 'createtree' /usr/lib/lua/luci/dispatcher.lua:220: in function 'dispatch' /usr/lib/lua/luci/dispatcher.lua:141: in function </usr/lib/lua/luci/dispatcher.lua:140>

hnyman commented 7 years ago

I have not tested the updated code in multi4 myself. At the first glance there may be some errors at least in /usr/lib/lua/luci/controller/admin/status.lua : The index function declaration on line 7 from commit https://github.com/Fire-WRT/luci/commit/fa3d1836b3711c58cd84e59fc2b903a1987ec0ee is missing the parameter declaration "()" at the end of the line. That likely causes the error .../status.lua:9: '(' expected near 'entry'

is that only fit for 15.05,not for lede ?I did not test successfully on lede

No, the multi4 branch if firewrt repo seems to be pretty much up-to-date Luci master, which should work on LEDE master (and 17.01) and Openwrt DD trunk/master. I https://github.com/Fire-WRT/luci/commits/multi4

EDIT: status.lua has been likely fixed with: https://github.com/Fire-WRT/luci/commit/1142fba3f731e3bcc5760dcf01d39c79a185a1fd

jack338c commented 7 years ago

hi @hnyman

I complied it with lede 17.01 to my ower router yesterday ,mulit 3(https://github.com/hnyman/luci.git) is ok.but mulit 4 is not working I will try LEDE maste later thank you Hnyman

Hostle commented 7 years ago

As of latest commits this morning, multi4 is working with the latest openwrt DD. There is still some polishing to do. But all basic functionality is tested and working. Any menu should now be available for administration. With the exception of some network packages and other packages that have menus that use page.nodes. I still need to figure out the plumbing for the page.node menus.

jack338c commented 7 years ago

@Hostle Ok,thank you

hnyman commented 7 years ago

@Hostle Thanks for the updates. I pulled your updates from the firewrt repo and used git magic to squash the new commits in multi4 together with the old multi3 commits as a new multi3-v2 branch in my repo. I also combined the old uci-defaults fixes to the same commit. (No text editing was done, just squashing with git rebase.) https://github.com/hnyman/luci/commits/multi3-v2

That squashing revealed some things, so below is some feedback for you. (Note that I have not compiled the source, but just looked at the squashed commits.)

You should fix that admin/system.lua in your firewrt/multi4 branch.

After that I will pull the fixes, and will likely further squash the commits together so that all luci-app-multi-user changes are in one commit and changes to the existing LuCI in another. That would enable users to download just two patches to get the multi-user app into their LuCI build system.

hnyman commented 7 years ago

One more thing to fix: https://github.com/Fire-WRT/luci/blob/multi4/modules/luci-mod-admin-full/luasrc/controller/admin/network.lua#L42

There is double check for "Switch" access. On lines 42 and 52. The check on line 52 is inside the "if" block starting on line 42, so that if block starting on line 52 looks unnecessary and should be removed.

Hostle commented 7 years ago

Thanks Hynman, I have made the corrections to my multi4 branch.

hnyman commented 7 years ago

Thanks for fixes. I squashed the commits together. I ended up with four commits, so that each commit handles one module or app. One commit adds the new app and the other three modify the existing Luci components.

The commits can be found from a new "multi4-clean" branch in my repo: https://github.com/hnyman/luci/commits/multi4-clean

The branch is based on up-to-date LuCI (for LEDE & Openwrt DD master)

I compiled it and briefly tested. Seems to work ok. But I did not do any really extensive testing.

hnyman commented 7 years ago

@Hostle One more bug to fix: I tested what happens when I remove the luci-app-multi-user but leave the luci-base etc. changes in place. And I got locked out of LuCI, as dispatcher fails due to call to non-existent get_user function.

The bug seems to be in line 673 that has been modified by this commit: https://github.com/Fire-WRT/luci/commit/96f5bcca9c032d1788af7d2b3fb8211bddf55fd4#diff-e3b6bb251a311ce261b27e39a286427fR673

You call the get_user function also in this "else" branch when you already know that there is no multi-user app installed. Removing that line 673 "local user = get_user()" fixes things. I don't think that the veriable is used in that "else" branch at all, so removing it should be safe, right?

hnyman commented 7 years ago

Or actually, is there any actual reason to have the two functions ("get_user" and "load_menus", line 993 forward) located inside an "if" block, as the functions themselves do not use any functionality from the luci-app-multi-user. Couldn't these functions be declared here in any case ? (without checking that luci-app-multi-user is installed. They might be unused in that case, but wouldn't cause harm, I think.)

https://github.com/Fire-WRT/luci/blob/96f5bcca9c032d1788af7d2b3fb8211bddf55fd4/modules/luci-base/luasrc/dispatcher.lua#L991

jack338c commented 7 years ago

Dear I tested https://github.com/hnyman/luci/commits/multi4-clean on lede ,now it looks working fine thank you

VitorDiToro commented 7 years ago

@Hostle, @hnyman I tested https://github.com/hnyman/luci/commits/multi3 on OpenWRT DD, and find a small bug. If i am logged with a common user (not root), and try change my passaword, i need click in "Save & Apply" button, because if i press "Enter" key the page are reloaded, as if i had pressed "reset" button or "F5" key.

Hostle commented 7 years ago

I am fairly certain the is the normal behavior, I beleive if you try the same procedure as a root user you'll get the same results. As far as I know this is meant to be a failsafe to prevent lockout. The simple solution is to use the save and apply button as it was intended