فهرست منبع

#1971 Orgs: when one org is for friends only then other org can't make friends requests - buttons are missing

Alex Trofimov 7 سال پیش
والد
کامیت
953a572549
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      modules/base/groups/classes/BxBaseModGroupsModule.php

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

@@ -644,12 +644,15 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
     }
 
     protected function _checkAllowedConnect (&$aDataEntry, $isPerformAction, $sObjConnection, $isMutual, $isInvertResult, $isSwap = false)
-    {
+    {                
         $sResult = $this->checkAllowedView($aDataEntry);
 
         $oPrivacy = BxDolPrivacy::getObjectInstance($this->_oConfig->CNF['OBJECT_PRIVACY_VIEW']);
 
-        if (CHECK_ACTION_RESULT_ALLOWED !== $sResult && !in_array($aDataEntry[$this->_oConfig->CNF['FIELD_ALLOW_VIEW_TO']], array('c', 's')))
+        // if profile view isn't allowed but visibility is in partially visible groups 
+        // then display buttons to connect (befriend, join) to profile, 
+        // if other conditions (in parent::_checkAllowedConnect) are met as well
+        if (CHECK_ACTION_RESULT_ALLOWED !== $sResult && !in_array($aDataEntry[$this->_oConfig->CNF['FIELD_ALLOW_VIEW_TO']], $oPrivacy->getPartiallyVisiblePrivacyGroups()))
             return $sResult;
 
         return parent::_checkAllowedConnect ($aDataEntry, $isPerformAction, $sObjConnection, $isMutual, $isInvertResult, $isSwap);