33 $user = $event->getUserParam();
34 $request = $event->getParam(
'request');
50 $current_password = (string)
$request->getParam(
'current_password',
null,
false);
55 $request->validation()->fail(
'password',
'',
elgg_echo(
'LoginException:ChangePasswordFailure'));
64 $request->validation()->fail(
'password',
'', $e->getMessage());
78 $user->getDisplayName(),
79 $site->getDisplayName(),
82 ],
$user->getLanguage());
86 'action' =>
'password_change',
87 'apply_muting' =>
false,
107 $user = $event->getUserParam();
110 $request = $event->getParam(
'request');
144 $user = $event->getUserParam();
145 $request = $event->getParam(
'request');
160 if (!
$user->canEdit()) {
189 $response->setForwardURL(elgg_generate_url(
'settings:account', [
190 'username' => $username,
207 $user = $event->getUserParam();
208 $request = $event->getParam(
'request');
255 $user = $event->getUserParam();
256 $request = $event->getParam(
'request');
273 $assert_unregistered =
true;
276 $assert_unregistered =
false;
333 $user = $event->getUserParam();
334 $request = $event->getParam(
'request');
340 $default_access =
$request->getParam(
'default_access');
341 if (!isset($default_access)) {
345 if (!
$user->setMetadata(
'elgg_default_access', $default_access)) {
346 $request->validation()->fail(
'default_access', $default_access,
elgg_echo(
'user:default_access:failure'));
350 $request->validation()->pass(
'default_access', $default_access,
elgg_echo(
'user:default_access:success'));
if(! $user||! $user->canDelete()) $name
$params
Saves global plugin settings.
Models an event passed to event handlers.
Could not register a new user for whatever reason.
Exception thrown if an argument is not of the expected type.
Event handlers for user settings.
static setEmail(\Elgg\Event $event)
Set a user's email address.
static setUsername(\Elgg\Event $event)
Set a user's username.
static setName(\Elgg\Event $event)
Set a user's display name.
static setPassword(\Elgg\Event $event)
Set a user's password.
static setDefaultAccess(\Elgg\Event $event)
Set a user's default access level.
static setLanguage(\Elgg\Event $event)
Set a user's language.
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
const REFERRER
Used in calls to forward() to specify the browser should be redirected to the referring page.
if(! $user instanceof \ElggUser) $who_can_change_language
if($item instanceof \ElggEntity) elseif($item instanceof \ElggRiverItem) elseif($item instanceof \ElggRelationship) elseif(is_callable([ $item, 'getType']))
_elgg_services()
Get the global service provider.
elgg_get_site_entity()
Get the current site entity.
HTTP response builder interface.
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
elgg_register_event_handler(string $event, string $type, callable|string $callback, int $priority=500)
Helper functions for event handling.
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...
notify_user(int|array $to, int $from=0, string $subject='', string $message='', array $params=[], $methods_override=null)
Notify a user via their preferences.
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
if(! $user||! $user->canEdit()) $password
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.