diff options
author | plegall <plg@piwigo.org> | 2016-02-12 17:44:27 +0100 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2016-02-12 17:44:27 +0100 |
commit | 25edfc2663a0d87e6216981c44dadb52d1f8ab72 (patch) | |
tree | 711eab9350a82a3836677d20b34cebd862686ada /include/functions_session.inc.php | |
parent | 2561928b80f4dae1d460bec2e9c268edf6a5d802 (diff) |
feature #383, dedicated function to delete sessions
Diffstat (limited to 'include/functions_session.inc.php')
-rw-r--r-- | include/functions_session.inc.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/functions_session.inc.php b/include/functions_session.inc.php index 9c12e26c1..61a6acac9 100644 --- a/include/functions_session.inc.php +++ b/include/functions_session.inc.php @@ -260,4 +260,20 @@ function pwg_unset_session_var($var) return true; } +/** + * delete all sessions for a given user (certainly deleted) + * + * @since 2.8 + * @param int $user_id + * @return null + */ +function delete_user_sessions($user_id) +{ + $query = ' +DELETE + FROM '.SESSIONS_TABLE.' + WHERE data LIKE \'pwg_uid|i:'.(int)$user_id.';%\' +;'; + pwg_query($query); +} ?> |