We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I’m going bonkers... I made some progress in setting up the Login snippet for front-end (web context) users. I’m not sure what I changed, but now, nothing works at all. I can’t log into the front-end login form and I get no errors in the logs. It

    I’ve been looking over some of the existing docs, but I’m still having trouble... any hints/links/commiseration? Thanks!
      • 3749
      • 24,544 Posts
      Those are tough to debug.

      A couple of thoughts:

      If you changed the login form, invalid HTML could prevent the $_POST variables from being set properly.

      If that’s not it, take a look at the modx_users table and see if the admin id (1) and username are still correct and that the admin is active.
        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
        • 28215
        • 4,149 Posts
        Post your snippet call and login tpl.
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • The snippet is the unadulterated Login Snippet version 1.5.2 rc1 (which is the most recent at the moment).

          The snippet call is like this:
          [[Login? &loginTpl=`FormLogin` &errTpl=`FormLoginError` &loginResourceId=`4` &logoutResourceId=`1` ]]


          The sample html in the loginTpl came from the Clarity pack:
          <div id="loginForm">
              <div class="loginMessage">[[+errors]]</div>
              <div class="loginLogin">
                  <form class="loginLoginForm" action="[[~[[*id]]]]" method="post">
                      <fieldset class="loginLoginFieldset">
                          <label class="loginUsernameLabel">[[%login.username]]
                              <input class="loginUsername" type="text" name="username" />
                          </label>
                          
                          <label class="loginPasswordLabel">[[%login.password]]
                              <input class="loginPassword" type="password" name="password" />
                          </label>
                          <input class="returnUrl" type="hidden" name="returnUrl" value="[[+request_uri]]" />
                          
                          <input class="loginLoginValue" type="hidden" name="service" value="login" />
                          <span class="loginLoginButton"><input type="submit" name="Login" value="[[+actionMsg]]" /></span>
                      </fieldset>
                  </form>
              </div>
          </div>


          I wanted to get this working in a vanilla capacity before I added my own custom login validation rules...

          The only goofy thing here is that the Snippet is called twice: once in the page content and once in the sidebar (it’s the exact same Snippet call).

          I’ve tried using my manager user here, but no go. My admin user is a member of the Administrators user group, and when I edit that User Group, I have 4 contexts (?) added:
          [table]
          [tr]
          [td]Context[/td]
          [td]Min Role[/td]
          [td]Access Policy[/td]
          [/tr]
          [tr]
          [td]mgr[/td]
          [td]Super User - 0[/td]
          [td]Administrator[/td]
          [/tr]
          [tr]
          [td]mgr[/td]
          [td]Member - 9999[/td]
          [td]QuipModeratorPolicy[/td]
          [/tr]
          [tr]
          [td]web[/td]
          [td]Super User - 0[/td]
          [td]Administrator[/td]
          [/tr]
          [tr]
          [td]web[/td]
          [td]Member - 9999[/td]
          [td]Resource[/td]
          [/tr]
          [/table]

          Does that look normal?

          I think maybe the easiest way to test functionality and to get your feet wet with the new permissions schema is to try logging into the front-end using your manager username... yes?
          • Call it uncached. tongue
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • Yep, calling uncached did get over the first hurdle. Now figuring out the problems with WayFinder... at times it has correctly listed pages that the user has access to, and at other times not.
              • Nevermind... CSS is placing the correct WayFinder links about 300 pixels into right field. Oiy... I think I need a break.