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

Ticket #4790 - Create Entry page should have similar error message for visitors in Text and Profile based modules.

AntonLV 2 лет назад
Родитель
Сommit
85e4527e59
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      modules/base/profile/classes/BxBaseModProfileModule.php

+ 3 - 3
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -1720,11 +1720,11 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
      */
     public function checkAllowedAdd ($isPerformAction = false)
     {
-        $oAccount = BxDolAccount::getInstance();
-        if (!$oAccount || ($this->serviceActAsProfile() && $oAccount->isProfilesLimitReached()))
+        if($this->serviceActAsProfile() && ($oAccount = BxDolAccount::getInstance()) !== false && $oAccount->isProfilesLimitReached())
             return _t('_sys_txt_access_denied');
+
         return parent::checkAllowedAdd ($isPerformAction);
-    }   
+    }
 
     /**
      * @return CHECK_ACTION_RESULT_ALLOWED if access is granted or error message if access is forbidden. So make sure to make strict(===) checking.