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

open
nobody
None
5
2004-05-17
2003-10-08
No

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?

Discussion

  • Philippe Cloutier

    Logged In: YES
    user_id=738765

    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
    user_id=134705

    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.

    Jan

     
  • Gary Cunningham-Lee

    Logged In: YES
    user_id=524646

    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

    http://phinixi.com

     
  • Jan Hendrik Mangold

    Logged In: YES
    user_id=134705

    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.

    <code>
    $ret[] = "Anonymous";
    return $ret;
    </code>

    Just add a condition to that line, like

    <code>
    if(empty($userid)) $ret[] = "Anonymous";
    return $ret;
    </code>

    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.

    Jan

     
  • 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