Logic Machine Forum
Users maintaining via script? - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Users maintaining via script? (/showthread.php?tid=455)



Users maintaining via script? - Thomas - 05.11.2016

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.


RE: Users maintaining via script? - Erwin van der Zwart - 05.11.2016

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


RE: Users maintaining via script? - Thomas - 09.11.2016

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?


RE: Users maintaining via script? - Erwin van der Zwart - 09.11.2016

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


RE: Users maintaining via script? - buuuudzik - 10.11.2016

How can I check which user is logged in via lua or javascript?