Page 1 of 1

[BUG] Hidden Members Visible in "Who is Online"

PostPosted: Sat May 20, 2006 4:02 am
Author: Dr. Bantham
I have discovered that the problem with hidden members being visible to all within the "Who is Online" block only occurs when the member has set "Show me online" to "Only friends". The function appears to work correctly when set to "No". I believe that all functions work correctly when viewing the online list by clicking on "View complete list" (viewonline.php).

I tested this out on my site and here at IM2 by changing the settings for my account and viewing the results through another browser platform which viewed the site from a non-member perspective. It plainly showed me as online within the "Who is Online" block when I set "Show me online" to "Only friends" for my account at PCP-->Profile-->Profile Settings-->Privacy.

[strike]As a side note, and quite possibly a different problem altogether, my installation of IM 1.4 only shows the above setting option under the Privacy section of PCP. I noticed the following additional variables here at IM2:
  • Always show my e-mail address
  • Accept private message
  • Display my web information
  • Display my messengers references
  • Display my personal information
Is this normal, or do I have a problem with my installation?[/strike]

After viewing my settings in ACP, I realised that I had set the above variables as constants by setting "Override user choices" to "Yes" for these options.

Re: [BUG] Hidden Members Visible in "Who is Online"

PostPosted: Sat Jun 24, 2006 7:09 am
Author: Dr. Bantham
Is this problem unique to me? It appeared not to be the case, since I tested with the same results here at IM2. Not that the edit above was only nullifying the side issue, not the main problem.

PostPosted: Tue Jun 27, 2006 3:40 am
Author: computerskillz
Let me take a look at the code for you Dr. Bantham. Which block are you using? There are two... online_users and online_users2

Check the block file under block edit and let me know, so I can look at the right code for you.

Re: [BUG] Hidden Members Visible in "Who is Online"

