AntonLV 9 лет назад
Родитель
Сommit
18dd78599d

+ 2 - 2
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -415,8 +415,8 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
      */
      */
     public function checkAllowedFanAdd (&$aDataEntry, $isPerformAction = false)
     public function checkAllowedFanAdd (&$aDataEntry, $isPerformAction = false)
     {
     {
-        if (!$this->isFan($aDataEntry[$this->_oConfig->CNF['FIELD_ID']]) && isLogged())
-            return CHECK_ACTION_RESULT_ALLOWED;
+        if ($this->isFan($aDataEntry[$this->_oConfig->CNF['FIELD_ID']]) || !isLogged())
+            return _t('_sys_txt_access_denied');
 
 
         return $this->_checkAllowedConnect ($aDataEntry, $isPerformAction, $this->_oConfig->CNF['OBJECT_CONNECTIONS'], true, false);
         return $this->_checkAllowedConnect ($aDataEntry, $isPerformAction, $this->_oConfig->CNF['OBJECT_CONNECTIONS'], true, false);
     }
     }

+ 1 - 1
modules/base/groups/classes/BxBaseModGroupsTemplate.php

@@ -36,7 +36,7 @@ class BxBaseModGroupsTemplate extends BxBaseModProfileTemplate
         $aVars['bx_if:info']['condition'] = true;
         $aVars['bx_if:info']['condition'] = true;
         $aVars['bx_if:info']['content']['members'] = $isPublic ? _t($CNF['T']['txt_N_fans'], $oConn ? $oConn->getConnectedInitiatorsCount($oGroupProfile->id(), true) : 0) : ' ';
         $aVars['bx_if:info']['content']['members'] = $isPublic ? _t($CNF['T']['txt_N_fans'], $oConn ? $oConn->getConnectedInitiatorsCount($oGroupProfile->id(), true) : 0) : ' ';
         $aVars['bx_if:info']['content']['bx_if:btn'] = array (
         $aVars['bx_if:info']['content']['bx_if:btn'] = array (
-            'condition' => isLogged() && $isPublic && !$oConn->isConnected(bx_get_logged_profile_id(), $oGroupProfile->id(), true),
+            'condition' => $isPublic && $this->getModule()->checkAllowedFanAdd($aData) === CHECK_ACTION_RESULT_ALLOWED,
             'content' => array (
             'content' => array (
                 'id' => $oGroupProfile->id(),
                 'id' => $oGroupProfile->id(),
                 'title' => $oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $oGroupProfile->id()) ? _t($CNF['T']['menu_item_title_become_fan_sent']) : _t($CNF['T']['menu_item_title_become_fan']),
                 'title' => $oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $oGroupProfile->id()) ? _t($CNF['T']['menu_item_title_become_fan_sent']) : _t($CNF['T']['menu_item_title_become_fan']),