Skip to content

Commit

Permalink
Ticket #3643 - Groups: Invited user should be auto accepted Join Grou…
Browse files Browse the repository at this point in the history
…p button was clicked.
  • Loading branch information
AntonLV committed Jan 6, 2022
1 parent 9f82fec commit 217e537
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/base/groups/classes/BxBaseModGroupsPageEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 217e537

Please sign in to comment.