pulled out account functions into separate include file

This commit is contained in:
eric 2004-06-22 14:26:54 +00:00
parent 63b92980c2
commit 64db123697
7 changed files with 828 additions and 381 deletions

View file

@ -99,17 +99,6 @@ function new_sid() {
return strtoupper(md5($id));
}
# obtain the user type from its database ID
#
function user_type($id=0) {
if ($id == 3) {
return __("Developer");
} elseif ($id == 2) {
return __("Trusted user");
} else {
return __("User");
}
}
# obtain the username if given their current SID
#
@ -162,7 +151,7 @@ function account_from_sid($sid="") {
$q = "SELECT AccountType ";
$q.= "FROM Users, AccountTypes, Sessions ";
$q.= "WHERE Users.ID = Sessions.UsersID ";
$q.= "AND AccountTypes.ID = Users.AccountTypesID ";
$q.= "AND AccountTypes.ID = Users.AccountTypeID ";
$q.= "AND Sessions.SessionID = '" . mysql_escape_string($sid) . "'";
$result = db_query($q, $dbh);
if (!$result) {