Sfoglia il codice sorgente

Ticket #4971 - Build-in API support: 'Page Not Found' for unconfirmed profiles.

AntonLV 7 mesi fa
parent
commit
5279cbf37d

+ 9 - 6
modules/base/profile/classes/BxBaseModProfilePageEntry.php

@@ -153,12 +153,6 @@ class BxBaseModProfilePageEntry extends BxBaseModGeneralPageEntry
 
     public function getCode ()
     {
-        // check if profile is active
-        if (!$this->_oProfile || (!$this->_oProfile->isActive() && $this->_oProfile->id() != bx_get_logged_profile_id() && $this->_oModule->checkAllowedEditAnyEntry() !== CHECK_ACTION_RESULT_ALLOWED)) {
-            $this->_oTemplate->displayPageNotFound();
-            exit;
-        }
-
         $this->_oTemplate->addCss('main.css');
 
         $sResult = parent::getCode();
@@ -168,6 +162,15 @@ class BxBaseModProfilePageEntry extends BxBaseModGeneralPageEntry
         return $sResult;
     }
 
+    protected function _isAvailablePage($a)
+    {
+        // check if profile is active
+        if(!$this->_oProfile || (!$this->_oProfile->isActive() && $this->_oProfile->id() != bx_get_logged_profile_id() && $this->_oModule->checkAllowedEditAnyEntry() !== CHECK_ACTION_RESULT_ALLOWED))
+            return false;
+
+        return parent::_isAvailablePage($a);
+    }
+
     protected function _isVisiblePage ($a)
     {
         $CNF = &$this->_oModule->_oConfig->CNF;