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.inc18
1 files changed, 18 insertions, 0 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index f97a1312..bdec6435 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -140,6 +140,24 @@ function new_sid() {
}
+# obtain the username if given their Users.ID
+#
+function username_from_id($id="") {
+ if (!$id) {
+ return "";
+ }
+ $dbh = db_connect();
+ $q = "SELECT Username FROM Users WHERE ID = " . mysql_escape_string($id);
+ $result = db_query($q, $dbh);
+ if (!$result) {
+ return "None";
+ }
+ $row = mysql_fetch_row($result);
+
+ return $row[0];
+}
+
+
# obtain the username if given their current SID
#
function username_from_sid($sid="") {