10 Replies Latest reply on May 23, 2008 12:51 PM by Günter Schenk

    Compare Transaction

    Gabrinskie
      hi,
      I have a "User Registration Data Edit" page.
      A user can, for example, change his username or email.
      I would like to check if the new data already exist between other user data.
      (no comparison between his data of course)

      Any solution?
      sorry for my english, hope you understand me
      Thanks
      Gabriele
        • 1. Re: Compare Transaction
          Günter Schenk Level 4
          Hi Gabriele,

          -----
          I would like to check if the new data already exist between other user data
          ----

          this is exactly what the "Check Unique Key" behaviour (part of the "Form Validation" behaviour group) will do.

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Compare Transaction
            Gabrinskie Level 1
            Sorry Günter,
            my brain is out of service...

            I follow your hint but

            3 values to check:
            username // this works
            email // this works
            password // this doesn't work, doesn't stop the transaction

            this is the trigger:

            //start Trigger_CheckUniquePassword trigger
            //remove this line if you want to edit the code by hand
            function Trigger_CheckUniquePassword(&$tNG) {
            $tblFldObj = new tNG_CheckUnique($tNG);
            $tblFldObj->setTable("db_user");
            $tblFldObj->addFieldName("password");
            $tblFldObj->setErrorMsg("Password già esistente");
            return $tblFldObj->Execute();
            }
            //end Trigger_CheckUniquePassword trigger

            what I wrong?

            thanks
            Gabriele
            • 3. Re: Compare Transaction
              Günter Schenk Level 4
              Hi Gabriele,

              ---------
              username // this works
              email // this works
              password // this doesn't work, doesn't stop the transaction
              ---------

              just to make sure I´m getting it right: "username" and "email" are both getting checked in one "Check Unique Key" trigger instance, and the CheckUniquePassword trigger doesn´t get executed then ?

              If so, did you assign a different "Priority" value to each trigger (in the "advanced" tab) so they will not get executed at the same time ?

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Compare Transaction
                Gabrinskie Level 1
                Hi Günter,

                I have 3 different "Check Unique Key" trigger instances.
                One for each field

                (I tried all in one trigger instance, but transaction stop if all data match. I need to stop the transaction for every match.)

                Email and Username trigger instances work fine, the password doesn't

                thanks
                Gabriele
                • 5. Re: Compare Transaction
                  Günter Schenk Level 4
                  Gabriele,

                  what about the "Priority" value of each trigger, are they all different, or does the CheckUniquePassword trigger have the same priority value as one of the other triggers, what would possibly explain this error ?

                  Cheers,
                  Günter Schenk
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: Compare Transaction
                    Gabrinskie Level 1
                    Tested just now:
                    - all with same priority number
                    - all with different priority number

                    same result, as before

                    Gabriele
                    • 7. Re: Compare Transaction
                      Günter Schenk Level 4
                      and the CheckUniquePassword trigger is of type BEFORE, same as the other ones ?

                      Cheers,
                      Günter Schenk
                      Adobe Community Expert, Dreamweaver
                      • 8. Re: Compare Transaction
                        Gabrinskie Level 1
                        Yes all the same:

                        ...
                        $upd_db_user->registerTrigger("BEFORE", "Trigger_CheckUniqueUser", 25);
                        $upd_db_user->registerTrigger("BEFORE", "Trigger_CheckUniqueEmail", 30);
                        $upd_db_user->registerTrigger("BEFORE", "Trigger_CheckUniquePassword", 35);
                        ...

                        (the second test)
                        • 9. Re: Compare Transaction
                          Gabrinskie Level 1
                          Günter,
                          I think "I lost myself in a glass of water" (translation fro italian)

                          No match is possible because there are:
                          - a clean Password (the POST one)
                          - and the encrypted password (the one in the database)

                          Gabriele
                          • 10. Re: Compare Transaction
                            Günter Schenk Level 4
                            Ciao Gabriele,

                            ti h´ai perduto nella una bicchiere da acqua ? non ho sentito mai questo proverbio di mio cognato siciliano ;-)

                            -------
                            No match is possible because there are:
                            - a clean Password (the POST one)
                            - and the encrypted password (the one in the database)
                            -------

                            this might indeed be the reason, but I personally have no experience with this special scenario -- interesting !

                            Cheers,
                            Günter Schenk
                            Adobe Community Expert, Dreamweaver