diff --git a/classes/layout.php b/classes/layout.php index 47aa8aa..efabc48 100644 --- a/classes/layout.php +++ b/classes/layout.php @@ -39,6 +39,9 @@ class layout { * Autologin if access takes place via SSO. */ public static function sso_auto_login() { + if (!function_exists('wwusso_username')) { + return; + } if (!isloggedin() && wwusso_username()) { global $CFG; $url = qualified_me(); diff --git a/classes/output/core_renderer.php b/classes/output/core_renderer.php index f21de5a..9df5659 100644 --- a/classes/output/core_renderer.php +++ b/classes/output/core_renderer.php @@ -117,6 +117,10 @@ public function logo_header() { public function main_menu() { global $CFG, $USER; + if (isset($this->page->layout_options['nomainmenu']) && $this->page->layout_options['nomainmenu']) { + return ''; + } + $mainmenu = []; // Add MyCourses menu. @@ -1079,7 +1083,11 @@ private function get_login() { } $loginurl = get_login_url(); - $wwwhost = htmlentities(selfmsp(true)); + if (function_exists('selfmsp')) { + $wwwhost = htmlentities(selfmsp(true)); + } else { + $wwwhost = ''; + } $ssologinurl = str_ireplace($wwwhost, 'https://sso.uni-muenster.de', $CFG->wwwroot); return ['url' => $loginurl, 'ssourl' => $ssologinurl]; @@ -1125,22 +1133,19 @@ public function render_login(\core_auth\output\login $form) { // Set the context variables for the mustache template. global $CFG, $SESSION; - $wwwhost = htmlentities(selfmsp(true)); + if (function_exists('selfmsp')) { + $wwwhost = htmlentities(selfmsp(true)); + } else { + $wwwhost = ''; + } $context->ssofield = (stripos($wwwhost, "www") !== false && stripos($CFG->wwwroot, $wwwhost) !== false); $wantsurl = empty($SESSION->wantsurl) ? $CFG->wwwroot : $SESSION->wantsurl; - $context->ssoactionurl = str_ireplace($wwwhost, 'https://sso.uni-muenster.de', $wantsurl); - $context->xssoactionurl = str_ireplace($wwwhost, 'https://xsso.uni-muenster.de', $wantsurl); - // Read parameters from url, thus they can be used in form as hidden fields - // $wantsurl can contain parameters e.g. user/view.php?id=5&course=10 - // form method needs to be 'get', because an xsso forward would drop post values. - // within the get action of a form query string values are dropped as well. - $params = array(); - parse_str(parse_url($wantsurl, PHP_URL_QUERY), $params); - $paramsmustache = array(); - foreach ($params as $key => $val) { - $paramsmustache[] = ["key" => $key, "value" => $val]; - } - $context->ssoparams = $paramsmustache; + $context->ssourl = str_ireplace($wwwhost, 'https://sso.uni-muenster.de', $wantsurl); + $context->xssourl = str_ireplace($wwwhost, 'https://xsso.uni-muenster.de', $wantsurl); + $context->moodleloginurl = new moodle_url($this->page->url, ['moodlelogin' => '1']); + $moodlelogin = (bool) optional_param('moodlelogin', 0, PARAM_BOOL); + $context->showmoodlelogin = !self::is_examweb() && $moodlelogin; + $context->showssologin = !$moodlelogin; return $this->render_from_template('core/loginform', $context); } diff --git a/config.php b/config.php index b262d0f..cc72c3e 100644 --- a/config.php +++ b/config.php @@ -139,7 +139,7 @@ 'theme' => 'wwu2019', 'file' => 'columns.php', 'regions' => array(), - 'options' => array('langmenu' => true), + 'options' => array('langmenu' => true, 'nomainmenu' => true, 'nonavbar' => true), ), // Pages that appear in pop-up windows - no navigation, no blocks, no header. diff --git a/lang/de/theme_wwu2019.php b/lang/de/theme_wwu2019.php index b2030bf..40f93c5 100644 --- a/lang/de/theme_wwu2019.php +++ b/lang/de/theme_wwu2019.php @@ -109,3 +109,17 @@ $string['exam:end'] = 'Klausurende:'; $string['examweb_description'] = 'Online-Prüfungssystem der WWU Münster'; + +// Login Strings. +$string['login'] = 'Anmelden'; +$string['loginSSO_long'] = 'Anmelden per SSO'; +$string['persistent_login_methods'] = 'Universitätsweite Anmeldung'; +$string['loginXSSO_long'] = 'Nutzerzertifikat'; +$string['get_cert'] = 'Zertifikat beantragen?'; +$string['forgot_pwd'] = 'Passwort vergessen?'; +$string['security_info'] = 'IV-Sicherheitsflyer'; +$string['guest_and_intern'] = 'Zugang für Gäste und LearnWeb interner Login'; +$string['loginSSO_link'] = 'Login (SSO)'; +$string['login_via_sso_desc'] = 'Bei Nutzung von Single-Sign-On (SSO) reicht die einmalige Anmeldung zu Beginn der Sitzung zur Nutzung (fast) aller Dienste, die zentral für die WWU Münster bereitgestellt werden. Sie müssen sich also in anderen Systemen nicht erneut anmelden! Besitzen Sie ein kostenloses Nutzerzertifikat der WWUCA? Dann können Sie auch dieses zur Anmeldung verwenden und ersparen sich somit vollständig die Eingabe von Nutzername und Passwort.'; +$string['heading_login_via_sso'] = 'Login per SSO (empfohlen)'; +$string['login_usual_way'] = 'LearnWeb interner Login'; diff --git a/lang/en/theme_wwu2019.php b/lang/en/theme_wwu2019.php index 4c5fcd3..3971fff 100644 --- a/lang/en/theme_wwu2019.php +++ b/lang/en/theme_wwu2019.php @@ -109,3 +109,17 @@ $string['exam:end'] = 'End of exam:'; $string['examweb_description'] = 'Online examination system of the University of Münster'; + +// Login Strings. +$string['login'] = 'Login'; +$string['loginSSO_long'] = 'Login via SSO'; +$string['persistent_login_methods'] = 'University-wide Login'; +$string['loginXSSO_long'] = 'Certificate'; +$string['get_cert'] = 'Get Certifikat'; +$string['forgot_pwd'] = 'Forgotten Password?'; +$string['security_info'] = 'IV-Security Information'; +$string['guest_and_intern'] = 'Guests and LearnWeb internal Login'; +$string['loginSSO_link'] = 'Login (SSO)'; +$string['login_via_sso_desc'] = 'Using Single-Sign-On (SSO) means that a single login provides you with access to all central services offered by the university. Without having to login again! If you possess a user certificate issued by the WWUCA you can even skip login completely.'; +$string['heading_login_via_sso'] = 'Login via SSO (recommended)'; +$string['login_usual_way'] = 'LearnWeb internal Login'; diff --git a/pix/screenshot.png b/pix/screenshot.png new file mode 100644 index 0000000..e8275db Binary files /dev/null and b/pix/screenshot.png differ diff --git a/templates/core/loginform.mustache b/templates/core/loginform.mustache index d1e399c..d832ecd 100644 --- a/templates/core/loginform.mustache +++ b/templates/core/loginform.mustache @@ -103,9 +103,8 @@ {{/error}} -
{{#str}} login_via_sso_desc, auth_sso {{/str}}
-+ {{#str}} security_info, theme_wwu2019{{/str}}
+ ++ {{#str}} forgot_pwd, theme_wwu2019{{/str}}
+ ++ {{#str}} get_cert, theme_wwu2019{{/str}}
+
-
- Keine Person oder Einrichtung der Universität wird Sie in E-Mails nach Ihrem persönlichen Passwort fragen. Bitte geben Sie dieses nie an jemanden weiter. Geben Sie Kennung und Passwort nur auf Webseiten der Uni Münster ein, die sich per Serverzertifikat als vertrauenswürdig ausweisen! Klicken Sie zur Überprüfung auf das Schlosssymbol in der Adressleiste Ihres Browsers.
-
- Hinweise zum Wiedererlangen vergessener Passwörter und Nutzerkennungen
- -- Weiterführende Informationen bei der Zertifizierungsstelle der WWU
-