6 Replies Latest reply on May 26, 2008 1:57 PM by Günter Schenk

    Question: Günter  Tutorial Login tables: installation & configuration

    Level 1
      Günter,

      I used your tutorial to set up the login screen. Many thanks for it! Everything seemed to configure properly including the database. I then populated the logIn table with one data entry to try it .

      When trying it, I received back the error message:
      AFTER Trigger_Login_MaxTriesCheck

      In any event, it did not redirect to the "success" login page or even to the "fail" login page. It stayed on the login page with the above error message.
      Any ideas or suggestions? This is my first try at login design.

      Here is the data dump from the login Table:

      --
      -- Table structure for table `login`
      --

      CREATE TABLE `login` (
      `id` int(3) unsigned NOT NULL auto_increment,
      `username` varchar(30) collate latin1_general_ci NOT NULL default '',
      `password` varchar(70) collate latin1_general_ci NOT NULL default '',
      `email` varchar(150) collate latin1_general_ci NOT NULL default '',
      `active` tinyint(4) NOT NULL default '1',
      `level` int(2) NOT NULL default '0',
      `random_key` varchar(200) collate latin1_general_ci default NULL,
      `login_attempts` smallint(6) NOT NULL default '0',
      `disable_date` datetime NOT NULL default '0000-00-00 00:00:00',
      `registration_date` datetime NOT NULL default '0000-00-00 00:00:00',
      `expiration` int(11) NOT NULL default '100',
      PRIMARY KEY (`id`)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=2 ;

      --
      -- Dumping data for table `login`
      --

      INSERT INTO `login` VALUES (1, 'carver', 'w2tfm', 'clwashburn@att.net', 1, 0, '', 0, '2008-12-12 12:00:00', '2008-05-05 12:00:00', 100);

      ------------------------------------------------------

      Carver
        • 1. Re: Question: Günter  Tutorial Login tables: installation & configuration
          Günter Schenk Level 4
          Hi Carver,

          -----
          When trying it, I received back the error message:
          AFTER Trigger_Login_MaxTriesCheck
          -----

          I never had this error, though my login tables are the same -- weird...

          Sorry, I have to leave now and will be back on Saturday, so if anyone else can provide an answer, just go ahead :-)

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Question: Günter  Tutorial Login tables: installation & configuration
            Level 1
            The problem has been narrowed down to an error with the `login_attempts` max limit reached. The max limit is set for 4 yet the `login_attempts` column field shows 0 when I do a data dump.

            When the `login_attempts' limit is DISABLED in the ADDT Login wizard, everything works perfectly. A successful login redirects to the "success" page.

            When the `login_attempts' limit is ACTIVIATED with a limit of 4 in the ADDT Login wizard it yields the following execution trace:

            tNG Execution Trace - VIEW
            tNG_login.executeTransaction
            STARTER.Trigger_Default_Starter
            tNG_login.executeTransaction
            STARTER.Trigger_Default_Starter
            tNG_login.executeTransaction
            STARTER.Trigger_Default_Starter
            tNG_login.executeTransaction
            STARTER.Trigger_Default_Starter
            tNG_login.doTransaction
            BEFORE.Trigger_Default_FormValidation
            tNG_login.prepareSQL
            tNG_login.executeTransaction - execute sql
            AFTER.Trigger_Login_MaxTriesCheck* (red highlight for transaction error point)
            ERROR.Trigger_Login_MaxTriesIncrement
            tNG_login.getRecordset
            tNG_login.getFakeRsArr
            tNG_login.getLocalRecordset
            tNG_login.getFakeRecordset
            tNG_login.getFakeRecordset

            Yet the database dump at that point shows the login_attempts columnfield at "0":
            CREATE TABLE `login` (
            `id` int(3) unsigned NOT NULL auto_increment,
            `username` varchar(30) collate latin1_general_ci NOT NULL default '',
            `password` varchar(70) collate latin1_general_ci NOT NULL default '',
            `email` varchar(150) collate latin1_general_ci NOT NULL default '',
            `active` tinyint(4) NOT NULL default '1',
            `level` int(2) NOT NULL default '0',
            `random_key` varchar(200) collate latin1_general_ci default NULL,
            smallint(6) NOT NULL default '0',
            `disable_date` datetime NOT NULL default '0000-00-00 00:00:00',
            `registration_date` datetime NOT NULL default '0000-00-00 00:00:00',
            `expiration` int(11) NOT NULL default '100',
            PRIMARY KEY (`id`)
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=2 ;

            --
            -- Dumping data for table `login`
            --

            INSERT INTO `login` VALUES (1, 'carver', 'w2tfm', 'clwashburn@att.net', 1, 0, '', 0, '2008-12-12 12:00:00', '2008-05-05
            12:00:00', 100);

            Any ideas on this problem with login attemps would be greatly appreciated.

            Carver
            • 3. Re: Question: Günter  Tutorial Login tables: installation & configuration
              Level 1
              Hi Günter,

              No takers on my problem yet with your tutorial. Maybe you can revisit this one?

              Note that when I disable the `login_attempts` that it works (login and page redirect are successful). Some code is causing the `login_attempts` to max out on the 1st login attempt?

              Carver
              • 4. Re: Question: Günter  Tutorial Login tables: installation & configuration
                Günter Schenk Level 4
                Hi Carver,

                sorry, I was away for quite a while and couldn´t do anything of value in these forums.

                However, you´re right, my own table dump also shows "0" login_attempts after trying to log in several times with some wrong data -- I honestly don´t know why it´s set to 0 (maybe it´s set to 0 after exceeding the allowed number of login attempts ?), but on the other hand...

                -----
                It stayed on the login page with the above error message
                -----

                ...this "behaviour" seems OK to me so far. However, I´ll certainly have a closer look at all this, as I simply lack experience with logging in into my own sites with wrong data and hence have never stumbled across anything funny -- gotta wait 60 minutes now :-)

                Cheers,
                Günter Schenk
                Adobe Community Expert, Dreamweaver
                • 5. Re: Question: Günter  Tutorial Login tables: installation & configuration
                  Level 1
                  Günter,

                  My login attempts use the CORRECT user name and password.
                  The error message in doing so is :
                  AFTER.Trigger_Login_MaxTriesCheck*

                  I have found the line of code causing this error message exists in the file:
                  tNG_config.inc.php
                  The offending line of code is:
                  $tNG_login_config["max_tries_disabledate_field"] = "disable_date";

                  When I change that line to read:
                  $tNG_login_config["max_tries_disabledate_field"] = "";

                  Login and page redirect are successful.

                  The login table column field disable_date is set to '2008-12-12 12:00:00'

                  Any thoughts on why this line of code is causing the problem?

                  Carver
                  • 6. Re: Question: Günter  Tutorial Login tables: installation & configuration
                    Günter Schenk Level 4
                    Hi Carver,

                    ------
                    The offending line of code is:
                    $tNG_login_config["max_tries_disabledate_field"] = "disable_date";
                    ------

                    I don´t think that this line (respectively the column name it declares) as such does generate the problem you´re facing -- by setting that value to empty (""), you assumingly told ADDT to ignore the "maxtries" option.

                    -----
                    The login table column field disable_date is set to '2008-12-12 12:00:00'
                    -----

                    I wonder where this strange date value comes from, how many minutes did you define in the "disable interval" field ?

                    However, here´s what happens when testing all that with one of my own accounts and comparing with the data that´s stored in my login table:

                    1. everytime I log in with wrong data, the "login_attempts" column counts up to the specified number of max tries (say, 5) and, when the "The account has been temporarily disabled" message comes up, this column is set to 0 again.

                    2. the "disable_date" column, which is initially set to "0000-00-00 00:00:00", now stores a datetime value like "2008-05-27 00:06:17", which corresponds with the "disable date" interval I specified (30 minutes).

                    -----
                    My login attempts use the CORRECT user name and password
                    -----

                    IMO this seems to be the real core of your issue, but I can´t say why exactly this happens -- are you, unlike me, using encrypted passwords ?

                    Cheers,
                    Günter Schenk
                    Adobe Community Expert, Dreamweaver