Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV 2 лет назад
Родитель
Сommit
8a8b53258a
2 измененных файлов с 7 добавлено и 2 удалено
  1. 6 2
      inc/profiles.inc.php
  2. 1 0
      template/scripts/BxBaseServiceAccount.php

+ 6 - 2
inc/profiles.inc.php

@@ -235,7 +235,9 @@ function bx_check_password($sLogin, $sPassword, $iRole = BX_DOL_ROLE_MEMBER)
     
     if ($oAccount->isLocked()){
         bx_import('BxDolLanguages');
-		return _t("_sys_txt_login_locked", bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')));
+		if (bx_is_api()){
+            return [strip_tags(_t("_sys_txt_login_locked", bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'))),''), bx_api_get_relative_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'))];
+        }
 	}
 
     $aAccountInfo = $oAccount->getInfo();
@@ -264,7 +266,9 @@ function bx_check_password($sLogin, $sPassword, $iRole = BX_DOL_ROLE_MEMBER)
             if ($aAccountInfo['login_attempts'] >= $iMaxLoginAttempts){
                 $oAccountQuery->lockAccount($aAccountInfo['id'], 1);
                 bx_import('BxDolLanguages');
-                return _t("_sys_txt_login_locked", bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')));
+                if (bx_is_api()){
+                    return [strip_tags(_t("_sys_txt_login_locked", bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'))),''), bx_api_get_relative_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'))];
+                }
             }
             else{
                 $oAccountQuery->updateAttemptsCounter($aAccountInfo['id']);

+ 1 - 0
template/scripts/BxBaseServiceAccount.php

@@ -625,6 +625,7 @@ class BxBaseServiceAccount extends BxDol
             
             if($bApi) {
                 return [
+                    bx_api_get_msg($sResultMsg, ['ext' => ['msg_type' => 'caption']]),
                     bx_api_get_block('form', $oForm->getCodeAPI(), [
                         'ext' => [
                             'request' => ['url' => '/api.php?r=system/forgot_password/TemplServiceAccount', 'immutable' => true]