Elgg
Version 4.3
|
Go to the source code of this file.
Functions | |
get_access_array (int $user_guid=0) | |
Bundle all functions which have been deprecated in Elgg 4.3. More... | |
get_default_access (ElggUser $user=null, array $input_params=[]) | |
Gets the default access permission. More... | |
has_access_to_entity (\ElggEntity $entity,\ElggUser $user=null) | |
Can a user access an entity. More... | |
get_write_access_array (int $user_guid=0, $ignored=0, bool $flush=false, array $input_params=[]) | |
Returns an array of access permissions that the user is allowed to save content with. More... | |
can_edit_access_collection (int $collection_id, int $user_guid=null) | |
Can the user change this access collection? More... | |
create_access_collection (string $name, int $owner_guid=0, $subtype=null) | |
Creates a new access collection. More... | |
delete_access_collection (int $collection_id) | |
Deletes a specified access collection and its membership. More... | |
get_access_collection (int $collection_id) | |
Get a specified access collection. More... | |
add_user_to_access_collection (int $user_guid, int $collection_id) | |
Adds a user to an access collection. More... | |
remove_user_from_access_collection (int $user_guid, int $collection_id) | |
Removes a user from an access collection. More... | |
get_members_of_access_collection (int $collection_id, bool $guids_only=false, array $options=[]) | |
Get all of members of an access collection. More... | |
get_readable_access_level (int $entity_access_id) | |
Return the name of an ACCESS_* constant or an access collection, but only if the logged in user has write access to it. More... | |
get_entity_statistics (int $owner_guid=0) | |
Return an array reporting the number of various entities in the system. More... | |
get_relationship ($id) | |
Get a relationship by its ID. More... | |
delete_relationship ($id) | |
Delete a relationship by its ID. More... | |
add_entity_relationship ($guid_one, $relationship, $guid_two) | |
Create a relationship between two entities. More... | |
check_entity_relationship ($guid_one, $relationship, $guid_two) | |
Check if a relationship exists between two entities. More... | |
remove_entity_relationship ($guid_one, $relationship, $guid_two) | |
Delete a relationship between two entities. More... | |
remove_entity_relationships ($guid, $relationship="", $inverse_relationship=false, $type= '') | |
Removes all relationships originating from a particular entity. More... | |
get_entity_relationships ($guid, $inverse_relationship=false) | |
Get all the relationships for a given GUID. More... | |
register_pam_handler ($handler, $importance= 'sufficient', $policy= 'user') | |
Register a PAM handler. More... | |
unregister_pam_handler ($handler, $policy= 'user') | |
Unregisters a PAM handler. More... | |
elgg_authenticate ($username, $password) | |
Perform user authentication with a given username and password. More... | |
generate_invite_code ($username) | |
Generates a unique invite code for a user. More... | |
elgg_get_loaded_external_files (string $type, string $location) | |
Get external resource descriptors. More... | |
get_dir_size ($dir, $total_size=0, $show_deprecation_notice=true) | |
Get the size of the specified directory. More... | |
filter_tags ($var) | |
Filter tags from a given string based on registered hooks. More... | |
parse_urls ($text) | |
Takes a string and turns any URLs into formatted links. More... | |
current_page_url () | |
Returns the current page's complete URL. More... | |
is_email_address ($address) | |
Validates an email address. More... | |
string_to_tag_array ($string) | |
Takes in a comma-separated string and returns an array of tags which have been trimmed. More... | |
add_translation ($country_code, $language_array) | |
Add a translation. More... | |
get_current_language () | |
Get the current system/user language or "en". More... | |
logout () | |
Log the current user out. More... | |
login (\ElggUser $user, $persistent=false) | |
Logs in a specified . More... | |
log_login_failure ($user_guid) | |
Log a failed login for $user_guid. More... | |
reset_login_failure_count ($user_guid) | |
Resets the fail login count for $user_guid. More... | |
check_rate_limit_exceeded ($user_guid) | |
Checks if the rate limit of failed logins has been exceeded for $user_guid. More... | |
find_active_users (array $options=[]) | |
Return users (or the number of them) who have been active within a recent period. More... | |
get_online_users (array $options=[]) | |
Render a list of currently online users. More... | |
generate_random_cleartext_password () | |
Generate a random 12 character clear text password. More... | |
force_user_password_reset ($user_guid, $password) | |
Low level function to reset a given user's password. More... | |
send_new_password_request ($user_guid) | |
Generate and send a password request email to a given user's registered email address. More... | |
execute_new_password_request ($user_guid, $conf_code, $password=null) | |
Validate and change password for a user. More... | |
register_user ($username, $password, $name, $email, $allow_multiple_emails=false, $subtype=null, array $params=[]) | |
Registers a user, returning false if the username already exists. More... | |
elgg_get_engine_path () | |
/path/to/elgg/engine with no trailing slash. More... | |
elgg_delete_metadata_by_id ($id) | |
Deletes metadata using its ID. More... | |
elgg_clear_sticky_value ($form_name, $variable) | |
Remove one value of form submission data from the session. More... | |
elgg_register_external_view ($view, $cacheable=false) | |
Registers a view as being available externally (i.e. More... | |
elgg_unregister_external_view ($view) | |
Unregister a view for ajax calls. More... | |
add_entity_relationship | ( | $guid_one, | |
$relationship, | |||
$guid_two | |||
) |
Create a relationship between two entities.
E.g. friendship, group membership, site membership.
This function lets you make the statement "$guid_one is a $relationship of $guid_two". In the statement, $guid_one is the subject of the relationship, $guid_two is the target, and $relationship is the type.
int | $guid_one | GUID of the subject entity of the relationship |
string | $relationship | Type of the relationship |
int | $guid_two | GUID of the target entity of the relationship |
Definition at line 326 of file deprecated-4.3.php.
add_translation | ( | $country_code, | |
$language_array | |||
) |
Add a translation.
Translations are arrays in the Zend Translation array format, eg:
$english = array('message1' => 'message1', 'message2' => 'message2'); $german = array('message1' => 'Nachricht1','message2' => 'Nachricht2');
string | $country_code | Standard country code (eg 'en', 'nl', 'es') |
array | $language_array | Formatted array of strings |
Definition at line 631 of file deprecated-4.3.php.
add_user_to_access_collection | ( | int | $user_guid, |
int | $collection_id | ||
) |
Adds a user to an access collection.
Triggers the 'access:collections:add_user', 'collection' plugin hook.
int | $user_guid | The GUID of the user to add |
int | $collection_id | The ID of the collection to add them to |
Definition at line 195 of file deprecated-4.3.php.
can_edit_access_collection | ( | int | $collection_id, |
int | $user_guid = null |
||
) |
Can the user change this access collection?
Use the plugin hook of 'access:collections:write', 'user' to change this.
Respects access control disabling for admin users and elgg_call()
int | $collection_id | The collection id |
mixed | $user_guid | The user GUID to check for. Defaults to logged in user. |
Definition at line 120 of file deprecated-4.3.php.
check_entity_relationship | ( | $guid_one, | |
$relationship, | |||
$guid_two | |||
) |
Check if a relationship exists between two entities.
If so, the relationship object is returned.
This function lets you ask "Is $guid_one a $relationship of $guid_two?"
int | $guid_one | GUID of the subject entity of the relationship |
string | $relationship | Type of the relationship |
int | $guid_two | GUID of the target entity of the relationship |
Definition at line 344 of file deprecated-4.3.php.
check_rate_limit_exceeded | ( | $user_guid | ) |
Checks if the rate limit of failed logins has been exceeded for $user_guid.
int | $user_guid | User GUID |
Definition at line 743 of file deprecated-4.3.php.
create_access_collection | ( | string | $name, |
int | $owner_guid = 0 , |
||
$subtype = null |
|||
) |
Creates a new access collection.
Access colletions allow plugins and users to create granular access for entities.
Triggers plugin hook 'access:collections:addcollection', 'collection'
string | $name | The name of the collection. |
int | $owner_guid | The GUID of the owner (default: currently logged in user). |
string | $subtype | The subtype indicates the usage of the acl |
Definition at line 144 of file deprecated-4.3.php.
current_page_url | ( | ) |
Returns the current page's complete URL.
It uses the configured site URL for the hostname rather than depending on what the server uses to populate $_SERVER.
Definition at line 575 of file deprecated-4.3.php.
delete_access_collection | ( | int | $collection_id | ) |
Deletes a specified access collection and its membership.
int | $collection_id | The collection ID |
Definition at line 159 of file deprecated-4.3.php.
delete_relationship | ( | $id | ) |
Delete a relationship by its ID.
int | $id | The relationship ID |
Definition at line 306 of file deprecated-4.3.php.
elgg_authenticate | ( | $username, | |
$password | |||
) |
Perform user authentication with a given username and password.
string | $username | The username |
string | $password | The password |
Definition at line 456 of file deprecated-4.3.php.
elgg_clear_sticky_value | ( | $form_name, | |
$variable | |||
) |
Remove one value of form submission data from the session.
string | $form_name | The name of the form |
string | $variable | The name of the variable to clear |
Definition at line 938 of file deprecated-4.3.php.
elgg_delete_metadata_by_id | ( | $id | ) |
Deletes metadata using its ID.
int | $id | The metadata ID to delete. |
Definition at line 918 of file deprecated-4.3.php.
elgg_get_engine_path | ( | ) |
/path/to/elgg/engine with no trailing slash.
Definition at line 904 of file deprecated-4.3.php.
elgg_get_loaded_external_files | ( | string | $type, |
string | $location | ||
) |
Get external resource descriptors.
string | $type | Type of file: js or css |
string | $location | Page location |
Definition at line 494 of file deprecated-4.3.php.
elgg_register_external_view | ( | $view, | |
$cacheable = false |
|||
) |
Registers a view as being available externally (i.e.
via URL).
string | $view | The name of the view. |
boolean | $cacheable | Whether this view can be cached. |
Definition at line 954 of file deprecated-4.3.php.
elgg_unregister_external_view | ( | $view | ) |
Unregister a view for ajax calls.
string | $view | The view name |
Definition at line 973 of file deprecated-4.3.php.
execute_new_password_request | ( | $user_guid, | |
$conf_code, | |||
$password = null |
|||
) |
Validate and change password for a user.
int | $user_guid | The user id |
string | $conf_code | Confirmation code as sent in the request email. |
string | $password | Optional new password, if not randomly generated. |
Definition at line 853 of file deprecated-4.3.php.
filter_tags | ( | $var | ) |
Filter tags from a given string based on registered hooks.
mixed | $var | Anything that does not include an object (strings, ints, arrays) This includes multi-dimensional arrays. |
Definition at line 544 of file deprecated-4.3.php.
find_active_users | ( | array | $options = [] | ) |
Return users (or the number of them) who have been active within a recent period.
array | $options | Array of options with keys: seconds (int) => Length of period (default 600 = 10min) limit (int) => Limit (default from settings) offset (int) => Offset (default 0) count (bool) => Return a count instead of users? (default false) |
Definition at line 772 of file deprecated-4.3.php.
force_user_password_reset | ( | $user_guid, | |
$password | |||
) |
Low level function to reset a given user's password.
int | $user_guid | The user. |
string | $password | Text (which will then be converted into a hash and stored) |
Definition at line 821 of file deprecated-4.3.php.
generate_invite_code | ( | $username | ) |
Generates a unique invite code for a user.
string | $username | The username of the user sending the invitation |
Definition at line 478 of file deprecated-4.3.php.
generate_random_cleartext_password | ( | ) |
Generate a random 12 character clear text password.
Definition at line 805 of file deprecated-4.3.php.
get_access_array | ( | int | $user_guid = 0 | ) |
Bundle all functions which have been deprecated in Elgg 4.3.
Returns an array of access IDs a user is permitted to see.
Can be overridden with the 'access:collections:read', 'user' plugin hook.
This returns a list of all the collection ids a user owns or belongs to plus public and logged in access levels. If the user is an admin, it includes the private access level.
int | $user_guid | User ID; defaults to currently logged in user |
Definition at line 25 of file deprecated-4.3.php.
get_access_collection | ( | int | $collection_id | ) |
Get a specified access collection.
int | $collection_id | The collection ID |
Definition at line 178 of file deprecated-4.3.php.
get_current_language | ( | ) |
Get the current system/user language or "en".
Definition at line 644 of file deprecated-4.3.php.
get_default_access | ( | ElggUser | $user = null , |
array | $input_params = [] |
||
) |
Gets the default access permission.
This returns the default access level for the site or optionally of the user. If want you to change the default access based on group of other information, use the 'default', 'access' plugin hook.
ElggUser | $user | The user for whom we're getting default access. Defaults to logged in user. |
array | $input_params | Parameters passed into an input/access view |
Definition at line 44 of file deprecated-4.3.php.
get_dir_size | ( | $dir, | |
$total_size = 0 , |
|||
$show_deprecation_notice = true |
|||
) |
Get the size of the specified directory.
string | $dir | The full path of the directory |
int | $total_size | Add to current dir size |
Definition at line 510 of file deprecated-4.3.php.
get_entity_relationships | ( | $guid, | |
$inverse_relationship = false |
|||
) |
Get all the relationships for a given GUID.
int | $guid | GUID of the subject or target entity (see $inverse) |
bool | $inverse_relationship | Is $guid the target of the relationships? By default $guid is the subject of the relationships. |
Definition at line 396 of file deprecated-4.3.php.
get_entity_statistics | ( | int | $owner_guid = 0 | ) |
Return an array reporting the number of various entities in the system.
int | $owner_guid | Optional owner of the statistics |
Definition at line 278 of file deprecated-4.3.php.
get_members_of_access_collection | ( | int | $collection_id, |
bool | $guids_only = false , |
||
array | $options = [] |
||
) |
Get all of members of an access collection.
int | $collection_id | The collection's ID |
bool | $guids_only | If set to true, will only return the members' GUIDs (default: false) |
array | $options | ege* options |
Definition at line 228 of file deprecated-4.3.php.
get_online_users | ( | array | $options = [] | ) |
Render a list of currently online users.
This also support options from elgg_list_entities().
array | $options | Options array with keys: seconds (int) => Number of seconds (default 600 = 10min) |
Definition at line 790 of file deprecated-4.3.php.
get_readable_access_level | ( | int | $entity_access_id | ) |
Return the name of an ACCESS_* constant or an access collection, but only if the logged in user has write access to it.
Write access requirement prevents us from exposing names of access collections that current user has been added to by other members and may contain sensitive classification of the current user (e.g. close friends vs acquaintances).
Returns a string in the language of the user for global access levels, e.g.'Public, 'Friends', 'Logged in', 'Public'; or a name of the owned access collection, e.g. 'My work colleagues'; or a name of the group or other access collection, e.g. 'Group: Elgg technical support'; or 'Limited' if the user access is restricted to read-only, e.g. a friends collection the user was added to
int | $entity_access_id | The entity's access id |
Definition at line 264 of file deprecated-4.3.php.
get_relationship | ( | $id | ) |
Get a relationship by its ID.
int | $id | The relationship ID |
Definition at line 292 of file deprecated-4.3.php.
get_write_access_array | ( | int | $user_guid = 0 , |
$ignored = 0 , |
|||
bool | $flush = false , |
||
array | $input_params = [] |
||
) |
Returns an array of access permissions that the user is allowed to save content with.
Permissions returned are of the form (id => 'name').
Example return value in English: array( 0 => 'Private', -2 => 'Friends', 1 => 'Logged in users', 2 => 'Public', 34 => 'My favorite friends', );
Plugin hook of 'access:collections:write', 'user'
int | $user_guid | The user's GUID. |
int | $ignored | Ignored parameter |
bool | $flush | If this is set to true, this will ignore a cached access array |
array | $input_params | Some parameters passed into an input/access view |
Definition at line 98 of file deprecated-4.3.php.
has_access_to_entity | ( | \ElggEntity | $entity, |
\ElggUser | $user = null |
||
) |
Can a user access an entity.
This is mostly useful for checking if a user other than the logged in user has access to an entity that is currently loaded.
\ElggEntity | $entity | The entity to check access for. |
\ElggUser | $user | Optionally user to check access for. Defaults to logged in user (which is a useless default). |
Definition at line 65 of file deprecated-4.3.php.
is_email_address | ( | $address | ) |
Validates an email address.
string | $address | Email address. |
Definition at line 590 of file deprecated-4.3.php.
log_login_failure | ( | $user_guid | ) |
Log a failed login for $user_guid.
int | $user_guid | User GUID |
Definition at line 693 of file deprecated-4.3.php.
login | ( | \ElggUser | $user, |
$persistent = false |
|||
) |
Logs in a specified .
For standard registration, use in conjunction with elgg_pam_authenticate.
\ElggUser | $user | A valid Elgg user object |
boolean | $persistent | Should this be a persistent login? |
Definition at line 677 of file deprecated-4.3.php.
logout | ( | ) |
parse_urls | ( | $text | ) |
Takes a string and turns any URLs into formatted links.
string | $text | The input string |
Definition at line 559 of file deprecated-4.3.php.
register_pam_handler | ( | $handler, | |
$importance = 'sufficient' , |
|||
$policy = 'user' |
|||
) |
Register a PAM handler.
A PAM handler should return true if the authentication attempt passed. For a failure, return false or throw an exception. Returning nothing indicates that the handler wants to be skipped.
Note, $handler must be string callback (not an array/Closure).
string | $handler | Callable global handler function in the format () pam_handler($credentials = null); |
string | $importance | The importance - "sufficient" (default) or "required" |
string | $policy | The policy type, default is "user" |
Definition at line 419 of file deprecated-4.3.php.
register_user | ( | $username, | |
$password, | |||
$name, | |||
$email, | |||
$allow_multiple_emails = false , |
|||
$subtype = null , |
|||
array | $params = [] |
||
) |
Registers a user, returning false if the username already exists.
string | $username | The username of the new user |
string | $password | The password |
string | $name | The user's display name |
string | The user's email address | |
bool | $allow_multiple_emails | Allow the same email address to be registered multiple times? |
string | $subtype | Subtype of the user entity |
array | $params | Additional parameters |
Definition at line 885 of file deprecated-4.3.php.
remove_entity_relationship | ( | $guid_one, | |
$relationship, | |||
$guid_two | |||
) |
Delete a relationship between two entities.
This function lets you say "$guid_one is no longer a $relationship of $guid_two."
int | $guid_one | GUID of the subject entity of the relationship |
string | $relationship | Type of the relationship |
int | $guid_two | GUID of the target entity of the relationship |
Definition at line 362 of file deprecated-4.3.php.
remove_entity_relationships | ( | $guid, | |
$relationship = "" , |
|||
$inverse_relationship = false , |
|||
$type = '' |
|||
) |
Removes all relationships originating from a particular entity.
int | $guid | GUID of the subject or target entity (see $inverse) |
string | $relationship | Type of the relationship (optional, default is all relationships) |
bool | $inverse_relationship | Is $guid the target of the deleted relationships? By default, $guid is the subject of the relationships. |
string | $type | The type of entity related to $guid (defaults to all) |
Definition at line 380 of file deprecated-4.3.php.
remove_user_from_access_collection | ( | int | $user_guid, |
int | $collection_id | ||
) |
Removes a user from an access collection.
Triggers the 'access:collections:remove_user', 'collection' plugin hook.
int | $user_guid | The user GUID |
int | $collection_id | The access collection ID |
Definition at line 212 of file deprecated-4.3.php.
reset_login_failure_count | ( | $user_guid | ) |
Resets the fail login count for $user_guid.
int | $user_guid | User GUID |
Definition at line 718 of file deprecated-4.3.php.
send_new_password_request | ( | $user_guid | ) |
Generate and send a password request email to a given user's registered email address.
int | $user_guid | User GUID |
Definition at line 836 of file deprecated-4.3.php.
string_to_tag_array | ( | $string | ) |
Takes in a comma-separated string and returns an array of tags which have been trimmed.
string | $string | Comma-separated tag string |
Definition at line 606 of file deprecated-4.3.php.
unregister_pam_handler | ( | $handler, | |
$policy = 'user' |
|||
) |
Unregisters a PAM handler.
string | $handler | The PAM handler function name |
string | $policy | The policy type, default is "user" |
Definition at line 435 of file deprecated-4.3.php.