04.04.2019, 07:21
This cannot be done with DB access. Here's an example of HTTP request which creates a new user. Change admin password in socket.http.request call.
Code:
require('json')
require('socket.http')
require('socket.url')
data = {
name = 'test', -- full name
login = 'testtest', -- login
password = '123456', -- password
password_repeat = '123456', -- must match password
access_vis = 'F', -- full access to visualization
access_schedulers = '', -- no access to schedulers
access_trends = 'F', -- full access to trends
}
post = 'data=' .. socket.url.escape(json.encode(data))
res, err = socket.http.request('http://admin:admin@127.0.0.1/scada-main/users/save', post)
log(res, err)