summaryrefslogtreecommitdiff
path: root/web/lib/aur.inc
diff options
context:
space:
mode:
authoreric <eric>2004-06-26 13:21:04 +0000
committereric <eric>2004-06-26 13:21:04 +0000
commitdc3b13064cdb59dd12b200e7f8c73fd63126dea6 (patch)
treef203062484b4f1b78d76ffef607526ad22399f13 /web/lib/aur.inc
parent5cbbf11c8bf72a1b80dc72e27d5737c7d79a5903 (diff)
mypkgs works, but need an 'action' table
Diffstat (limited to 'web/lib/aur.inc')
-rw-r--r--web/lib/aur.inc20
1 files changed, 20 insertions, 0 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index f59e63a..9407a40 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -202,6 +202,26 @@ function account_from_sid($sid="") {
return $row[0];
}
+# obtain the Users.ID if given their current SID
+#
+function uid_from_sid($sid="") {
+ if (!$sid) {
+ return "";
+ }
+ $dbh = db_connect();
+ $q = "SELECT Users.ID ";
+ $q.= "FROM Users, Sessions ";
+ $q.= "WHERE Users.ID = Sessions.UsersID ";
+ $q.= "AND Sessions.SessionID = '" . mysql_escape_string($sid) . "'";
+ $result = db_query($q, $dbh);
+ if (!$result) {
+ return 0;
+ }
+ $row = mysql_fetch_row($result);
+
+ return $row[0];
+}
+
# connect to the database
#
function db_connect() {