ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

member_names returns me as a logged in user and no-one else.

April 20, 2011 10:58am

Subscribe [3]
  • #1 / Apr 20, 2011 10:58am

    Pigtail Dencil

    117 posts

    This question may be related to a resolved thread.

    I want to be able to see a list of currently logged in users on the site, but only if I’m logged in as a Super Admin. If I try this, I only ever see myself:

    {if group_id == '1'}
    {exp:stats}
          Logged in <strong>{member_names backspace="2"} {name}, {/member_names}</strong>{/exp:stats}    
    {/if}

    If I try it without the conditional {group_id} I also only ever see myself.

    I’ve tested this by logging into the site as different member group types, and all behave similarly. Also, {total_logged_in} only ever returns 1.

    I’ve looked for the anonymous setting as described in the post quoted above, but cannot find this anywhere.

    We’re on EE 2.1.3 build 20101220.

    Seb

  • #2 / Apr 20, 2011 3:15pm

    Sue Crocker

    26054 posts

    Hi, Seb. exp_online_users table, do they have anon set to y?

    See the two attached screen shots. The last check box for both determines if they are set to show.

  • #3 / Apr 20, 2011 4:05pm

    Pigtail Dencil

    117 posts

    Hi Sue,

    The anon row in my exp_online_users table is set to “no”. See attached.

    In the registration form provided on the site I didn’t offer the option to “show my name in the users list”. What’s the default value? Is there a way that we can simply include a hidden pre-set input value?

    And what of already registered members and / or members that have already been added to the system by an admin? Is there anyway that we can alter their default anonimity?

    ––––––––
    UPDATE, I should have specified, we’re using a Stand Alone Registration Form; a slimmer version of the one detailed in the wiki with a hard coded ACT id.

    Thanks

  • #4 / Apr 21, 2011 2:07pm

    Sue Crocker

    26054 posts

    Hi, Seb. It’s a cookie value that gets set.

    // Is user browsing anonymously?
            $anon = ( ! $this->EE->input->cookie('anon')) ? '' : 'y';

    Found in Stats.php around like 73.

    You could try to change the default value to n instead of using y…

  • #5 / Apr 21, 2011 7:56pm

    Pigtail Dencil

    117 posts

    Wow. Thanks Sue, I would never have found that.

    But it leads me onto two other questions. Firstly, I looked for the template that would generate the screen that you suggested previously in Design > Themes > Member Profile Templates > ... > Registration From. But it didn’t contain the anonymizing checkbox. Where can I find this member template?

    Secondly, I’d love to make a feature request to override this option with a simple config rule. eg:

    [anon_member_browsing] => n

    Thanks again,

    Seb

  • #6 / Apr 21, 2011 8:27pm

    Sue Crocker

    26054 posts

    I was looking at the templates from the forum and from the Agile theme. But in the login portion.

    As far as the feature request, please just fill one out in the Feature Request forum.

  • #7 / Apr 22, 2011 7:25am

    Pigtail Dencil

    117 posts

    Thanks Sue,

    Found the template now. I was looking at the Registration Form by mistake.

    However I’m still not seeing anyone besides myself, or whoever I log in as. I modified the Stats.php file, saved it, dumped my browsers’ caches, logged in and nothing.

    Then I tried adding the input field that normally manages anonimity as a hidden field.

    <input type="hidden" name="anon" value="1" />

    Again, I dumped caches, re-logged in as different users and still nothing.

    I’ve checked that template caching is off, and our user setting is set to cookie only:

    $config['user_session_type'] = "c";
    $config['cookie_domain'] = "";
    $config['cookie_path'] = "";
    $config['cookie_prefix'] = "n";

    Is there anything else that could get in the way of me seeing the logged-in member list?

  • #8 / Apr 22, 2011 6:03pm

    Sue Crocker

    26054 posts

    What I’d do to test is the following..

    Log in as one member in one browser, and as a SuperAdmin in another.

    Does the SuperAdmin see the other member?

  • #9 / Apr 23, 2011 3:02am

    Pigtail Dencil

    117 posts

    That’s just how I’ve been testing. :(

    SuperAdmin doesn’t see other members, whether they’re other SuperAdmins or any other member_group type.

  • #10 / Apr 23, 2011 1:56pm

    Greg Salt

    3988 posts

    Hi Seb,

    These members are logging in via the frontend aren’t they? I believe that the online status will only be updated if they login using a frontend form.

    Cheers

    Greg

  • #11 / Apr 24, 2011 1:58am

    Pigtail Dencil

    117 posts

    Hey Greg,

    Yep. They’re logged in via the frontend. 😊

    Happy bunnies,

    Seb

  • #12 / Apr 24, 2011 4:57pm

    Greg Salt

    3988 posts

    Hi Seb,

    Hmm, I’m afraid that I can’t replicate this problem on my local 20110411 install. Are you perhaps using a modified or standalone member login form? If so, can you test it using the default member templates login form just to rule that out as a potential difference? Also, whilst logged in as a Super Admin with another browser login as a member are you seeing additional rows generated in the exp_online_users as soon as they change from a guest to a logged-in member?

    Cheers

    Greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases