Skip to content

Commit

Permalink
fixed runtime errors for main action.
Browse files Browse the repository at this point in the history
Course selection is not yet working.
  • Loading branch information
Fred Neumann committed Jul 11, 2023
1 parent d0830d3 commit d69e085
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion classes/class.ilVhbShibAuthConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function __construct($a_plugin_object)
$params[] = ilVhbShibAuthParam::_create(
'evaluator_role',
'Evaluatorenrolle',
'Suchmuster für Namen der ILIAS-Kursrolle, die Evaluatoren zugewiesen werden soll. Evaluatoren haben im Shibboleth-Attribut "eduPersonEntitlement" die Nutzerrolle "evaluator". Sie sollen im ILIAS-Kurs eine entsprechende Kursrolle bekommen. Mit dem Suchmuster wird in den Titeln aller Rollen des gefundenen Kurses nach der Evaluatoren-Rolle gesucht. Das Muster kann "?" oder "*" als Platzhalter für einzelne oder beliebig viele Zeichen enthalten.',
'Suchmuster für Namen der ILIAS-Kursrolle, die Evaluatoren zugewiesen werden soll. Evaluatoren haben im Shibboleth-Attribut "eduPersonEntitlement" die Nutzerrolle "evaluation". Sie sollen im ILIAS-Kurs eine entsprechende Kursrolle bekommen. Mit dem Suchmuster wird in den Titeln aller Rollen des gefundenen Kurses nach der Evaluatoren-Rolle gesucht. Das Muster kann "?" oder "*" als Platzhalter für einzelne oder beliebig viele Zeichen enthalten.',
ilVhbShibAuthParam::TYPE_TEXT,
'Kursgast*'
);
Expand Down
6 changes: 4 additions & 2 deletions classes/class.ilVhbShibAuthConfigGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

/**
* vhb Shibboleth Authentication configuration user interface class
*
* @ilCtrl_IsCalledBy ilVhbShibAuthConfigGUI: ilObjComponentSettingsGUI
*/
class ilvhbShibAuthConfigGUI extends ilPluginConfigGUI
class ilVhbShibAuthConfigGUI extends ilPluginConfigGUI
{
/** @var ilVhbShibAuthPlugin $plugin */
protected $plugin;
Expand Down Expand Up @@ -84,7 +86,7 @@ protected function initConfigurationForm()
break;
case ilVhbShibAuthParam::TYPE_BOOLEAN:
$input = new ilCheckboxInputGUI($title, $postvar);
$input->setChecked($param->value);
$input->setChecked((bool) $param->value);
break;
case ilVhbShibAuthParam::TYPE_FLOAT:
$input = new ilNumberInputGUI($title, $postvar);
Expand Down
5 changes: 4 additions & 1 deletion classes/class.ilVhbShibAuthData.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public function configure($config, $plugin)
// extract the relevant values from aggregated fields
// should not be necessary if SP is correctly configured at vhb
foreach (array_keys(get_class_vars('shibConfig')) as $field) {
if ($field == 'cache') {
continue;
}
$values = explode(self::DELIM, (string) $this->{$field});

if ($this->config->get('resolve_aggregation')) {
Expand Down Expand Up @@ -163,7 +166,7 @@ public function getData()
{
$data = [];
foreach (array_keys(get_class_vars('shibConfig')) as $field) {
if (substr($field, 0, 7) != 'update_') {
if ($field !== 'cache' && substr($field, 0, 7) != 'update_') {
$data[$field] = $this->{$field};
}
}
Expand Down
8 changes: 4 additions & 4 deletions classes/class.ilVhbShibAuthMatching.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,11 @@ protected function getEntitledVhbCourses()
foreach ($entitlements as $entitlement)
{
$parts = explode(':',$entitlement);
$role = $parts[5];
$scope = $parts[6];
$lvnr = $parts[7];
$role = $parts[5] ?? '';
$scope = $parts[6] ?? '';
$lvnr = $parts[7] ?? '';

if ($scope == $this->config->get('local_scope'))
if ($scope == $this->config->get('local_scope') && !empty($role) && !empty($lvnr))
{
$courses[$lvnr] = $role;
}
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$id = "vhbshib";

// code version; must be changed for all code changes
$version = "1.2.0";
$version = "1.2.1";

// ilias min and max version; must always reflect the versions that should
// run with the plugin
Expand Down

0 comments on commit d69e085

Please sign in to comment.