From e2c1c6265b43d64442473225b0b01f829f7dec67 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 29 Aug 2016 17:13:19 +0200 Subject: [baseconfig_bwidm] New module: baseconfig hook for bwidm configuration --- .../baseconfig_bwidm/baseconfig/settings.json | 1 + modules-available/baseconfig_bwidm/config.json | 3 ++ .../baseconfig_bwidm/hooks/cron.inc.php | 39 ++++++++++++++++++++ .../baseconfig_bwidm/hooks/translation.inc.php | 41 ++++++++++++++++++++++ .../baseconfig_bwidm/lang/de/config-variables.json | 4 +++ .../baseconfig_bwidm/lang/en/config-variables.json | 4 +++ 6 files changed, 92 insertions(+) create mode 120000 modules-available/baseconfig_bwidm/baseconfig/settings.json create mode 100644 modules-available/baseconfig_bwidm/config.json create mode 100644 modules-available/baseconfig_bwidm/hooks/cron.inc.php create mode 100644 modules-available/baseconfig_bwidm/hooks/translation.inc.php create mode 100644 modules-available/baseconfig_bwidm/lang/de/config-variables.json create mode 100644 modules-available/baseconfig_bwidm/lang/en/config-variables.json (limited to 'modules-available/baseconfig_bwidm') diff --git a/modules-available/baseconfig_bwidm/baseconfig/settings.json b/modules-available/baseconfig_bwidm/baseconfig/settings.json new file mode 120000 index 00000000..c29f3e82 --- /dev/null +++ b/modules-available/baseconfig_bwidm/baseconfig/settings.json @@ -0,0 +1 @@ +/var/cache/slx-admin/baseconfig-bwidm_settings.json \ No newline at end of file diff --git a/modules-available/baseconfig_bwidm/config.json b/modules-available/baseconfig_bwidm/config.json new file mode 100644 index 00000000..af67a188 --- /dev/null +++ b/modules-available/baseconfig_bwidm/config.json @@ -0,0 +1,3 @@ +{ + "dependencies": ["baseconfig"] +} diff --git a/modules-available/baseconfig_bwidm/hooks/cron.inc.php b/modules-available/baseconfig_bwidm/hooks/cron.inc.php new file mode 100644 index 00000000..32c1bd73 --- /dev/null +++ b/modules-available/baseconfig_bwidm/hooks/cron.inc.php @@ -0,0 +1,39 @@ + array( + "catid" => "sysconfig", + "defaultvalue" => "no", + "permissions" => "2", + "validator" => "list:no|selective|yes", + "shadows" => array( + "no" => array( + "SLX_BWIDM_ORGS" + ), + "yes" => array( + "SLX_BWIDM_ORGS" + ) + ) + ), + "SLX_BWIDM_ORGS" => array( + "catid" => "sysconfig", + "defaultvalue" => "", + "permissions" => "2", + "validator" => "multilist:" . implode('|', $out[1]) + ) + ); + if (!file_put_contents(BWLP_SETTINGS_JSON, json_encode($data))) { + $error = error_get_last(); + EventLog::warning('Could not write bwIDM data to ' . BWLP_SETTINGS_JSON, $error['message']); + } +}); \ No newline at end of file diff --git a/modules-available/baseconfig_bwidm/hooks/translation.inc.php b/modules-available/baseconfig_bwidm/hooks/translation.inc.php new file mode 100644 index 00000000..00898075 --- /dev/null +++ b/modules-available/baseconfig_bwidm/hooks/translation.inc.php @@ -0,0 +1,41 @@ +activate()) + return array(); + $want = BaseConfigUtil::getCategories($module); + foreach ($want as &$entry) { + $entry = true; + } + return $want; +}; + +/** + * Configuration variables + */ +$HANDLER['grep_config-variables'] = function($module) { + if (!$module->activate()) + return array(); + $want = BaseConfigUtil::getVariables($module); + foreach ($want as &$entry) { + $entry = true; + } + return $want; +}; diff --git a/modules-available/baseconfig_bwidm/lang/de/config-variables.json b/modules-available/baseconfig_bwidm/lang/de/config-variables.json new file mode 100644 index 00000000..5e03eca4 --- /dev/null +++ b/modules-available/baseconfig_bwidm/lang/de/config-variables.json @@ -0,0 +1,4 @@ +{ + "SLX_BWIDM_AUTH": "Anmeldung am Client mittels bwIDM zulassen.\r\n\r\nWenn Sie hier *yes* w\u00e4hlen, k\u00f6nnen sich alle Nutzer, die Mitglieder einer Organisation im bwIDM-Verbund sind, an einem bwLehrpool-Rechner einloggen.\r\n\r\nMit der Option *selective* k\u00f6nnen Sie die Gruppe der zugelassenen Einrichtungen weiter einschr\u00e4nken, indem Sie in der Option *SLX_BWIDM_ORGS* nur bestimmte Einrichtungen ausw\u00e4hlen.", + "SLX_BWIDM_ORGS": "Wenn die Option *SLX_BWIDM_AUTH* auf *selective* steht, sind nur die hier ausgew\u00e4hlten Einrichtungen zu einem Login via bwIDM berechtigt." +} \ No newline at end of file diff --git a/modules-available/baseconfig_bwidm/lang/en/config-variables.json b/modules-available/baseconfig_bwidm/lang/en/config-variables.json new file mode 100644 index 00000000..4ea264cc --- /dev/null +++ b/modules-available/baseconfig_bwidm/lang/en/config-variables.json @@ -0,0 +1,4 @@ +{ + "SLX_BWIDM_AUTH": "Enable logging in on clients using bwIDM credentials.\r\n\r\nSetting this to *yes* means that all members of an organization in the bwIDM federation can log in to bwLehrpool machines.\r\nSelecting *selective* means you can explicitly pick the organizations which are entitled to login via bwIDM. The organizations can be specified in the *SLX_BWIDM_ORGS* setting.", + "SLX_BWIDM_ORGS": "If you set *SLX_BWIDM_AUTH* to *selective* this list will be used to determine which organizations are allowed to login via bwIDM on the client computers." +} \ No newline at end of file -- cgit v1.2.3-55-g7522