AntonLV 8 tahun lalu
induk
melakukan
e140079344

+ 6 - 1
modules/base/general/classes/BxBaseModGeneralPageEntry.php

@@ -32,10 +32,15 @@ class BxBaseModGeneralPageEntry extends BxTemplPage
         $this->_sCoverClass = $this->_oModule->getName() . '_cover';
     }
 
+    public function isActive()
+    {
+        return true;
+    }
+
     public function getCode ()
     {
         // check if content exists
-        if (!$this->_aContentInfo) { // if entry is not found - display standard "404 page not found" page
+        if (!$this->_aContentInfo || !$this->isActive()) { // if entry is not found - display standard "404 page not found" page
             $this->_oTemplate->displayPageNotFound();
             exit;
         }

+ 16 - 0
modules/base/text/classes/BxBaseModTextPageEntry.php

@@ -46,6 +46,22 @@ class BxBaseModTextPageEntry extends BxBaseModGeneralPageEntry
         ));
     }
 
+    public function isActive()
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if($this->_aContentInfo[$CNF['FIELD_AUTHOR']] == bx_get_logged_profile_id() || $this->_oModule->_isModerator())
+            return true;
+
+        if(isset($CNF['FIELD_STATUS']) && $this->_aContentInfo[$CNF['FIELD_STATUS']] != 'active')
+            return false;
+
+        if(isset($CNF['FIELD_STATUS_ADMIN']) && $this->_aContentInfo[$CNF['FIELD_STATUS_ADMIN']] != 'active')
+            return false;
+
+        return true;
+    }
+
     protected function _setSubmenu($aParams)
     {
     	$CNF = &$this->_oModule->_oConfig->CNF;