We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37622
    • 9 Posts
    I was able to successfully install and implement the Login feature for modX. My issue right now has to do with the way Login works.

    Right now when I click the link to the Login page, it takes me to a Login page. When I login, I have it redirecting to some gated content. So far so good. However when I click back on the Login page link, instead of taking me back to the gated content, it takes me to the "Click here to logout" version of the login page.

    [[!Login?&loginTpl=`lgnLoginTpl`&logoutTpl=`lgnLogoutTpl`&errTpl=`lgnErrTpl`&loginResourceId=`57`&logoutResourceId=`31`]]


    So what ideally I would like to happen is when someone logs in, they can re-click on the Login Page link and continue to be redirected to the gated content.


    Is this possible? Thanks for any help. I've done a ton of searching about this issue and worked on it for a while but just getting nowhere at this point. [ed. note: ryanpederson last edited this post 14 years, 1 month ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Check this out. There's no "edit profile" page yet, but the login works as expected.

      http://c0024.paas1.tx.modxcloud.com/

      Username testing
      password testing 123
        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
        • 37622
        • 9 Posts
        Very cool Susan. Was there a guide/tutorial that helped you do that or did you just figure it out?

        I think at this point, if I could just insert some PHP into the page that says something like

        IF (user is logged in)
        THEN redirect to gated content
        ELSE display the login info
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Well, I'm in the process of documenting this, but at this point I can't get the "protected" page to actually be protected. You should NOT be seeing that "Now You See Me" page until you log in. Somehow I'm missing something obvious in setting up the security system.

          The login snippet allows you to specify a login page http://rtfm.modx.com/display/ADDON/Login.Basic+Setup
            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
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            You could try the Personalize add-on; it lets you specify a chunk to load for logged in users and another for non-logged in users.
              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
              • 37622
              • 9 Posts
              Hey Susan, I installed and implemented the Personalize add-on.

              It's actually REALLY close to doing what I want it to do. However the only downfall is that it only displays CHUNKS, which the client would have difficulty editing since it's not a WYSIWGY editor, just straight HTML. It appears ModX Revo does not allow for editing Chunks with the Rich Text Editor.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                See if the chunk could contain a TV, and have a rich-text TV for your login/logout page.
                  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
                  • 39932
                  • 483 Posts
                  Somehow I'm missing something obvious in setting up the security system.

                  There are two ways to do this:

                  Either A) Set up an ACL and Resource Group (pain in the butt). Then place the Resource in the Resource Group. And give the User Group access to the Resource Group. Security is comprehensive in Revo, but its a bear.

                  Or B) If you don't care what type of user it is, make a snippet Name it stupidSecurity. Place in this code:

                      if ($modx->user->get('id') <= 0)
                      {   $modx->sendRedirect('http.://www.google.com');
                          return '';
                      }
                  


                  Make this Snippet Call the first line of your "protected" Resource. ps: Note the extra dot in the URL. take it out before running the code.
                    Website: Extended Dialog Development Blog: on Extended Dialog
                    Add-ons: AJAX Revolution, RO.IDEs Editor & Framework (in works) Utilities: Plugin Compatibility List
                    Tutorials: Create Cross-Context Resources, Cross-Context AJAX Login, Template-Based Actions, Remove Extensions from URLs

                    Failure is just another word for saying you didn't want to try. "It can't be done" means "I don't know how".
                    • 37622
                    • 9 Posts
                    I'm not sure how to attach a TV tot he chunk. That does sound good.
                      • 39932
                      • 483 Posts
                      You cannot attach a TV to a Chunk. They are attached to Resources that share whatever Template they are defined for. You can PASS it however...

                          [[$myChunkName? &propName=`[[*tvName]]`]]
                      
                        Website: Extended Dialog Development Blog: on Extended Dialog
                        Add-ons: AJAX Revolution, RO.IDEs Editor & Framework (in works) Utilities: Plugin Compatibility List
                        Tutorials: Create Cross-Context Resources, Cross-Context AJAX Login, Template-Based Actions, Remove Extensions from URLs

                        Failure is just another word for saying you didn't want to try. "It can't be done" means "I don't know how".