Răsfoiți Sursa

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

AntonLV 2 ani în urmă
părinte
comite
85e4527e59
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  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)
     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 _t('_sys_txt_access_denied');
+
         return parent::checkAllowedAdd ($isPerformAction);
         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.
      * @return CHECK_ACTION_RESULT_ALLOWED if access is granted or error message if access is forbidden. So make sure to make strict(===) checking.