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

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

AntonLV 8 лет назад
Родитель
Сommit
38eacfbbdf

+ 8 - 3
modules/boonex/invites/classes/BxInvTemplate.php

@@ -137,11 +137,16 @@ class BxInvTemplate extends BxBaseModGeneralTemplate
             if(!$oForm->isValid())
                 return array('content' => $sForm, 'content_id' => $sFormId, 'eval' => $sEval);
         }
-
-        $iCountByEmail = $this->_oDb->getRequests(array('type' => 'count_by_email', 'value' => $oForm->getCleanValue('email')));
+        
+        $sEmail = $oForm->getCleanValue('email');
+        $oAccountQuery = BxDolAccountQuery::getInstance();
+        $iAccount = $oAccountQuery->getIdByEmail($sEmail);
+        if ($iAccount > 0)
+            return array('content' => MsgBox(_t('_bx_invites_err_already_registed', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'))), 'content_id' => $sFormId, 'eval' => $sEval);
+        $iCountByEmail = $this->_oDb->getRequests(array('type' => 'count_by_email', 'value' => $sEmail));
         if ($iCountByEmail > 0)
             return array('content' => MsgBox(_t('_bx_invites_err_already_send')), 'content_id' => $sFormId, 'eval' => $sEval);
-        
+       
         $sIp = getVisitorIP();
         $iId = (int)$oForm->insert(array('nip' => ip2long($sIp),'date' => time()));
         if(!$iId)

+ 1 - 0
modules/boonex/invites/install/langs/en.xml

@@ -137,6 +137,7 @@
 	<string name="_bx_invites_err_delete_request"><![CDATA[Cannot delete the request.]]></string>
 	<string name="_bx_invites_err_used"><![CDATA[The invitation link isn't available or already used.]]></string>
   <string name="_bx_invites_err_already_send"><![CDATA[The request already sent for this email.]]></string>
+  <string name="_bx_invites_err_already_registed"><![CDATA[User with this email already registered. Please use  <a href="{forgot_password_url}">forgot password</a> to restore access to your account.]]></string>
   <string name="_bx_invites_request_status_new"><![CDATA[New]]></string>
   <string name="_bx_invites_request_status_invited"><![CDATA[Invited]]></string>
   <string name="_bx_invites_request_status_seen"><![CDATA[Seen]]></string>