News:

Wondering if this will always be free?  See why free is better.

Main Menu

guest as local moderators

Started by Suki, February 17, 2011, 11:28:31 AM

Previous topic - Next topic

Suki

Hi, I recently upgrade a forum I help admin to RC5  but since yesterday guest have permissions for local moderator,   I made a quick print_r  in $user_info  and this is what it shows for guest:

Array
(
    [groups] => Array
        (
            [0] => -1
            [1] => 3
        )

    [possibly_robot] => 0
    [id] => 0
    [username] =>
    [name] =>
    [email] =>
    [passwd] =>
    [language] => spanish_latin-utf8
    [is_guest] => 1
    [is_admin] =>
    [theme] => 0
    [last_login] => 0
    [ip] => 000.000.00.00
    [ip2] => 000.000.00.00
    [posts] => 0
    [time_format] => %B %d, %Y, %I:%M:%S %p
    [time_offset] => 0
    [karma_good] => 0
    [karma_bad] => 0
    [avatar] => Array
        (
            [url] =>
            [filename] =>
            [custom_dir] =>
            [id_attach] => 0
        )

    [smiley_set] => nuevo
    [messages] => 0
    [unread_messages] => 0
    [aeva_unseen] => 0
    [total_time_logged_in] => 0
    [buddies] => Array
        (
        )

    [ignoreboards] => Array
        (
        )

    [ignoreusers] => Array
        (
        )

    [warning] => 0
    [permissions] => Array
        (
            [0] => aeva_access
            [1] => profile_view_own
            [2] => search_posts
            [3] => poll_view
            [4] => spoiler_show
            [5] => delete_any
            [6] => delete_own
            [7] => lock_any
            [8] => lock_own
            [9] => make_sticky
            [10] => mark_any_notify
            [11] => mark_notify
            [12] => merge_any
            [13] => moderate_board
            [14] => modify_any
            [15] => modify_own
            [16] => move_any
            [17] => poll_add_own
            [18] => poll_post
            [19] => poll_remove_any
            [20] => poll_view
            [21] => poll_vote
            [22] => post_new
            [23] => post_reply_any
            [24] => post_reply_own
            [25] => remove_any
            [26] => report_any
            [27] => send_topic
            [28] => split_any
            [29] => spoiler_post
            [30] => spoiler_show
        )

    [query_see_board] => (FIND_IN_SET(-1, b.member_groups) != 0)
    [query_wanna_see_board] => (FIND_IN_SET(-1, b.member_groups) != 0)
    [is_mod] => 1
    [mod_cache] => Array
        (
            [time] => 1297957278
            [id] => 0
            [gq] => 0=1
            [bq] => 0=1
            [ap] => Array
                (
                )

            [mb] => Array
                (
                )

            [mq] => 0=1
        )

)




as you can see, in the groups array it shows 3 as secondary group   and the is_guest  and the is_mod value both a 1.   and the guest ahve all those permisisons, including delete entire topics,  for safety, I change the local moderators permissions  so they cannot delete topics,  but it appears to have no effect you can test it here:  http://oharascans.com/foro/index.php?topic=2585.0  or in any other topic



the mods are the exact mods we had in RC3:


Signature Area BBCode Buttons   2.0.1   
Aeva 2.10
Topic Solved   1.1                             
Share This Topic   2.7                             
Welcome Topic Mod   2.1       
RSS Feeder   1.1.4                             
Birthday Posts   0.12.1 Beta           
Topic View Log   1.2                           
Default_Membergroup   1.0.1                 
Simple Twitter   1.0                             
Internal_Links_Use_Same_Window   1.2     
Simple Spoiler   1.0.1


can you give me a hand to figure it out where the info for guest is build?   perhaps is there when the local moderator group is assigned.



I must add, this behavior appear to be random,  sometimes  guest have the secondary gruop and sometimes doesn't
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Suki

ok, I change the permissions on the local moderator for safety,   still, guest do have  the local moderator group as secondary group and I cannot find or locate the issue, I didn't even know guest can have a secondary group.


