summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/lib/aur.inc21
1 files changed, 20 insertions, 1 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index 517abe3..f940192 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -400,7 +400,26 @@ function uid_from_username($username="")
return "None";
}
$row = mysql_fetch_row($result);
-
+
+ return $row[0];
+}
+
+# obtain the uid given a Users.Email
+#
+function uid_from_email($email="")
+{
+ if (!$email) {
+ return "";
+ }
+ $dbh = db_connect();
+ $q = "SELECT ID FROM Users WHERE Email = '".mysql_real_escape_string($email)
+ ."'";
+ $result = db_query($q, $dbh);
+ if (!$result) {
+ return "None";
+ }
+ $row = mysql_fetch_row($result);
+
return $row[0];
}