7 Replies Latest reply on Jul 23, 2009 6:34 AM by Maikel_Exmedia

    Where to remove check username function?

    Maikel_Exmedia

      Hello,

       

      I want to remove the check username function in the User Registration Wizard, could some please tell me where I can find it?

       

      tnx in advance!

       

      greetings

        • 1. Re: Where to remove check username function?
          DwFAQ Level 4

          Remove it from your code. Whoops looks like you forgot to post it

          • 2. Re: Where to remove check username function?
            Maikel_Exmedia Level 1

            That's the problem, I can't find it in my code so I'm thinking it's somewhere in a file in the includes folder...

             

            // Register triggers
            $userRegistration->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
            $userRegistration->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
            $userRegistration->registerTrigger("END", "Trigger_Default_Redirect", 99, "{kt_login_redirect}");
            $userRegistration->registerTrigger("AFTER", "Trigger_ActivationEmail", 40);

             

            greetings,

            Maikel

            • 3. Re: Where to remove check username function?
              deazin

              i think u should try to remove it from ur javascript code

              • 4. Re: Where to remove check username function?
                Maikel_Exmedia Level 1

                Ok sounds good to me! I tried to find the code and went thru al lot of files in the includes folder, but I can't find the code maybe someone knows where this piece of code is located?

                 

                I don't need this code because an error breaks my orderform and an unique username is not needed in my situation...

                 

                greetings, Maikel

                • 5. Re: Where to remove check username function?
                  zzipper7 Level 1

                  includes>tng>tNG_login.class

                   

                  function prepareSQL() {
                    tNG_log::log('tNG_login', 'prepareSQL', 'begin');
                   
                    $table = $GLOBALS['tNG_login_config']['table'];
                    $pk_column = $this->getPrimaryKey();
                    $user_column = $GLOBALS['tNG_login_config']['user_field'];
                    $password_column = $GLOBALS['tNG_login_config']['password_field'];

                    $sql = "SELECT ".$table.".*, ". KT_escapeFieldName($pk_column) ." AS kt_login_id, ". KT_escapeFieldName($user_column) ." AS kt_login_user, ". KT_escapeFieldName($password_column)." AS kt_login_password ";
                    if (isset($GLOBALS['tNG_login_config']['max_tries']) && isset($GLOBALS['tNG_login_config']['max_tries_field']) && isset($GLOBALS['tNG_login_config']['max_tries_disableinterval']) && isset($GLOBALS['tNG_login_config']['max_tries_disabledate_field']) && $GLOBALS['tNG_login_config']['max_tries']!='' && $GLOBALS['tNG_login_config']['max_tries_field']!='' && $GLOBALS['tNG_login_config']['max_tries_disableinterval']!='' && $GLOBALS['tNG_login_config']['max_tries_disabledate_field']!='') {
                     $sql .= ', '.KT_escapeFieldName($GLOBALS['tNG_login_config']['max_tries_field']).' AS kt_login_maxtries, '.KT_escapeFieldName($GLOBALS['tNG_login_config']['max_tries_disabledate_field']).' AS kt_login_maxtriesdate ';
                    }
                    if (isset($GLOBALS['tNG_login_config']['registration_date_field']) && isset($GLOBALS['tNG_login_config']['expiration_interval_field']) && isset($GLOBALS['tNG_login_config']['expiration_interval_default']) && $GLOBALS['tNG_login_config']['registration_date_field']!='' && $GLOBALS['tNG_login_config']['expiration_interval_default']!='' && $GLOBALS['tNG_login_config']['expiration_interval_field']!='') {
                     $sql .= ', '.KT_escapeFieldName($GLOBALS['tNG_login_config']['expiration_interval_field']).' AS kt_login_expiration_interval, '.KT_escapeFieldName($GLOBALS['tNG_login_config']['registration_date_field']).' AS kt_login_regdate ';
                    }
                    $sql .= " FROM ". $table;
                    if ($this->loginType == 'form') {
                     $sql.= " WHERE ".KT_escapeFieldName($user_column). "={kt_login_user}";
                    } else {
                     $sql.= " WHERE ".KT_escapeFieldName($pk_column). "={kt_login_id}";
                    }
                   
                    $sql = KT_DynamicData($sql, $this, "SQL");
                    $this->setSQL($sql);
                    tNG_log::log('tNG_login', 'prepareSQL', 'end');
                    return null;
                  }

                  • 6. Re: Where to remove check username function?
                    Maikel_Exmedia Level 1

                    Should I remove this piece of code?

                     

                    I tried to remove this code but it still checks if the username exists in the database in the registration form

                     

                    greetings, Maikel

                    • 7. Re: Where to remove check username function?
                      Maikel_Exmedia Level 1

                      Ok I found the piece of code!!

                       

                      It's located in the file includes\tng\triggers\tNG_defTrigg.inc.php

                       

                      at line 542

                       

                      // Register (Insert) Transaction triggers
                      /**
                      * check if the username is unique;
                      * @param object tNG transaction object
                      * @return mix null or error object
                      * @access public
                      */
                      //start Trigger_registration_CheckUniqueUsername trigger
                      //remove this line if you want to edit the code by hand
                      function Trigger_Registration_CheckUniqueUsername(&$tNG) {
                        $tblFldObj = new tNG_CheckUnique($tNG);
                        $tblFldObj->setTable($GLOBALS['tNG_login_config']['table']);
                        $tblFldObj->setFieldName($GLOBALS['tNG_login_config']['user_field']);
                        $tblFldObj->setErrorMsg(KT_getResource("REGISTRATION_UNIQUE_USER_FIELDERR", "tNG"));
                        return $tblFldObj->Execute();
                      }
                      //end Trigger_registration_CheckUniqueUsername trigger

                       

                      Greetings, Maikel