aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/users.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r--engine/lib/users.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 24ded8ce5..7a0de2af0 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -343,6 +343,19 @@
}
/**
+ * Gets a user with a particular username, if they exist
+ *
+ * @param string $username The user's username
+ * @return ElggUser or false
+ */
+ function get_user_from_username($username) {
+ global $CONFIG;
+ $username = (int) sanitise_string($username);
+ return row_to_elgguser(get_data_row("select * from {$CONFIG->dbprefix}users where username = '{$username}'"));
+
+ }
+
+ /**
* Enter description here...
*
* @param unknown_type $criteria