Skip to content

silgy_usr_save_account

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

int silgy_usr_save_account(int ci)

Description

Saves or deletes user account. ci is the connection index passed by the engine to silgy_app_main(). Existing password (opasswd) must be present to make any changes to the user account.

silgy_usr_xxx functions directly read the query string / payload data.

Request must contain the following parameters:

  • email (email)
  • passwd (new password – if to be changed)
  • rpasswd (new password again)
  • opasswd (old password)

and optionally:

  • login (login)
  • name (name)
  • lang (language)
  • tz (time zone)
  • about (about)
  • phone (phone)
  • delete (if on and no delconf is present – WAR_BEFORE_DELETE will be returned)
  • delconf (if 1 – indicates that user confirmed their will to delete the account)

Returns

Returns OK or one of the error codes:

  • ERR_INVALID_REQUEST
  • ERR_EMAIL_EMPTY
  • ERR_EMAIL_FORMAT
  • ERR_EMAIL_FORMAT_OR_EMPTY
  • ERR_EMAIL_TAKEN
  • ERR_PASSWORD_TOO_SHORT
  • ERR_PASSWORD_DIFFERENT
  • ERR_OLD_PASSWORD
  • WAR_BEFORE_DELETE
  • MSG_ACCOUNT_DELETED
  • 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