]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2283 using entity_row_to_elggstar() when loading user from username or code...
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 23 Dec 2010 21:51:52 +0000 (21:51 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 23 Dec 2010 21:51:52 +0000 (21:51 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7713 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/users.php

index d95f32475bd8fbae12d1ecf592c519d813acd38f..c9ac6603ed0ce8279912c9f1186aef01be234b5b 100644 (file)
@@ -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.
  *