From 217e537d691d4b3d18611f4c3ddd291759309fcf Mon Sep 17 00:00:00 2001 From: AntonLV Date: Thu, 6 Jan 2022 16:31:14 +0300 Subject: [PATCH] Ticket #3643 - Groups: Invited user should be auto accepted Join Group button was clicked. --- .../groups/classes/BxBaseModGroupsPageEntry.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/base/groups/classes/BxBaseModGroupsPageEntry.php b/modules/base/groups/classes/BxBaseModGroupsPageEntry.php index a4e220165d..0c0799369d 100644 --- a/modules/base/groups/classes/BxBaseModGroupsPageEntry.php +++ b/modules/base/groups/classes/BxBaseModGroupsPageEntry.php @@ -77,16 +77,25 @@ public function getCode () $sInvitation = ''; if(!empty($CNF['TABLE_INVITES'])) { $sKey = ''; + $iProfileId = bx_get_logged_profile_id(); $iGroupProfileId = $this->_oProfile->id(); - if(($sKey = bx_get('key')) !== false) + if(($sKey = bx_get('key')) !== false) { + $sKey = bx_process_input($sKey); $mixedInvited = $this->_oModule->isInvited($sKey, $iGroupProfileId); - else if(($iProfileId = bx_get_logged_profile_id()) !== false) + } + else if($iProfileId !== false) $mixedInvited = $this->_oModule->isInvitedByProfileId($iProfileId, $iGroupProfileId); if ($mixedInvited === true) { $sId = $this->_oModule->getName() . '_popup_invite'; + if(empty($sKey)) { + $aInvite = $this->_oModule->_oDb->getInviteByInvited($iProfileId, $iGroupProfileId); + if(!empty($aInvite) && is_array($aInvite)) + $sKey = $aInvite['key']; + } + $this->_oTemplate->addJs(array('invite_popup.js')); $sInvitation .= $this->_oModule->_oTemplate->getJsCode('invite_popup', array(