Parcourir la source

Ticket #5585 - API: Login form loses input values on error.

AntonLV il y a 2 mois
Parent
commit
8279cacc33

+ 2 - 1
modules/boonex/antispam/classes/BxAntispamModule.php

@@ -216,7 +216,8 @@ class BxAntispamModule extends BxDolModule
     public function serviceCheckFormForToxicity(&$oForm) {
         $this->_bLastSubmittedFormWasToxic = false;
 
-        if (!$oForm->isValid() || !$oForm->isSubmitted()) return false;
+        if (!$oForm->isSubmitted() || !$oForm->isValid()) 
+            return false;
 
         $sSubmitName = false;
         $sFormText = '';

+ 1 - 0
template/scripts/BxBaseServiceLogin.php

@@ -201,6 +201,7 @@ class BxBaseServiceLogin extends BxDol
         }
 
         if ($bApi) {
+            $oForm->initChecker();
             if ($oForm->isSubmittedAndValid()) {
                 $oAccount = BxDolAccount::getInstance(trim($oForm->getCleanValue('ID')));
                 bx_login($oAccount->id(), $oForm->getRememberMe());