187 elgg()->accounts->assertValidEmail($address);
307 if (
$user->canEdit()) {
309 'name' =>
'avatar:edit',
327 if (!
$user->isBanned()) {
332 'href' =>
"action/admin/user/ban?guid={$user->guid}",
334 'section' =>
'admin',
341 'href' =>
"action/admin/user/unban?guid={$user->guid}",
343 'section' =>
'admin',
351 'href' =>
"action/admin/user/delete?guid={$user->guid}",
353 'section' =>
'admin',
357 'name' =>
'resetpassword',
360 'href' =>
"action/admin/user/resetpassword?guid={$user->guid}",
362 'section' =>
'admin',
365 if (!
$user->isAdmin()) {
367 'name' =>
'makeadmin',
369 'icon' =>
'level-up',
370 'href' =>
"action/admin/user/makeadmin?guid={$user->guid}",
372 'section' =>
'admin',
376 'name' =>
'removeadmin',
378 'icon' =>
'level-down',
379 'href' =>
"action/admin/user/removeadmin?guid={$user->guid}",
381 'section' =>
'admin',
386 'name' =>
'settings:edit',
389 'href' =>
"settings/user/$user->username",
390 'section' =>
'admin',
407 $user = $hook->getEntityParam();
418 if (!
$user->canEdit()) {
422 $return = $hook->getValue();
424 'name' =>
'avatar:edit',
427 'class' => [
'elgg-button',
'elgg-button-action'],
464 'name' =>
'edit_avatar',
467 'section' =>
'1_profile',
468 'contexts' => [
'settings'],
497 'href' => $viewer->getURL(),
498 'link_class' =>
'elgg-avatar-small',
500 'src' => $viewer->getIconURL(
'small'),
501 'alt' => $viewer->getDisplayName(),
503 'icon_alt' =>
'angle-down',
509 'name' =>
'usersettings',
510 'parent_name' =>
'account',
511 'href' =>
"settings/user/{$viewer->username}",
518 if ($viewer->isAdmin()) {
520 'name' =>
'administration',
521 'parent_name' =>
'account',
532 'parent_name' =>
'account',
533 'href' =>
'action/logout',
535 'icon' =>
'sign-out',
559 $icon->setFilename(
"profile/{$entity->guid}{$size}.jpg");
581 if (!$event instanceof \
Elgg\Notifications\SubscriptionNotificationEvent) {
585 if ($event->getAction() !==
'unban') {
589 $user = $event->getObject();
594 $return_value[
$user->guid] = [
'email'];
596 return $return_value;
625 $user->getDisplayName(),
626 $site->getDisplayName(),
650 if (!($return_value instanceof \
Elgg\Notifications\Notification)) {
658 if (!($recipient instanceof
ElggUser) || !(
$object instanceof ElggUser)) {
662 if ($recipient->getGUID() !==
$object->getGUID()) {
669 $return_value->body =
elgg_echo(
'user:notification:unban:body', [
670 $recipient->getDisplayName(),
671 $site->getDisplayName(),
675 $return_value->url = $recipient->getURL();
677 return $return_value;
698 $entity = $hook->getEntityParam();
703 $return = $hook->getValue();
706 'name' =>
'validate',
758 $events->registerHandler(
'init',
'system',
'users_init', 0);
force_user_password_reset($user_guid, $password)
Low level function to reset a given user's password.
elgg_http_add_url_query_elements($url, array $elements)
Sets elements in a URL's query string.
elgg_validate_registration_data($username, $password, $name, $email, $allow_multiple_emails=false)
Assert that given registration details are valid and can be used to register the user.
elgg_is_logged_in()
Returns whether or not the user is currently logged in.
if(!$item instanceof ElggRiverItem) $object
if(!$user||!$user->canDelete()) $name
$params
Saves global plugin settings.
get_user($guid)
Get a user object from a GUID.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
get_user_by_email($email)
Get an array of users from an email address.
const CHARS_PASSWORD
Character set for temp passwords (no risk of embedded profanity/glyphs that look similar) ...
disable_user_entities($owner_guid)
Disables all of a user's entities.
validate_email_address($address)
Simple validation of a email.
_elgg_user_unvalidated_menu(\Elgg\Hook $hook)
Register menu items to the user:unvalidated menu.
_elgg_user_title_menu(\Elgg\Hook $hook)
Adds avatar edit button to title menu.
$guid
Removes an admin notice.
users_init()
Users initialisation function, which establishes the page handler.
send_new_password_request($user_guid)
Generate and send a password request email to a given user's registered email address.
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
_elgg_user_get_subscriber_unban_action($hook, $type, $return_value, $params)
Add the user to the subscribers when (un)banning the account.
_elgg_user_prepare_unban_notification($hook, $type, $return_value, $params)
Prepare the notification content for the user being unbanned.
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
elgg_user_hover_menu($hook, $type, $return, $params)
Setup the default user hover menu.
notify_user($to, $from=0, $subject= '', $message= '', array $params=[], $methods_override=null)
Notify a user via their preferences.
_elgg_user_set_icon_file($hook, $type, $icon, $params)
Set user icon file.
get_user_by_username($username)
Get user by username.
$user_guid
Validate a user.
generate_invite_code($username)
Generates a unique invite code for a user.
if(!$user||!$user->canEdit()) $password
Base class for events and hooks.
_elgg_user_ban_notification($event, $type, $user)
Send a notification to the user that the account was banned.
if(elgg_extract('friends_only', $vars, false)) if(!(bool) elgg_extract('include_banned', $vars, true)) $body
get_user_by_code($hash)
Get user by persistent login password.
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
elgg_generate_url($name, array $parameters=[])
Generate a URL for named route.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
_elgg_user_topbar_menu($hook, $type, $return, $params)
Register menu items for the topbar menu.
validate_password($password)
Simple validation of a password.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
validate_username($username)
Simple function which ensures that a username contains only valid characters.
register_user($username, $password, $name, $email, $allow_multiple_emails=false, $subtype=null)
Registers a user, returning false if the username already exists.
elgg_get_site_entity()
Get the current site entity.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_get_registration_url(array $query=[], $fragment= '')
Returns site's registration URL Triggers a 'registration_url', 'site' plugin hook that can be used by...
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
_elgg_config()
Get the Elgg config service.
generate_random_cleartext_password()
Generate a random 12 character clear text password.
elgg_register_notification_event($object_type, $object_subtype, array $actions=[])
Register a notification event.
_elgg_user_page_menu($hook, $type, $return, $params)
Register menu items for the page menu.
_elgg_services()
Get the global service provider.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
elgg_register_entity_type($type, $subtype=null)
Registers an entity type and subtype as a public-facing entity that should be shown in search and by ...
elgg_validate_invite_code($username, $code)
Validate a user's invite code.
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
elgg_generate_entity_url(ElggEntity $entity, $resource= 'view', $subresource=null, array $parameters=[])
Generate entity URL from a named route.
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
find_active_users(array $options=[])
Return users (or the number of them) who have been active within a recent period. ...
elgg_get_login_url(array $query=[], $fragment= '')
Returns site's login URL Triggers a 'login_url', 'site' plugin hook that can be used by plugins to al...
execute_new_password_request($user_guid, $conf_code, $password=null)
Validate and change password for a user.
get_entity($guid)
Loads and returns an entity object from a guid.