49 return _elgg_services()->db->getDataRow(
"SELECT * from {$this->CONFIG->dbprefix}users_entity where guid=$guid");
65 $query =
"UPDATE {$this->CONFIG->dbprefix}entities
66 set enabled='no' where owner_guid={$owner_guid}
67 or container_guid = {$owner_guid}";
101 static $newentity_cache;
103 $newentity_cache = new \ElggMemcache(
'new_entity_cache');
106 if ($newentity_cache) {
111 $query =
"UPDATE {$this->CONFIG->dbprefix}users_entity set banned='yes' where guid=$user_guid";
140 static $newentity_cache;
142 $newentity_cache = new \ElggMemcache(
'new_entity_cache');
145 if ($newentity_cache) {
150 $query =
"UPDATE {$this->CONFIG->dbprefix}users_entity set banned='no' where guid=$user_guid";
176 static $newentity_cache;
178 $newentity_cache = new \ElggMemcache(
'new_entity_cache');
181 if ($newentity_cache) {
185 $r =
_elgg_services()->db->updateData(
"UPDATE {$this->CONFIG->dbprefix}users_entity set admin='yes' where guid=$user_guid");
212 static $newentity_cache;
214 $newentity_cache = new \ElggMemcache(
'new_entity_cache');
217 if ($newentity_cache) {
221 $r =
_elgg_services()->db->updateData(
"UPDATE {$this->CONFIG->dbprefix}users_entity set admin='no' where guid=$user_guid");
256 $query =
"SELECT e.* FROM {$this->CONFIG->dbprefix}users_entity u
257 JOIN {$this->CONFIG->dbprefix}entities e ON e.guid = u.guid
258 WHERE u.username = '$username' AND $access";
284 $query =
"SELECT e.* FROM {$this->CONFIG->dbprefix}entities e
285 JOIN {$this->CONFIG->dbprefix}users_entity u ON e.guid = u.guid
286 WHERE email = '$email' AND $access";
288 return _elgg_services()->db->getData($query,
'entity_row_to_elggstar');
326 'seconds' => $seconds,
333 foreach (array(
'seconds',
'limit',
'offset') as
$key) {
348 if (
$data !==
null) {
353 $time = time() -
$options[
'seconds'];
359 'joins' => array(
"join {$dbprefix}users_entity u on e.guid = u.guid"),
360 'wheres' => array(
"u.last_action >= {$time}"),
361 'order_by' =>
"u.last_action desc",
398 throw new \RegistrationException(
_elgg_services()->translator->translate(
'registration:emailnotvalid'));
402 throw new \RegistrationException(
_elgg_services()->translator->translate(
'registration:passwordnotvalid'));
406 throw new \RegistrationException(
_elgg_services()->translator->translate(
'registration:usernamenotvalid'));
410 throw new \RegistrationException(
_elgg_services()->translator->translate(
'registration:userexists'));
414 throw new \RegistrationException(
_elgg_services()->translator->translate(
'registration:dupeemail'));
420 $user = new \ElggUser();
426 $user->owner_guid = 0;
427 $user->container_guid = 0;
429 if (
$user->save() ===
false) {
436 return $user->getGUID();
463 if (!preg_match(
'~^(\d+)\.([a-zA-Z0-9\-_]+)$~',
$code,
$m)) {
483 if ($result1 && $result2) {
499 'metadata_name' =>
'validated'
524 $query =
"UPDATE {$this->CONFIG->dbprefix}users_entity
525 set prev_last_action = last_action,
526 last_action = {$time} where guid = {$user_guid}";
543 $query =
"UPDATE {$this->CONFIG->dbprefix}users_entity
544 set prev_last_login = last_login, last_login = {$time} where guid = {$user_guid}";
if($guid==elgg_get_logged_in_user_guid()) $name
$user_guid
Avatar remove action.
getRow($guid)
Return the user specific details of a user by a row.
removeAdmin($user_guid)
Removes user $guid's admin flag.
setValidationStatus($user_guid, $status, $method='')
Set the validation status for a user.
disableEntities($owner_guid)
Disables all of a user's entities.
generateInviteCode($username)
Generates a unique invite code for a user.
getByEmail($email)
Get an array of users from an email address.
findActive($options=array(), $limit=10, $offset=0, $count=false)
Return users (or the number of them) who have been active within a recent period.
validateInviteCode($username, $code)
Validate a user's invite code.
setLastLogin($user_guid)
Sets the last logon time of the given user to right now.
unban($user_guid)
Unban a user.
getValidationStatus($user_guid)
Gets the validation status of a user.
setLastAction($user_guid)
Sets the last action time of the given user to right now.
ban($user_guid, $reason="")
Ban a user.
getByUsername($username)
Get user by username.
makeAdmin($user_guid)
Makes user $guid an admin.
__construct()
Constructor.
global $USERNAME_TO_GUID_MAP_CACHE
Map a username to a cached GUID.
$guid
Removes an admin notice.
events($event="", $object_type="", $function="", $priority=500, $call=false, $object=null)
Deprecated events core function.
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
access_get_show_hidden_status()
Return current status of showing disabled entities.
access_show_hidden_entities($show_hidden)
Show or hide disabled entities.
_elgg_get_access_where_sql(array $options=array())
Returns the SQL where clause for enforcing read access to data.
sanitise_string($string)
Wrapper function for alternate English spelling (.
execute_delayed_write_query($query, $handler="")
Queue a query for running during shutdown that writes to the database.
get_entity($guid)
Loads and returns an entity object from a guid.
_elgg_invalidate_cache_for_entity($guid)
Invalidate this class's entry in the cache.
_elgg_retrieve_cached_entity($guid)
Retrieve a entity from the cache.
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
is_memcache_available()
Return true if memcache is available and configured.
set_user_notification_setting($user_guid, $method, $value)
Set a user notification pref.
validate_email_address($address)
Simple validation of a email.
get_user_by_email($email)
Get an array of users from an email address.
validate_username($username)
Simple function which ensures that a username contains only valid characters.
get_user_by_username($username)
Get user by username.
validate_password($password)
Simple validation of a password.