26 $messages = array_map(
function (\
Elgg\Validation\ValidationResult $e) {
27 return $e->getError();
61 $new_user->setValidationStatus(
true,
'register_action');
63 }
catch (\Exception $e) {
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
Elgg registration action.
Generic parent class for login exceptions.
elgg_ok_response($content= '', string|array $message= '', string $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_register_user(array $params=[])
Registers a user.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
const ELGG_HTTP_UNAUTHORIZED
elgg_trigger_event_results(string $event, string $type, array $params=[], $returnvalue=null)
Triggers an event where it is expected that the mixed return value could be manipulated by event call...
Could not register a new user for whatever reason.
const ELGG_IGNORE_ACCESS
elgg_call() flags
if(!elgg_trigger_event_results('register', 'user', $params, true)) if($new_user->isValidated()===null) catch(\Exception $e) $response_data
elgg_error_response(string|array $message= '', string $forward_url=REFERRER, int $status_code=ELGG_HTTP_BAD_REQUEST)
Prepare an error response to be returned by a page or an action handler.
const REFERRER
Used in calls to forward() to specify the browser should be redirected to the referring page...
elgg_validate_registration_data(string $username, string|array $password, string $name, string $email, bool $allow_multiple_emails=false)
Assert that given registration details are valid and can be used to register the user.
elgg_get_login_forward_url(\ElggUser $user)
Determine which URL the user should be forwarded to upon successful login.
elgg_get_site_entity()
Get the current site entity.
const ELGG_HTTP_BAD_REQUEST
elgg_login(\ElggUser $user, bool $persistent=false)
Log in a user.
Login as the specified user.