summaryrefslogtreecommitdiffstats
path: root/web/lib/aur.inc
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib/aur.inc')
-rw-r--r--web/lib/aur.inc19
1 files changed, 19 insertions, 0 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index ed2ff64..81e5a45 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -542,5 +542,24 @@ function rm_rf($dirname="") {
return;
}
+# obtain the uid given a Users.Username
+#
+function uid_from_username($username="")
+{
+ if (!$username) {
+ return "";
+ }
+ $dbh = db_connect();
+ $q = "SELECT ID FROM Users WHERE Username = '".mysql_escape_string($username)
+ ."'";
+ $result = db_query($q, $dbh);
+ if (!$result) {
+ return "None";
+ }
+ $row = mysql_fetch_row($result);
+
+ return $row[0];
+}
+
# vim: ts=2 sw=2 noet ft=php
?>