This function is beign used to add a new user to the www database.
it will first check if the sent $_POST variables are valid for registering, if one or more rules are broken (eg the username is too short) the template will be reloaded but this time with the appropriate error messages. If the checking was successful it will call the write_user() function (located in this same file). That function will create a new www user and matching ticket_user. It will also push the newly created user to the shard. In case the shard is offline, the new user will be temporary stored in the ams_querycache, waiting for the sync cron job to update it.
- Author:
- Daan Janssens, mentored by Matthew Lagoe