Quellcode durchsuchen

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

AntonLV vor 2 Jahren
Ursprung
Commit
85e4527e59
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  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.