$mailer->send();
}
+function kill_sessions()
+{
+ assert(S::has_perms());
+ shell_exec('sudo -u root ' . dirname(dirname(__FILE__)) . '/bin/kill_sessions.sh');
+}
+
/******************************************************************************
* Dynamic configuration update/edition stuff
promo = $promo,
comment = '".addslashes($comm)."'
WHERE user_id = '{$mr['user_id']}'";
+ if ($perms == 'disabled' && $old_fields['perms'] != 'disabled') {
+ // A user has been banned ==> ensure his php session has been killed
+ // This solution is ugly and overkill, but, it should be efficient.
+ kill_sessions();
+ }
if (XDB::execute($query)) {
user_reindex($mr['user_id']);
'login' => $this->make_hook('login', AUTH_COOKIE),
'send_bug' => $this->make_hook('bug', AUTH_COOKIE),
'purge_cache' => $this->make_hook('purge_cache', AUTH_COOKIE, 'admin'),
+ 'kill_sessions' => $this->make_hook('kill_sessions', AUTH_COOKIE, 'admin'),
'get_rights' => $this->make_hook('get_rights', AUTH_MDP, 'admin'),
'wiki_help' => $this->make_hook('wiki_help', AUTH_PUBLIC),
http_redirect(empty($_SERVER['HTTP_REFERER']) ? './' : $_SERVER['HTTP_REFERER']);
}
+ function handler_kill_sessions(&$page)
+ {
+ kill_sessions();
+ }
+
function handler_get_rights(&$page, $level)
{
if (S::has('suid')) {