mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-09 02:06:32 +02:00
Changing the behaviour of the hideonline permission.
Test the current setting before altering the memory limit during install(Bug #12195) And another language var. git-svn-id: file:///svn/phpbb/trunk@7755 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -2130,24 +2130,6 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||
// append/replace SID (may change during the session for AOL users)
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
||||
// Make sure the user is able to hide his session
|
||||
if (!$viewonline)
|
||||
{
|
||||
$check_auth = new auth();
|
||||
$check_auth->acl($user->data);
|
||||
|
||||
// Reset online status if not allowed to hide the session...
|
||||
if (!$check_auth->acl_get('u_hideonline'))
|
||||
{
|
||||
$sql = 'UPDATE ' . SESSIONS_TABLE . '
|
||||
SET session_viewonline = 1
|
||||
WHERE session_user_id = ' . $user->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
unset($check_auth);
|
||||
}
|
||||
|
||||
// Special case... the user is effectively banned, but we allow founders to login
|
||||
if (defined('IN_CHECK_BAN') && $result['user_row']['user_type'] != USER_FOUNDER)
|
||||
{
|
||||
@@ -3959,7 +3941,7 @@ function page_header($page_title = '', $display_online_list = true)
|
||||
$user_colour = '';
|
||||
}
|
||||
|
||||
if ($row['user_allow_viewonline'] && $row['session_viewonline'])
|
||||
if ($row['session_viewonline'])
|
||||
{
|
||||
$user_online_link = $row['username'];
|
||||
$logged_visible_online++;
|
||||
@@ -3970,7 +3952,7 @@ function page_header($page_title = '', $display_online_list = true)
|
||||
$logged_hidden_online++;
|
||||
}
|
||||
|
||||
if (($row['user_allow_viewonline'] && $row['session_viewonline']) || $auth->acl_get('u_viewonline'))
|
||||
if (($row['session_viewonline']) || $auth->acl_get('u_viewonline'))
|
||||
{
|
||||
if ($row['user_type'] <> USER_IGNORE)
|
||||
{
|
||||
|
@@ -1506,6 +1506,33 @@ class user extends session
|
||||
trigger_error('BOARD_UNAVAILABLE');
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure the user is able to hide his session
|
||||
if (!$this->data['session_viewonline'])
|
||||
{
|
||||
// Reset online status if not allowed to hide the session...
|
||||
if (!$auth->acl_get('u_hideonline'))
|
||||
{
|
||||
$sql = 'UPDATE ' . SESSIONS_TABLE . '
|
||||
SET session_viewonline = 1
|
||||
WHERE session_user_id = ' . $this->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
$this->data['session_viewonline'] = 1;
|
||||
}
|
||||
}
|
||||
elseif (!$this->data['user_allow_viewonline'])
|
||||
{
|
||||
// the user wants to hide and is allowed to -> cloaking device on.
|
||||
if ($auth->acl_get('u_hideonline'))
|
||||
{
|
||||
$sql = 'UPDATE ' . SESSIONS_TABLE . '
|
||||
SET session_viewonline = 0
|
||||
WHERE session_user_id = ' . $this->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
$this->data['session_viewonline'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Does the user need to change their password? If so, redirect to the
|
||||
// ucp profile reg_details page ... of course do not redirect if we're already in the ucp
|
||||
|
@@ -406,7 +406,7 @@ function get_user_information($user_id, $user_row)
|
||||
$update_time = $config['load_online_time'] * 60;
|
||||
if ($row)
|
||||
{
|
||||
$user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'] && $user_row['user_allow_viewonline'])) ? true : false;
|
||||
$user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'])) ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user