diff options
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/acctfuncs.inc.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index 7a18f76..ecb9f99 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -681,10 +681,25 @@ function user_is_privileged($id, $dbh) { } +# Remove session on logout +function delete_session_id($sid, $dbh=NULL) { + if(!$dbh) { + $dbh = db_connect(); + } + + $q = "DELETE FROM Sessions WHERE SessionID = '"; + $q.= db_escape_string($sid) . "'"; + db_query($q, $dbh); +} + # Clear out old expired sessions. -function clear_expired_sessions( $dbh ) { +function clear_expired_sessions($dbh=NULL) { global $LOGIN_TIMEOUT; + if(!$dbh) { + $dbh = db_connect(); + } + $q = "DELETE FROM Sessions WHERE LastUpdateTS < (UNIX_TIMESTAMP() - $LOGIN_TIMEOUT)"; db_query($q, $dbh); |