Skip to content

Commit

Permalink
GrouperGroupsController.php edited online with Bitbucket
Browse files Browse the repository at this point in the history
  • Loading branch information
axel committed Dec 25, 2021
1 parent 279f072 commit 7eb5750
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions Controller/GrouperGroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class GrouperGroupsController extends GrouperLiteAppController
'page' => 1
);


/**
* Overrides parent beforeFilter to verify that Session contains the correct API settings.
*
Expand All @@ -63,7 +62,7 @@ public function beforeFilter() {
//Need to find which plugin instance choosing, if more than one from cm_co_grouper_lites
// table being used in COmanage.
$grouperConnData = $this->Session->read('Plugin.Grouper.Api');
if ($this->Session->check('Plugin.Grouper.Api.id') && count($grouperConnData) == 6) {
if ($this->Session->check('Plugin.Grouper.Api.id') && count($grouperConnData) == 9) {
if (isset($this->passedArgs['glid'])) {
if ($this->Session->read('Plugin.Grouper.Api.id') !== $this->passedArgs['glid']) {
$this->setConnection();
Expand Down Expand Up @@ -94,6 +93,10 @@ private function setConnection() {
$this->Session->write('Plugin.Grouper.Api.user', $connectionInfo['CoGrouperLite']['connUser']);
$this->Session->write('Plugin.Grouper.Api.pass', $connectionInfo['CoGrouperLite']['connPass']);
$this->Session->write('Plugin.Grouper.Api.grouperUrl', $connectionInfo['CoGrouperLite']['grouperUrl']);

$this->Session->write('Plugin.Grouper.Api.adHocHeading', $connectionInfo['CoGrouperLite']['adHocHeading']);
$this->Session->write('Plugin.Grouper.Api.wgHeading', $connectionInfo['CoGrouperLite']['wgHeading']);
$this->Session->write('Plugin.Grouper.Api.defaultCollapse', $connectionInfo['CoGrouperLite']['defaultCollapse']);
}

/**
Expand Down Expand Up @@ -207,6 +210,12 @@ public function groupOwner() {
$this->set('grouperbaseurl', $this->Session->read('Plugin.Grouper.Api.grouperUrl'));
$this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId));
$this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId));
$config = [
"defaultCollapse" => CakeSession::read('Plugin.Grouper.Api.defaultCollapse'),
"adHocHeading" => CakeSession::read('Plugin.Grouper.Api.adHocHeading'),
"wgHeading" => CakeSession::read('Plugin.Grouper.Api.wgHeading')
];
$this->set('config', $config);
}


Expand Down Expand Up @@ -274,6 +283,12 @@ public function groupMember() {
$this->set('grouperbaseurl', $this->Session->read('Plugin.Grouper.Api.grouperUrl'));
$this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId));
$this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId));
$config = [
"defaultCollapse" => CakeSession::read('Plugin.Grouper.Api.defaultCollapse'),
"adHocHeading" => CakeSession::read('Plugin.Grouper.Api.adHocHeading'),
"wgHeading" => CakeSession::read('Plugin.Grouper.Api.wgHeading')
];
$this->set('config', $config);
}

/**
Expand All @@ -282,6 +297,7 @@ public function groupMember() {
public function groupOptin() {
$this->set('title', _txt('pl.grouperlite.title.groupoptin'));


//Set initial settings for pagination
$scope = [
'userId' => $this->userId,
Expand Down Expand Up @@ -338,6 +354,12 @@ public function groupOptin() {
}
$this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId));
$this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId));
$config = [
"defaultCollapse" => CakeSession::read('Plugin.Grouper.Api.defaultCollapse'),
"adHocHeading" => CakeSession::read('Plugin.Grouper.Api.adHocHeading'),
"wgHeading" => CakeSession::read('Plugin.Grouper.Api.wgHeading')
];
$this->set('config', $config);
}

/**
Expand Down Expand Up @@ -746,4 +768,4 @@ private function hackDescription($description) {
$newString = substr($description, strpos($description, ".") + 1);
return trim($newString);
}
}
}

0 comments on commit 7eb5750

Please sign in to comment.