We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33453
    • 141 Posts
    I have been making some mods to the WebSignUp snippet. What I did was to make a copy of websignup.inc.php, make my changes there, and call that file from the WebSignupSnippet instead of the regular one. Quite straightforward and easily recoverable, I would have thought smiley. I got it pretty much working.

    However, going back and testing a few things I found that attempting to login in as an invalid (unknown) user did not produce an alert. Although I didn’t think I had changed the login side of things, these files are so inextricably linked that I thought I must have done some damage along the way. I replaced the call to my custom file so that everything was back to normal. It still didn’t work >:(.

    I have spent the whole day trying to chase this down and I now think it may be a bug in 0.9.1 itself.

    What I have discovered so far :-

    If I replace
    if($limit==0 || $limit>1){
      $output = webLoginAlert("Incorrect username or password entered!");
      return;
    }
    

    in weblogin.processor.inc.php with
    if($limit==0 || $limit>1){
      echo webLoginAlert("Incorrect username or password entered!");
      return;
    }
    

    it works fine. Therefore the code is being executed, but it appears that $output is not being inserted into the document, but I don’t know what happens to it once it leaves the snippet.

    Also, comparing the WebLogin snippet from 0.9.0 with the current one there are a number of differences. Come on guys ... they can’t BOTH be version 1.0 huh

    Error alerts work fine from WebSignup, which is the file I modified.

    Can someone else please try this (login as an unknown user) and let me know if they get the same result? Otherwise it’s a reinstall for me :’(.


      • 33337
      • 3,975 Posts
      I dont know a lot about it, but I think that echo statement is not allowed in snippet code.

      ...also what is the URL to check on wink
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 33453
        • 141 Posts
        The echo is not in the snippet but in the php file ../assets/snippets/weblogin/ called from the snippet. It is only for debug.

        As for the url - no point as there is nothing to see. That’s the whole problem!.

        I have done a clean install and it is the same so I will log it as a bug.

        Thanks.
          • 4095
          • 372 Posts
          Yea I have been using the snippet for a few days, and its never given an error when an invalid user logs in, just clears the input fields.

          I wasn’t aware it was meant to smiley
            [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
            Admin Sandbox Login: sandbox Password: castle
            • 33453
            • 141 Posts
            Whew! Glad it’s not just me grin
              • 33393
              • 30 Posts
              I seem to be having the same problem. I made a copy of websignup.inc.php, made some modifications, (I added a validation for an "agree to terms" checkbox, and it also creates a user page in site_content), and it seems to work perfectly when I test it in firefox.

              However in explorer the javascript validations do not work at all. The alert boxes do not display and all fields are reset after form submit. I have medium security set in explorer with javascript on.

              But, in firefox it works like a charm.

              ### I’m sorry, my problem is related but only with the websignup.inc.php not login, but it is definitely something I did because the original websignup.inc.php works in conjunction with the snippet.

              ### Feb 04 - It seems that changing the submit button from type=’submit’ to type=’image’ caused the form to not work in ie.

              I was careful to keep the same name and value on the image button that was on the submit button, but it no longer worked in ie. I replaced the normal submit button that was originally coded into the program and it works fine.
                "Adversus solem ne loquitor." -don’t speak against the sun (don’t waste your time arguing the obvious) Something I sometimes need to be reminded of.
                • 33393
                • 30 Posts
                I think it’s the javascript because I also have a pop-up link (on the same page) generated by the wysiwyg editor that will not work in ie either.
                  "Adversus solem ne loquitor." -don’t speak against the sun (don’t waste your time arguing the obvious) Something I sometimes need to be reminded of.
                  • 28237
                  • 2 Posts
                  I’m currently having this problem too. With no changes to any of the xMOD code I just make 2 new documents, one for weblogin and websignup snippets. If i submit the forms empty the pages just reload and there is no message of any kind given. I have tested this in FF and IE and they act the same. In firefix I had the JS console open and I got no errors; didn’t check IE.

                  I’ve very new to MODx I’m still looking at the snippet code trying to figure out what’s wrong, has anyone made any progress on this?

                  Thanks,
                  paul
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Interesting, the default installation has it working just fine. But setting up a different weblogin page or using the sidebar doesn’t.

                    Testing on the default installation, the refreshed page has the webLoginAlert script added to it, while the page using a sidebar login form does not.

                    In assets/snippets/weblogin/weblogin.common.inc.php, in the webLoginAlert function, I changed the "return" to an "echo" and now it works fine everywhere.

                    I don’t like this "fix", though, I would much prefer to know why it’s failing when using "return" as it always has with no problems.
                      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
                      • 25663 MODX Staff
                      • 12,272 Posts
                      The pages with the code on them in your tests are most likely cached. Any page with a form on it should not be cached, or at least the snippet should be called via the [! vs the [[ convention.
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me