aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-23 21:51:52 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-23 21:51:52 +0000
commit42ce080c2569a98d38dd431c5a2d83970a61834d (patch)
tree06ae266819de4fe468099567c754b8bb64224169
parentdaffa3118e5481abf39785dbb3e9db2c6ed2de73 (diff)
downloadelgg-42ce080c2569a98d38dd431c5a2d83970a61834d.tar.gz
elgg-42ce080c2569a98d38dd431c5a2d83970a61834d.tar.bz2
Refs #2283 using entity_row_to_elggstar() when loading user from username or code so that ElggUser can be subclassed
git-svn-id: http://code.elgg.org/elgg/trunk@7713 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/users.php20
1 files changed, 9 insertions, 11 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index d95f32475..c9ac6603e 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -680,13 +680,12 @@ function get_user_by_username($username) {
join {$CONFIG->dbprefix}entities e on e.guid=u.guid
where u.username='$username' and $access ";
- $row = get_data_row($query);
- if ($row) {
- $USERNAME_TO_GUID_MAP_CACHE[$username] = $row->guid;
- return new ElggUser($row);
+ $entity = get_data_row($query, 'entity_row_to_elggstar');
+ if ($entity) {
+ $USERNAME_TO_GUID_MAP_CACHE[$username] = $entity->guid;
}
- return false;
+ return $entity;
}
/**
@@ -714,17 +713,16 @@ function get_user_by_code($code) {
join {$CONFIG->dbprefix}entities e on e.guid=u.guid
where u.code='$code' and $access";
- $row = get_data_row($query);
- if ($row) {
- $CODE_TO_GUID_MAP_CACHE[$code] = $row->guid;
- return new ElggUser($row);
+ $entity = get_data_row($query, 'entity_row_to_elggstar');
+ if ($entity) {
+ $CODE_TO_GUID_MAP_CACHE[$code] = $entity->guid;
}
- return false;
+ return $entity;
}
/**
- * Get an array of users from their
+ * Get an array of users from their email addresses
*
* @param string $email Email address.
*