Skip to content

silgy_usr_create_account

Jurek Muszyński edited this page Aug 26, 2019 · 11 revisions

int silgy_usr_create_account(int ci)

Description

Creates user account. ci is the connection index passed by the engine to silgy_app_main(). New user will have auth_level set to DEF_USER_AUTH_LEVEL.

silgy_usr_xxx functions directly read the query string / payload data.

Request must contain the following parameters:

If no USERSBY... compilation switch is present or USERSBYLOGIN is present:

  • login (mandatory)
  • email (optionally)

If USERSBYEMAIL compilation switch is present:

  • email (mandatory)

and also mandatory:

  • passwd (password)
  • rpasswd (repeat password)

and optionally:

  • name
  • phone
  • lang
  • tz
  • about

Create account form can contain hidden input named message to spoof robots. If it's not empty, the function will return ERR_ROBOT.

Returns

Returns OK or one of the error codes:

  • ERR_INVALID_REQUEST
  • ERR_WEBSITE_FIRST_LETTER
  • ERR_USERNAME_TOO_SHORT
  • ERR_USERNAME_CHARS
  • ERR_USERNAME_TAKEN
  • ERR_EMAIL_FORMAT_OR_EMPTY
  • ERR_PASSWORD_TOO_SHORT
  • ERR_PASSWORD_DIFFERENT
  • ERR_ROBOT
  • ERR_INT_SERVER_ERROR

Example

See silgy_app_main function in silgy_app.cpp in Toy Facebook project.

Notes

Requires USERS compilation switch.

Clone this wiki locally