#95 Groups: Even after login everybody still part of group Anony


Since I have not accessed the CVS, nor found
information or bug reports about this anywhere else, I
figured I'll report this as a bug.

I want to be able to show different content to people
who are logged in (Anonymous) vs. registered users.
Unfortunately every user shows to be not only member of
the Registered group (which makes sense), but also
remains a member of the Anonymous group which eludes me.

The result of this is that even though logged in, you
still see things only the Anonymous group should be seeing.

Does that description make sense?


  • Philippe Cloutier

    Logged In: YES

    I guess you could find some feature requests to merge this with.
    However I don't think this will happen so soon.

  • Jan Hendrik Mangold

    Logged In: YES

    I actually found the two files where the user is being
    associated with its groups and changed one line of code that
    fixes this problem.

    If other people or the developers are interested I will post
    the name of the files and the change I made.


  • Gary Cunningham-Lee

    Logged In: YES

    Yes, would you post the information? I also think the design is
    illogical for some Tiki sites. For one site I work on, there is no
    need to bother registered users with content designed for
    anonymous visitors, so I'd also like to make registered users no
    longer anonymous.

    -- Gary


  • Jan Hendrik Mangold

    Logged In: YES

    OK, here it goes (I will not provide patch files, rather
    explanations what and where modifications are needed).

    there is one function which appeares in two different places
    that needs to be patched. The function is fittingly called

    -- get_user_groups

    and it appears in

    -- ./lib/tikilib.php
    -- ./lib/userslib.php

    I don't know why there are two definitions of the same
    function and who calls which when, so I just patch both.

    If you look at the function body (in lib/tikilib.php), you
    will see that before the $ret array with all found user
    groups is returned, "Anonymous" is pushed into the array, no
    matter what.

    $ret[] = "Anonymous";
    return $ret;

    Just add a condition to that line, like

    if(empty($userid)) $ret[] = "Anonymous";
    return $ret;

    this way the group Anonymous is only assigned to empty
    $userid, which sounds pretty anonymous to me ... :)

    The same goes for lib/userlib.php

    Hope that helps.


  • Philippe Cloutier

    • labels: 544454 -->
    • milestone: 337038 -->

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks