diff options
author | Nils Adermann <naderman@naderman.de> | 2010-05-14 02:28:59 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2010-05-14 02:28:59 +0200 |
commit | 928fbb012644936de167a465732c041b23a1b615 (patch) | |
tree | a3af3b8415572f697687494dae1b96d805d719a3 | |
parent | c7e8e7e0bc6551421c2dce5674816c0e7186037d (diff) | |
parent | cb642cff1175a4c381e4dd9e5348e44cc7e33f9d (diff) | |
download | forums-928fbb012644936de167a465732c041b23a1b615.tar forums-928fbb012644936de167a465732c041b23a1b615.tar.gz forums-928fbb012644936de167a465732c041b23a1b615.tar.bz2 forums-928fbb012644936de167a465732c041b23a1b615.tar.xz forums-928fbb012644936de167a465732c041b23a1b615.zip |
Merge branch 'ticket/bantu/9526' into develop-olympus
* ticket/bantu/9526:
[ticket/9526] If an admin changes a user's 'user_allow_viewonline' flag to 'hide me' the admin usually wants that user to be hidden immediately. We therefore have to update his session if one exists.
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 4905840e02..cc196a5869 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1550,6 +1550,31 @@ class acp_users WHERE user_id = $user_id"; $db->sql_query($sql); + // Check if user has an active session + if ($user_row['session_id']) + { + // We'll update the session if user_allow_viewonline has changed and the user is a bot + // Or if it's a regular user and the admin set it to hide the session + if ($user_row['user_allow_viewonline'] != $sql_ary['user_allow_viewonline'] && $user_row['user_type'] == USER_IGNORE + || $user_row['user_allow_viewonline'] && !$sql_ary['user_allow_viewonline']) + { + // We also need to check if the user has the permission to cloak. + $user_auth = new auth(); + $user_auth->acl($user_row); + + $session_sql_ary = array( + 'session_viewonline' => ($user_auth->acl_get('u_hideonline')) ? $sql_ary['user_allow_viewonline'] : true, + ); + + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $session_sql_ary) . " + WHERE session_user_id = $user_id"; + $db->sql_query($sql); + + unset($user_auth); + } + } + trigger_error($user->lang['USER_PREFS_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); } |