diff options
Diffstat (limited to 'web/lib/aur.inc')
-rw-r--r-- | web/lib/aur.inc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc index 517abe31..f9401927 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]; } |