We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5752
    • 10 Posts
    Hi,

    This question might be answered before, but I couldn’t find a solution here.

    It’s said that the current user should be set to (Anonymous) with ID 0 if no users
    are signed in via frontend. In some way, when no users are signed in, either in frontend
    or manager view, the current user is always my admin account. Is this the way it should be?

    Just installed a new 2.0.8 and executed the following:
    $modx->user->get('username'); // returns the admin account name instead of (Anonymous)
    


    Someone who have any input on this one?

      • 22303 MODX Staff
      • 10,725 Posts
      As long as you are logged into the manager and use the same browser to view the front-end, it inherits the manager user info/permissions. This is so you can view unpublished documents, see the site when it is offline, etc. You can use a different browser (or incognito window in Chrome) to view the front-end without this behavior.
        • 3749
        • 24,544 Posts
        Quote from: OpenGeek at Mar 10, 2011, 02:00 PM

        As long as you are logged into the manager and use the same browser to view the front-end, it inherits the manager user info/permissions. This is so you can view unpublished documents, see the site when it is offline, etc. You can use a different browser (or incognito window in Chrome) to view the front-end without this behavior.

        BTW, I noticed in FF that you can’t do a "View Source" on unpublished docs in the front end even though you can see them -- you get the source of the error page. I’m not sure about other browsers.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: BobRay at Mar 10, 2011, 05:53 PM

          BTW, I noticed in FF that you can’t do a "View Source" on unpublished docs in the front end even though you can see them -- you get the source of the error page. I’m not sure about other browsers.
          I can’t reproduce this on my system with Firefox on any version of MODX Revo. huh
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            I’ve had the same thing for some time now on all sites, not with Revo. It started with one of the FF updates, maybe four or five updates past. I think it’s a FF setting, but I haven’t paid that much attention to it. It’s annoying when I want to view the source of one of Evo’s Manager frames, since I just get the source of the Manager login page, but I’ve gotten into the habit of using Firebug to view page source anyway, so it hasn’t bothered me enough to find out what’s going on. It looks as if the view source feature is actually requesting a fresh version of the page, rather than just displaying the source of the page already in the browser. Or it might even be the action of some plugin or another; I’ve had a bunch of the development plugins installed at one time or another.

            This got me motivated to do some quick Google research, and looky what I found!

            http://stackoverflow.com/questions/611617/can-firefoxs-view-source-be-set-to-not-make-a-new-get-request

            It turned out that something was indeed messed up with my Firefox -- caching was disabled, so there was no cache to read from! Specifically, the following preferences in about:config had been set to false: browser.cache.disk.enable and browser.cache.memory.enable. Once I set them back to true (which is of course the default), then I was able to verify with HTTPFox that the view-source requests were reading from the cache instead of making a new request.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 22303 MODX Staff
              • 10,725 Posts
              Must be an FF problem with recent betas or something. Working as expected in 3.6.13 on OS X.
                • 3749
                • 24,544 Posts
                Nice catch, Sottwell. I turned off the cache in FF a long time ago so I could be sure I wasn’t looking at cached pages during development. I’m sure that’s it.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Yeah, now I vaguely remember thinking that turning off the cache would be a good idea for some reason or another; can’t remember why though.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org