PostPosted: Tue Jun 27, 2006 3:50 am
Author: Dr. Bantham
Mine is set up to use online_users:
Code: Select all
<php>get('jadmin', 200000, 'jadmin');         }         if($jadmin_ary === FALSE)         {             $sql = "SELECT user_id FROM " . JR_ADMIN_TABLE . "                     WHERE user_jr_admin <if>sql_query($sql) )             {                 message_die(GENERAL_ERROR, 'Could not obtain junior admin status', '', __LINE__, __FILE__, $sql);             }               while( $row = $db->sql_fetchrow($result) )             {                 $jadmin_ary[] = $row['user_id'];             }             if($db->sql_fetchrow($result) == 0)             {                 $jadmin_ary[] = -10;             }             if($portal_config['cache_enabled'])             {                 $var_cache->save($jadmin_ary, 'jadmin', 'jadmin');             }         }           $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip             FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s             WHERE u.user_id = s.session_user_id                 AND s.session_time >= ".( time() - 300 ) . "             ORDER BY u.username ASC, s.session_ip ASC";         if( !($result = $db->sql_query($sql)) )         {             message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);         }           $userlist_ary = array();         $userlist_visible = array();           $prev_user_id = 0;         $prev_user_ip = '';           while( $row = $db->sql_fetchrow($result) )         {             // User is logged in and therefor not a guest             if ( $row['session_logged_in'] )             {                 // Skip multiple sessions for one user                 if ( $row['user_id'] != $prev_user_id )                 {                     $style_color = '';                     if ( ($row['user_level'] == ADMIN) && ($row['user_id'] == 2) )                     {                         $row['username'] = '<b>' . $row['username'] . '</b>';                         $style_color = 'foundercolor';                     }                     else if ($row['user_level'] == ADMIN)                     {                         $row['username'] = '<b>' . $row['username'] . '</b>';                         $style_color = 'admincolor';                     }                     else if (is_array($jadmin_ary))                     {                         if (in_array($row['user_id'], $jadmin_ary))                         {                             $row['username'] = '<b>' . $row['username'] . '</b>';                             $style_color = 'jadmincolor';                         }                         else if ($row['user_level'] == MOD)                         {                             $row['username'] = '<b>' . $row['username'] . '</b>';                             $style_color = 'modcolor';                         }else{                             $row['username'] = '<b>' . $row['username'] . '</b>';                             $style_color = 'usercolor';                         }                     }                     else if ($row['user_level'] == MOD)                     {                         $row['username'] = '<b>' . $row['username'] . '</b>';                         $style_color = 'modcolor';                     }else{                         $row['username'] = '<b>' . $row['username'] . '</b>';                         $style_color = 'usercolor';                     }                       /*if ( $row['user_level'] == ADMIN )                     {                         $row['username'] = '<b>' . $row['username'] . '</b>';                         $style_color = 'style="color] . '"';                     }                     else if ( $row['user_level'] == MOD )                     {                         $row['username'] = '<b>' . $row['username'] . '</b>';                         $style_color = 'style="color:#' . $theme['fontcolor2'] . '"';                     }*/                       if ( $row['user_allow_viewonline'] )                     {                         $user_online_link = '<a><span>' . $row['username'] . '</span></a>';                         $logged_visible_online++;                     }                     else                     {                         $user_online_link = '<a><span><i>' . $row['username'] . '</span></i></a>';                         $logged_hidden_online++;                     }                       if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )                     {                         $online_userlist .= ( $online_userlist != '' ) ? '<br>' . $user_online_link : $user_online_link;                     }                 }                   $prev_user_id = $row['user_id'];             }             else             {                 // Skip multiple sessions for one user                 if ( $row['session_ip'] != $prev_session_ip )                 {                     $guests_online++;                 }             }               $prev_session_ip = $row['session_ip'];         }         $db->sql_freeresult($result);         if ( empty($online_userlist) )         {             $online_userlist = $lang['None'];         }         $online_userlist = $lang['Registered_users'] . ' ' . $online_userlist;           $total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online;           if ( $total_online_users > $board_config['record_online_users'])         {             $board_config['record_online_users'] = $total_online_users;             $board_config['record_online_date'] = time();               $sql = "UPDATE " . CONFIG_TABLE . "                 SET config_value = '$total_online_users'                 WHERE config_name = 'record_online_users'";             if ( !$db->sql_query($sql) )             {                 message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql);             }               $sql = "UPDATE " . CONFIG_TABLE . "                 SET config_value = '" . $board_config['record_online_date'] . "'                 WHERE config_name = 'record_online_date'";             if ( !$db->sql_query($sql) )             {                 message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql);             }         }           if ( $total_online_users == 0 )         {             $l_t_user_s = $lang['Online_users_zero_total'];         }         else if ( $total_online_users == 1 )         {             $l_t_user_s = $lang['Online_user_total'];         }         else         {             $l_t_user_s = $lang['Online_users_total'];         }           if ( $logged_visible_online == 0 )         {             $l_r_user_s = $lang['Reg_users_zero_total'];         }         else if ( $logged_visible_online == 1 )         {             $l_r_user_s = $lang['Reg_user_total'];         }         else         {             $l_r_user_s = $lang['Reg_users_total'];         }           if ( $logged_hidden_online == 0 )         {             $l_h_user_s = $lang['Hidden_users_zero_total'];         }         else if ( $logged_hidden_online == 1 )         {             $l_h_user_s = $lang['Hidden_user_total'];         }         else         {             $l_h_user_s = $lang['Hidden_users_total'];         }           if ( $guests_online == 0 )         {             $l_g_user_s = $lang['Guest_users_zero_total'];         }         else if ( $guests_online == 1 )         {             $l_g_user_s = $lang['Guest_user_total'];         }         else         {             $l_g_user_s = $lang['Guest_users_total'];         }           $l_online_users = sprintf($l_t_user_s, $total_online_users);         $l_online_users .= sprintf($l_r_user_s, $logged_visible_online);         $l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);         $l_online_users .= sprintf($l_g_user_s, $guests_online);           if(!$userdata['session_logged_in'])         {             $chat_link = $lang['Login_to_join_chat'];         }         else         {             $chat_link = "<a>" . $lang['Click_to_join_chat'] . "</a>";         }           require_once( $phpbb_root_path . 'chatspot_front.' . $phpEx );           $template->assign_vars(array(// ******************** BEGIN phpBBChatSpot MOD ********************             'CHATSPOT_IDENTIFICATION' => $lang[ 'ChatSpot_id' ],             'TOTAL_CHATTERS_ONLINE' => sprintf( $lang[ 'How_Many_Chatters' ], $num_users_in_chat ),             'CHATTERS_LIST' => '<b>' . $users_in_chat . '</b>',             'L_CHAT_LINK' => $chat_link,// ********************  END phpBBChatSpot MOD  ********************               'B_L_VIEW' => $lang['View_complete_list'],             'B_TOTAL_USERS_ONLINE' => $l_online_users,             'B_LOGGED_IN_USER_LIST' => $online_userlist,             'B_U_VIEWONLINE' => append_sid('viewonline.'.$phpEx),             'B_RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone']))                         )         );     }}  $sql = "SELECT u.username, u.user_level, u.user_idFROM ". CONNECTIONS ." c, ". USERS_TABLE ." uWHERE u.user_id = c.useridORDER BY u.username ASC";if ( !($result = $db->sql_query($sql)) ){   message_die(GENERAL_ERROR, 'Could not get user data', '', __LINE__, __FILE__, $sql);}   $chatnums = $db->sql_numrows($result);   $user = array();   while ( $row = $db->sql_fetchrow($result) )   {     $user[] = $row;   }     for($i = 0; $i </b>assign_vars(array(         'B_FLASHCHAT' => "javascriptvoid window.open('http://www.ligotti.net/flashchat/ciadl.php','tloChat','fullscreen,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no')",         'USERNAMES' => $userlist,         'CHATCOUNT' => sprintf($l_chat_user_s, $chatnums))     );  imp_online_users_block_func();  ?>
Upon testing, it appears that the same problem is occuring here at IM2. Thanks for having a look!

Re: [BUG] Hidden Members Visible in "Who is Online"

PostPosted: Tue Jun 27, 2006 3:53 am
Author: Dr. Bantham
I don't know why, but the top part of the code is being cut from the post above.

PostPosted: Tue Jun 27, 2006 4:06 am
Author: Adrian Rea
Dr, can you post the code using the [ code ] bbcode button, not the php button as this is causing the problem.

Thanks

A

Re: [BUG] Hidden Members Visible in "Who is Online"

PostPosted: Tue Jun 27, 2006 4:35 am
Author: Dr. Bantham
Same result. The section of code is also missing when you edit.

PostPosted: Tue Jun 27, 2006 5:28 am
Author: Adrian Rea
Apologies Dr, I thought it was the php block playing up. This does not look good and I wonder if it is the phpbb update, but I am surprised.

A

Re: [BUG] Hidden Members Visible in "Who is Online"

PostPosted: Tue Jun 27, 2006 10:43 pm
Author: Teelk
Seems the 2.0.20 update has messed posting with php/HTML code. The update to 2.0.21 seems to resolve it, which leads me to believe that's why phpBB has been releasing updates so quickly.