register_user

register_user. Registers a new user.

Runs on: the server only. The statement that calls it runs on the server, and its result is a server-side value: the server keeps it, the device never writes it, and it is copied to the device only when a device statement reads it.

Format:

register_user(username,password,confirm_password [,email],[,type] )

Parameters:

Parameter Type Description
username string The username to create. This must be unique i.e. it cannot match any other existign users
password string The password to assign to the new user
confirm_password string The password confirmation. must match the password
email string  [Optional]email address to set for the user
type string  [Optional]"normal" or "admin". If the type is not provided, it defaults to "normal"

Returned Value:

Type Description
structure with components :
Component Type Description
registeredbooleansays if registration was successful or not
registration_errorstringset if registration failed. gives the error message
user_idstringset if registration succeeded. id of the user