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


    1) I just want to make myself 1 user, of 1 Myusergroup. So I make the name and password myself, not the user.

    2) the only thing that happens after that user has logged in, is that a TV "price" is visible:

    if ($modx->user->isMember('Myusergroup')) {
    return $price->get('value');
    }
    return '';




    3) That's it ! So I don't need registration pages, or the Modx cms logo above. Only a logged in user, with no extra rights.

    I Just can't figure out how to create such a logged-in-user (with role, ...).

    If I make such a simple usergroup, after I login, nothing happens, the loginscreens stays ! :s


    I just followed Bob's guide to make a logged in user, but I just don't get it for the latest modx version. It's so confusing and complex for me ... sad
    http://bobsguides.com/blog.html/2013/05/22/protecting-pages-the-easy-way/

    Greetz,
    Ananda [ed. note: sriananda last edited this post 9 years, 10 months ago.]
      • 3749
      • 24,544 Posts
      You probably need a Context Access ACL entry for the user group for the 'web' context. I think the Load, List, and View Policy should work for what you want.
        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
        • 47717
        • 144 Posts
        Quote from: BobRay at Nov 10, 2016, 11:45 PM
        You probably need a Context Access ACL entry for the user group for the 'web' context. I think the Load, List, and View Policy should work for what you want.

        Thanks for the Reply, Bob !

        But it doesn't work sad
        After I login, nothing happens, I only see the same Modx login form again as if nothing happened.
        I don't get an error, as the name and password were correct.
        I want after login, that the website is visible, with context "loggedinnuser", so I can use that context in the PHP-code you provided in your Bob's guide. smiley
        So after login, nothing of the Modx backend is visible, only "loggedinuser" context is set to "yes".

        1) "loggedinuser" has group : "loggedinGroup" and role "loggedinRole"

        2) "loggedinRole" : autority 10 with "load, list and view" permissions

        regards,
          • 3749
          • 24,544 Posts
          Another user solved the same problem by doing an upgrade install of MODX.

          That problem can also be caused by an issue with sessions or by the URL changing from www. to non-www or vice versa. Be sure one (but not both) of the code sections in .htaccess that force www or non-www URLs are uncommented.
            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
            • 47717
            • 144 Posts
            Quote from: BobRay at Nov 10, 2016, 11:45 PM
            You probably need a Context Access ACL entry for the user group for the 'web' context. I think the Load, List, and View Policy should work for what you want.

            An upgrade install won't be possible, as I have the latest modx install.

            I did what you suggested about "force www url", but the same problem persists.
              • 3749
              • 24,544 Posts
              You can install the UpgradeMODX extra and change the settings_version System Setting back to 2.5.1. UpgradeMODX will then let you "upgrade" to your current version. It will download all new MODX files for you, put them in place, and then launch Setup.
                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
                • 47717
                • 144 Posts
                Quote from: BobRay at Nov 15, 2016, 11:04 PM
                You can install the UpgradeMODX extra and change the settings_version System Setting back to 2.5.1. UpgradeMODX will then let you "upgrade" to your current version. It will download all new MODX files for you, put them in place, and then launch Setup.

                Hi,

                As it seems to much of a hassle, I gave up on making that "load, list & view" user.
                I did everything you prescribed, but I couldn't get past the login screen.
                I'm a fan as I bought your book, but the "special users" is quite complicated and lots of strain to make it work.
                Is there a plugin that makes this more straightforward, so with a dozen pre-configured users and simpler to set up ?



                ps: I solved the problem this way:

                1) FormIt : if password = correct ==> redirect FormIt to same URL WITH PARAMETER:
                [[*id]]?p=[[#10.tv.password]]


                2) the "hidden field" : if URL PARAMETER is correct => show price

                3) Now if that URL token matches the correct password entered in resource_10 => then javascript will be fired to attach that URL parameter to all links (except those with class "noparam")
                (javascript has the dynamic [[#10.tv.password]]-validator in it, and is not visible in the source code, unless the password is correct)

                [[!If?  
                &subject=`[[!getUrlParam? &name=`p`]]` 
                &operator=`EQ`  
                &operand=`[[#114.introtext]]`   
                &then=
                `
                
                <script type="text/javascript">
                $(document).ready(function(){
                    
                 if (window.location.href.indexOf("?p=[[#114.introtext]]") > -1) {
                
                		$("a:not(.noparam)").each(function() {
                		   var $this = $(this);       
                		   var _href = $this.attr("href"); 
                		   $this.attr("href", _href + '?p=[[#114.introtext]]');
                		});
                
                
                }
                
                  
                });
                </script>
                  • 3749
                  • 24,544 Posts
                  I'm glad you found a workaround. Sorry the original method didn't work for you.

                  I don't know of an extra for that, but it's a good idea.
                    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