Skip to content

Commit

Permalink
Update for ILIAS 9
Browse files Browse the repository at this point in the history
  • Loading branch information
fneumann committed Jul 24, 2024
1 parent 88e11f1 commit e27668a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
23 changes: 7 additions & 16 deletions classes/class.ilVhbShibAuthCourseSelectGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,16 @@ public function executeCommand()
{
// should be available when form is saved
$this->ctrl->saveParameter($this, 'deepLink');
$this->checkAcceptance();

$cmd = $this->ctrl->getCmd('showCourseSelection');
$cmd = $this->ctrl->getCmd();
switch ($cmd) {
case 'showCourseSelection':
case 'saveCourseSelection':

$this->$cmd();
}
}

/**
* Do an extra loop to let ILIAS present the terms of service automatically inbetween
* Check and set the Cmd to prevent an endless loop
*/
protected function checkAcceptance() {

if (empty($this->ctrl->getCmd()) && $this->user->hasToAcceptTermsOfService()) {
$this->ctrl->redirect($this, 'showCourseSelection');
$this->$cmd();
break;
default:
// extra loop to eventually accept the terns of services
$this->ctrl->redirect($this, 'showCourseSelection');
}
}

Expand Down Expand Up @@ -150,7 +141,7 @@ protected function saveCourseSelection()
// prepare redirection for the deep link
if (isset($_GET['deepLink'])) {
if ($ref_id = $this->matching->getTargetCourseRefId($user, $_GET['deepLink'])) {
$_GET['target'] = 'crs_'. $ref_id;
ilInitialisation::redirectToStartingPage('crs_'. $ref_id);
}
}

Expand Down
2 changes: 1 addition & 1 deletion classes/class.ilVhbShibAuthPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function raiseError($message)
global $DIC;

/** @var ilGlobalTemplate $tpl */
$pl = $DIC['tpl'];
$tpl = $DIC->ui()->mainTemplate();
$tpl->setOnScreenMessage('failure', $message, true);
ilInitialisation::redirectToStartingPage();
}
Expand Down
6 changes: 3 additions & 3 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
$id = "vhbshib";

// code version; must be changed for all code changes
$version = "1.2.3";
$version = "1.3.0";

// ilias min and max version; must always reflect the versions that should
// run with the plugin
$ilias_min_version = "8.3";
$ilias_max_version = "8.999";
$ilias_min_version = "9.2";
$ilias_max_version = "9.999";

// optional, but useful: Add one or more responsible persons and a contact email
$responsible = "Fred Neumann";
Expand Down

0 comments on commit e27668a

Please sign in to comment.