This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Users maintaining via script?
#1
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
Reply
#2
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
Reply
#3
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
Reply
#4
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
Reply
#5
How can I check which user is logged in via lua or javascript?
Reply


Forum Jump: