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

    I have set up a login system and altered the core Login code so that it doesn’t send out the verification email, instead it sends an email to the admin to let them know there is a user that needs to be activated. The only problem is that if the user tries to login before they have been activated it deletes the user record from the database, once active the script works fine??

    Update: The user record also gets delete if you run forgotten password using the username but not if you use email (although the password does not get changed)

    This happens on a local setup on OSX using the latest version of MAMP and also on my web server running PHP Version 5.3.3 and MySQL 4.1.22

    I have the following error in my error.log

    [2010-08-30 23:56:29] (ERROR @ /Fox/index.php) Could not get table name for class: modAccess
    [2010-08-30 23:56:29] (ERROR @ /Fox/index.php) Error 42000 executing statement: 
    Array
    (
        [0] => 42000
        [1] => 1064
        [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS `modAccess` WHERE `modAccess`.`principal` = 5' at line 1
    )
    

      • 10107
      • 24 Posts
      *bump*
        • 10107
        • 24 Posts
        Anyone?

        Do I need to explain better?
          • 3749
          • 24,544 Posts
          I’m not sure what to tell you. The login snippet works fine AFAIK, but you say you’ve modified it, so I don’t think anyone can help you without seeing your code.

          The login snippet doesn’t send the email, so I don’t see how you’ve accomplished your task by modifying it. I suspect that you’ve modified the register snippet instead.

          I also don’t see any code in the login snippet that deletes a user, so it’s hard to guess what’s happening. Have you looked in the DB to make sure the users are really deleted?

          The register snippet *does* delete inactive users, so maybe you’re re-running it for your inactive users somehow?
            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
            • 10107
            • 24 Posts
            Quote from: BobRay at Sep 01, 2010, 02:01 AM

            I’m not sure what to tell you. The login snippet works fine AFAIK, but you say you’ve modified it, so I don’t think anyone can help you without seeing your code.

            The login snippet doesn’t send the email, so I don’t see how you’ve accomplished your task by modifying it. I suspect that you’ve modified the register snippet instead.

            I also don’t see any code in the login snippet that deletes a user, so it’s hard to guess what’s happening. Have you looked in the DB to make sure the users are really deleted?

            The register snippet *does* delete inactive users, so maybe you’re re-running it for your inactive users somehow?


            Good point I did modify the register snippet to send the email not the login. The users definitely do get deleted from the DB yes, I’ll double check to see if I’m accidently calling register instead of login, although I don’t see how I can be because it works if the user is active just not if they haven’t been activated.