I have modified the if statement  on the print_r  function  in the topic I linked to only be visible if you are a  local moderator, if you browse the site as guest you will see the print_r info, this behavior seems to be random, sometimes guest are showed as guest only and sometimes are showed with the secondary group.  only guest have this issue, I tested it with all membergroups I have and only guest are affected.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Suki

ok, does anybody has a clue about why is this happening?

I take away the print_r   and the permissions for local moderators are very limited and all its working fine but I will like to actually not limit my local moderators, I  have a few local moderators who cannot moderate properly because of this >.<
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Illori

can you try uninstalling your mods and see if this still happens? I cant duplicate this on my RC5 install.

Suki

thanks Illori, yes this still happens with all mods uninstalled :(   I'm trying to figure it out where guest could possibly get this secondary group,  but so far no luck, its weird because  as far as i know, guest cannot have a secondary group.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Adish - (F.L.A.M.E.R)

Export your smf_membergroups and attach it here?

Check if you have permissions to move/remove or similar permissions as local mod set for post based groups?

Suki

hi (F.L.A.M.E.R) heres my membergroups table  and no, no post count group has any moderator permissions, they all have the standard   and theres no errors on error log
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Adish - (F.L.A.M.E.R)

Habitante de ohara - These are Newbies/Guests right?

Suki

yes, however that group doesn't have any moderator permissions  , I have readded the print_r function on $user_info so you can see the array for guests

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Matthew K.

I modified your original post for you, changing the IP addresses...so they weren't visible to the world.

[SiNaN]

It's quite interesting, indeed. Can you attach your Load.php file?
Former SMF Core Developer | My Mods | SimplePortal

Suki

thanks [SiNaN]  here´s my file :)
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

[SiNaN]

It seems to be because of member color link mod. This is the code:

if (!empty($row['id_moderator']))
//Online Color if needed for a Moderator :D, to many ways possible <<
if(!empty($modSettings['MemberColorModeratorLinks']))
$onlineColor = load_mod_color(true);
if(!empty($onlineColor))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_moderator'] . '" title="' . $txt['board_moderator'] . ' ' . $row['real_name'] . '"'.(!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '><span style="color:'.$onlineColor.';">' : ' style="color:'.$onlineColor.';">') . $row['real_name'] . (!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '</span>' : '').'</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_moderator'] . '" title="' . $txt['board_moderator'] . '">' . $row['real_name'] . '</a>';
$board_info['moderators'][$row['id_moderator']] = array(
'id' => $row['id_moderator'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_moderator'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_moderator'] . '">' . $row['real_name'] . '</a>'
);


$board_info['moderators'][$row['id_moderator']] should only be added if $row['id_moderator'] is not empty. That mod adds some code between the if check and the code for adding the moderator index. But it does not add curly braces, so the code is run eventhough $row['id_moderator'] is 0. (which is the guest id)

The code should look like this:

if (!empty($row['id_moderator']))
{
//Online Color if needed for a Moderator :D, to many ways possible <<
if(!empty($modSettings['MemberColorModeratorLinks']))
$onlineColor = load_mod_color(true);
if(!empty($onlineColor))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_moderator'] . '" title="' . $txt['board_moderator'] . ' ' . $row['real_name'] . '"'.(!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '><span style="color:'.$onlineColor.';">' : ' style="color:'.$onlineColor.';">') . $row['real_name'] . (!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '</span>' : '').'</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_moderator'] . '" title="' . $txt['board_moderator'] . '">' . $row['real_name'] . '</a>';
$board_info['moderators'][$row['id_moderator']] = array(
'id' => $row['id_moderator'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_moderator'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_moderator'] . '">' . $row['real_name'] . '</a>'
);
}
Former SMF Core Developer | My Mods | SimplePortal

Suki

thank you very very much [SiNaN]!!
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Jesna

#14
Hi

I have a problem which sounds a lot like this one. My thread here http://www.simplemachines.org/community/index.php?topic=427265.0

I dont have the color link mod but I have mclegend2 (which give colors to membergroups). Do you know if it could give the same problem??

Update: well its sems like my guests have the administrator options in the boards :(

Regards Jakob

aeiou15

thanks to this I served tem to solve the same problem
Visita mi Foro:


Advertisement: