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.

Create User with DB
#1
Hi all,

I add a user to the database like this :

Code:
    local user = {
        name = db:escape(name),
        login = db:escape(login),
        password = hashpassword(db:escape(login), "123456"),        
        homepage = "apps-fcs",        
        access_apps = "P",        
        access_vis = '',
        access_mosaic = "F",
        access_schedulers = '',
        access_trends = '',        
        allow_objects = "",        
        active = 1
    }
    
    result, err = db:insert('users', user)
    io.readproc('/etc/init.d/nginx reload')

The user is added, but when I'm try to connect, I get a 403 error !

any idea ?

thanks
Reply
#2
Use webrequest library: https://forum.logicmachine.net/showthread.php?tid=4425
You don't need to escape/has any values.
Reply
#3
Hi admin,

I forgot to mention that I was in a .lp file for an app.

Where did the 403 error come from? j
Reply
#4
In current firmware you should be able to use webrequest in .lp files.

You have partial apps access set but no ACL for apps provided.
Reply


Forum Jump: