Posts: 411
Threads: 103
Joined: Oct 2016
Reputation:
9
Hello again,
is it possible to maintain users in scripts? I haven't found it but maybe I missed something.
I mean are there functions like add_user, change_user, allow_access_to ...
I have hundreds of users and I don't want to maintain them manually. So my idea is doing it using http requests that will update a group object. This update will trigger a script which does the required action.
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Posts: 1764
Threads: 6
Joined: Jul 2015
Reputation:
117
tThis should be possible, i did the same with trend creation.
Basicly i simulate the normal form and post the datafields to the server.
The controller handles this reqeust like a form also does..
BR,
Erwin
Posts: 411
Threads: 103
Joined: Oct 2016
Reputation:
9
Thank you for the reply
but this is not a method I would like to follow. Because it fails in case LM changes the design of the page in some upgrade.
Isn't there any better method?
In Lua scripts there are functions for enabling and disabling scripts. Why there's not a function for adding an user?
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Posts: 1764
Threads: 6
Joined: Jul 2015
Reputation:
117
09.11.2016, 18:28
(This post was last modified: 09.11.2016, 18:37 by Erwin van der Zwart.)
rHi,
User passwords are encrypted in the DB, by using the form simulation methode the password get's stored in the DB with all needed actions to encrypt etc. making sure the new user is correct created.
Yes the form might change some time but is not likely. If it ever does the creation of a matching script is a matter of matching the new fields.
Also if the form ever changes the DB fields are changing also so you always need to adjust your script if that occurs. If you create a new entry in the DB you need to pass all the fields or the entry is denied.
BR,
Erwin
Posts: 940
Threads: 161
Joined: Jul 2015
Reputation:
33
How can I check which user is logged in via lua or javascript?