We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18373 ☆ A M B ☆
    • 3,141 Posts
    Hey,

    I’m not sure if anybody has got Login to work yet... I know I haven’t.

    I have a page called "New uploads" (id 11) which I only want to have visible for people that are logged in. If they’re not logged in, common sense should lead them to the "Not authorized" page which features a login form (With return to referrer turned on).

    So far, I’ve set up my user groups/security thingies as follows:

    Resource group: "Members only" (made using Create Resource group)

    Access Controls -> User group: "Webusers" (made using "New User Group")
    - Context access: context: "web" / Minimum role "Member - 15" / Access policy: "Member policy"
    - Resource group: "Members only" / Minimum role "Member - 15" / Access Policy: "Member Policy" / Context: web
    - Element Category Access: none

    Access Controls -> Roles
    - "Administrator" / ID 2 / Authority 0
    - "Member" / ID 3 / Authority 15
    - "Read only" / ID 1 / Authority 1

    Access Controls -> Access Policies
    - Member Policy / ID 5 / Permissions: none (what to do here?)
    (amongst 4 others)

    The resource is publicly viewable when on the "Access Permissions" tab nothing is selected (the only option is "Members only").

    When I tick it and try to access the page, I’m being referred to the 404 page instead of the 403 (not authorized) page. When I login using a basic [[!Login]] snippet, it makes no difference.


    I did check the access for the account I used, and that seemed to be alright.

    Altho I’m going to do some more checks now - if there’s any help or pointers feel free to let me know lipsrsealed

      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
      • 22303 MODX Staff
      • 10,725 Posts
      If you are getting a 404, the access controls are most likely the issue. This indicates that the user cannot even load the requested data (i.e. it is completely invisible). You will need to create an anonymous access control entry that provides the "load" permission.
        • 18373 ☆ A M B ☆
        • 3,141 Posts
        There was an (anonymous) with load permissions, but I’m still getting the 404.

        Could you do me a huge favour and check out in the manager what is happening? When I get the hang of it (by seeing what you did) I’ll try to make a tutorial for in the docs.. but at this point I have no clue what to do.

        Revo’s so flexible, I don’t know where to start.
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
          • 22303 MODX Staff
          • 10,725 Posts
          There’s really no way for me to know what you’ve got setup without more details, or what other possible issues might be occurring. My suggestion would be to read through the permissions guide that BobRay has written and come back with specific questions.

          Or keep changing and experimenting with the permissions (making sure to clear caches and flush sessions anytime you make changes to it).
            • 26503
            • 620 Posts
            I think I may have a similar problem - I got login installed and the user pages / groups / resources set up, but the protected resources don’t show up....

            Problem is that I can’t tell if the user has actually logged in! The login form just seems to refresh the page, no messages no errors no nothing.

            any thoughts on how I could ’prove’ that the user is logged in?

            -thanks
            -sean
              *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

              Sean Kimball CLP, CLS.
              Technical Director / Sr. Developer | BigBlock Studios
              ._______________________________________________.
              Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
              27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
              phone/fax: 905-426-5525
              • 26903
              • 1,336 Posts
              There is an ’active_users’ table in the database but I’m not sure if this is for manager users only.
                Use MODx, or the cat gets it!
                • 28215
                • 4,149 Posts
                Quote from: sean69 at Jul 14, 2010, 08:18 PM

                any thoughts on how I could ’prove’ that the user is logged in?

                Either in a Snippet:

                if ($modx->user->hasSessionContext($modx->context->get('key')) {
                  /* logged in */
                }
                


                or in tag format:

                [[+modx.user.id:notempty=`logged in so do stuff here`]]
                
                  shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                  • 3749
                  • 24,544 Posts
                  Quote from: sean69 at Jul 14, 2010, 08:18 PM

                  I think I may have a similar problem - I got login installed and the user pages / groups / resources set up, but the protected resources don’t show up....

                  Problem is that I can’t tell if the user has actually logged in! The login form just seems to refresh the page, no messages no errors no nothing.

                  any thoughts on how I could ’prove’ that the user is logged in?

                  -thanks
                  -sean

                  [[!Login? &loginResourceId=`2`]]


                  If the login is successful, this will redirect the user to the page with an ID of 2 (or whatever).
                    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
                    • 26503
                    • 620 Posts
                    The login was just magically working this morning..... huh? I didn’t touch a darn thing!
                    I have cache completely disabled for development... don’t get it.

                    though the member pages are still not working [protected page links do not appear in menu/ get a 404 when requesting the resource directly]

                    I’ll have to review the resource groups & tutorials again [though I’ve been over it 3 times now!]

                    -thanks for the suggestions...
                    -sean
                      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

                      Sean Kimball CLP, CLS.
                      Technical Director / Sr. Developer | BigBlock Studios
                      ._______________________________________________.
                      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
                      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
                      phone/fax: 905-426-5525
                      • 18373 ☆ A M B ☆
                      • 3,141 Posts
                      I’ve started writing a tutorial... can be found here: http://svn.modxcms.com/docs/display/revolution/(Tutorial)+Making+member-only+pages

                      Check if you did everything.

                      Open another browser to check (another browser, not just another browser window or tab).

                      By default, if you don’t give anonymous users permissions to "load" the resource they will get a 404 error. There’s a section in Bobs’ guides about that.
                        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.