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

Merge branch 'master' of https://github.com/unaio/una

RomanL 4 лет назад
Родитель
Сommit
949d7ffbb0

+ 7 - 3
inc/classes/BxDolAccount.php

@@ -730,11 +730,15 @@ class BxDolAccount extends BxDolFactory implements iBxDolSingleton
     static public function isAllowedCreateMultiple ($iProfileId, $isPerformAction = false)
     static public function isAllowedCreateMultiple ($iProfileId, $isPerformAction = false)
     {
     {
         $bResult = false;
         $bResult = false;
-        if ((int)getParam('sys_account_limit_profiles_number') != 1)
+        if((int)getParam('sys_account_limit_profiles_number') != 1)
             $bResult = true;
             $bResult = true;
-        
+
+        $oProfile = BxDolProfile::getInstance($iProfileId);
+        if($oProfile && $oProfile->getAccountId() != getLoggedId())
+            $bResult = false;
+
         bx_alert('profile', 'allow_create_another_profile', $iProfileId, 0, array('override_result' => &$bResult));
         bx_alert('profile', 'allow_create_another_profile', $iProfileId, 0, array('override_result' => &$bResult));
-        
+
         return $bResult;
         return $bResult;
     }
     }
 
 

+ 3 - 2
modules/base/general/classes/BxBaseModGeneralPageEntry.php

@@ -142,9 +142,10 @@ class BxBaseModGeneralPageEntry extends BxTemplPage
 
 
     protected function _getPageCacheParams ()
     protected function _getPageCacheParams ()
     {
     {
+        $s = parent::_getPageCacheParams ();
         if (!$this->_aContentInfo)
         if (!$this->_aContentInfo)
-            return '';
-        return $this->_aContentInfo[$this->_oModule->_oConfig->CNF['FIELD_ID']]; // cache is different for every entry
+            return $s;
+        return $s . $this->_aContentInfo[$this->_oModule->_oConfig->CNF['FIELD_ID']]; // cache is different for every entry
     }
     }
 }
 }
 
 

+ 1 - 1
modules/boonex/artificer/data/template/bx_albums/unit_media.html

@@ -19,6 +19,6 @@
         <div class="bx-albums-media-caption m-2">
         <div class="bx-albums-media-caption m-2">
             <a href="__url__" title="__title_attr__">__title__</a>
             <a href="__url__" title="__title_attr__">__title__</a>
         </div>
         </div>
-        <div class="bx-albums-media-actions mb-2">__actions__</div>
+        <div class="bx-albums-media-actions mx-2 mb-2">__actions__</div>
     </div>
     </div>
 </div>
 </div>

+ 4 - 1
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -500,12 +500,15 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                 else if(!empty($aEvent['content']['images_attach']) && is_array($aEvent['content']['images_attach']))
                 else if(!empty($aEvent['content']['images_attach']) && is_array($aEvent['content']['images_attach']))
                     $aImages = $aEvent['content']['images_attach'];
                     $aImages = $aEvent['content']['images_attach'];
 
 
+                if(isset($aImages['total']) && isset($aImages['items']))
+                    $aImages = $aImages['items'];
+
                 $bImageSingle = count($aImages) == 1;
                 $bImageSingle = count($aImages) == 1;
                 $sImageSelected = base64_decode(bx_process_input(bx_get('src')));
                 $sImageSelected = base64_decode(bx_process_input(bx_get('src')));
 
 
                 $aTmplVarsImages = [];
                 $aTmplVarsImages = [];
                 if(!$bImageSingle)
                 if(!$bImageSingle)
-                    foreach($aImages['items'] as $aImage) 
+                    foreach($aImages as $aImage) 
                         $aTmplVarsImages[] = [
                         $aTmplVarsImages[] = [
                             'style_prefix' => $sStylePrefix,
                             'style_prefix' => $sStylePrefix,
                             'url' => $aImage['url'],
                             'url' => $aImage['url'],

+ 5 - 1
template/scripts/BxBaseMenuProfileAdd.php

@@ -19,8 +19,12 @@ class BxBaseMenuProfileAdd extends BxTemplMenu
 
 
     public function getCode ()
     public function getCode ()
     {
     {
+        $oProfile = BxDolProfile::getInstance();
+        if($oProfile && !BxDolAccount::isAllowedCreateMultiple($oProfile->id()))
+            return '';
+
         $oAccount = BxDolAccount::getInstance();
         $oAccount = BxDolAccount::getInstance();
-        if ($oAccount && $oAccount->isProfilesLimitReached())
+        if($oAccount && $oAccount->isProfilesLimitReached())
             return '';
             return '';
 
 
         return parent::getCode ();
         return parent::getCode ();

+ 3 - 3
template/scripts/BxBasePage.php

@@ -181,7 +181,7 @@ class BxBasePage extends BxDolPage
 
 
         $this->_setSubmenu(array());
         $this->_setSubmenu(array());
 
 
-        if (!getParam('sys_page_cache_enable') || !$this->_aObject['cache_lifetime']) {
+        if (!getParam('sys_page_cache_enable') || !$this->_aObject['cache_lifetime'] || (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST')) {
             $sPageCode = $this->_getPageCode();
             $sPageCode = $this->_getPageCode();
         }
         }
         else {
         else {
@@ -493,7 +493,7 @@ class BxBasePage extends BxDolPage
 
 
     protected function _getBlockCodeWithCache($aBlock, $iAsync = 0)
     protected function _getBlockCodeWithCache($aBlock, $iAsync = 0)
     {
     {
-        if (!getParam('sys_pb_cache_enable') || !$aBlock['cache_lifetime'] || $iAsync) {
+        if (!getParam('sys_pb_cache_enable') || !$aBlock['cache_lifetime'] || $iAsync || (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST')) {
             $sBlockCode = $this->_getBlockCode($aBlock, $iAsync);
             $sBlockCode = $this->_getBlockCode($aBlock, $iAsync);
         }
         }
         else {
         else {
@@ -938,7 +938,7 @@ class BxBasePage extends BxDolPage
      */
      */
     protected function _getPageCacheParams ()
     protected function _getPageCacheParams ()
     {
     {
-        return '';
+        return md5(serialize($_GET) . bx_lang_name());
     }
     }
 
 
     /**
     /**

+ 2 - 1
template/scripts/BxBasePageAccount.php

@@ -94,7 +94,8 @@ class BxBasePageAccount extends BxTemplPage
 
 
     protected function _getPageCacheParams ()
     protected function _getPageCacheParams ()
     {
     {
-        return getLoggedId(); // cache is different for every account
+        $s = parent::_getPageCacheParams ();
+        return $s . getLoggedId(); // cache is different for every account
     }
     }
 }
 }