From 42ce080c2569a98d38dd431c5a2d83970a61834d Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 23 Dec 2010 21:51:52 +0000 Subject: 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 --- engine/lib/users.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'engine/lib') 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. * -- cgit v1.2.3