Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions classes/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
35 changes: 20 additions & 15 deletions classes/output/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 14 additions & 0 deletions lang/de/theme_wwu2019.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
14 changes: 14 additions & 0 deletions lang/en/theme_wwu2019.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Binary file added pix/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
136 changes: 54 additions & 82 deletions templates/core/loginform.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@
</div>
</div>
{{/error}}

<div class="row">
<div class="col-12 col-md-6 pl-0 pr-0 pr-md-3">
<div class="container-fluid pt-5 mt-0">
{{# isexamweb }}
<section id="examwebdescription" class="block card mb-3">
{{! Beginn Block Container }}
Expand All @@ -117,42 +116,65 @@
{{#str}} examweb_description, theme_wwu2019 {{/str}}
</p>
</h5>

</div>
</div>
</section>
{{/ isexamweb }}
<section id="ssologinblock" class="block card mb-3">

{{# showssologin }}
<section id="ssologinblock" class="block card mb-3" style="max-width: 600px;margin-left: auto; margin-right: auto;">
{{! Beginn Block Container }}
<div class="card-body p-0">
{{! Block header }}
<div class="block-header">
<h5 class="card-title d-inline">
{{#str}} heading_login_via_sso, auth_sso {{/str}}
</h5>

<h5 class="card-title d-inline">
{{#str}} login, theme_wwu2019 {{/str}}
</h5>
</div>
{{! Block contents }}
<div class="card-text content p-3 text-center">
<div class="subcontent loginsub">
<p>{{#str}} login_via_sso_desc, auth_sso {{/str}}</p>

<div class="ssologins">
<div class="mb-1">
<form style="display: inline;" action="{{ssoactionurl}}" method="get" id="ssologin">
{{#ssoparams}}
<input type='hidden' name='{{key}}' value='{{value}}'>
{{/ssoparams}}
<input class="btn btn-secondary" type="submit" value="{{#str}} loginSSO_long, auth_sso {{/str}}" />
</form>
<h3>{{#str}} persistent_login_methods, theme_wwu2019{{/str}}</h3>
<div class="my-1">
<a href="{{ssourl}}" class="btn btn-secondary">{{#str}} loginSSO_link, theme_wwu2019{{/str}}</a>
</div>
<div>
<form style="display: inline;" action="{{xssoactionurl}}" method="get" id="xssologin">
{{#ssoparams}}
<input type='hidden' name='{{key}}' value='{{value}}'>
{{/ssoparams}}
<input class="btn btn-secondary" type="submit" value="{{#str}} loginXSSO_long, auth_sso {{/str}}" />
</form>
<div class="">
<a href="{{xssourl}}" class="btn btn-secondary">{{#str}} loginXSSO_long, theme_wwu2019{{/str}}</a>
</div>

<hr>
{{^ isexamweb }}
<h3>{{#str}} guest_and_intern, theme_wwu2019{{/str}}</h3>
<div class="my-1">
<a href="{{moodleloginurl}} " class="btn btn-secondary">{{#str}} login_usual_way, theme_wwu2019{{/str}}</a>
</div>
{{/ isexamweb }}
{{#canloginasguest}}
<div class="subcontent guestsub">
<form action="{{loginurl}}" method="post" id="guestlogin">
<div class="guestform">
<input type="hidden" name="logintoken" value="{{logintoken}}">
<input type="hidden" name="username" value="guest" />
<input type="hidden" name="password" value="guest" />
<input class="btn btn-secondary" type="submit" value={{#quote}}{{#str}} loginguest {{/str}}{{/quote}} />
</div>
</form>
</div>
{{/canloginasguest}}
<hr>

<p><a href="/IV-Sicherheit/flyer/"><span class="fa fa-arrow-circle-o-right" aria-hidden="true"></span>
{{#str}} security_info, theme_wwu2019{{/str}}</a></p>

<p><a href="/ZIV/MeinZIV/PasswortVergessen.html"><span class="fa fa-arrow-circle-o-right" aria-hidden="true"></span>
{{#str}} forgot_pwd, theme_wwu2019{{/str}}</a></p>

<p><a href="https://www.uni-muenster.de/WWUCA/"><span class="fa fa-arrow-circle-o-right" aria-hidden="true"></span>
{{#str}} get_cert, theme_wwu2019{{/str}}</a></p>
<div class="desc">
{{#str}} cookiesenabled {{/str}}
{{{cookieshelpiconformatted}}}
</div>
</div>
</div>
Expand All @@ -161,8 +183,11 @@
</div>
{{! End Block Container }}
</section>
{{^isexamweb}}
<section id="loginblock" class="block card mb-3">
</div>
</div>
{{/showssologin}}
{{#showmoodlelogin}}
<section id="loginblock" class="block card mb-3" style="max-width: 600px;margin-left: auto;margin-right: auto;">
{{! Beginn Block Container }}
<div class="card-body p-0">
{{! Block header }}
Expand All @@ -175,7 +200,6 @@
{{#str}} login {{/str}}
{{/ssofield}}
</h5>

</div>
{{! Block contents }}
<div class="card-text content text-center p-3">
Expand Down Expand Up @@ -216,37 +240,19 @@
</div>
</form>

<div class="desc">
{{#str}} cookiesenabled {{/str}}
{{{cookieshelpiconformatted}}}
</div>

</div>

{{#canloginasguest}}
<div class="subcontent guestsub">
<div class="desc">{{#str}} someallowguest {{/str}}</div>
<form action="{{loginurl}}" method="post" id="guestlogin">
<div class="guestform">
<input type="hidden" name="logintoken" value="{{logintoken}}">
<input type="hidden" name="username" value="guest" />
<input type="hidden" name="password" value="guest" />
<input class="btn btn-secondary" type="submit" value={{#quote}}{{#str}} loginguest {{/str}}{{/quote}} />
</div>
</form>
</div>
{{/canloginasguest}}
</div>

</div>
{{! End Block Container }}
</section>
{{/isexamweb}}
{{/showmoodlelogin}}
</div>

<div class="col-12 col-md-6 pl-0 pr-0">
<div class="block card mb-3">
{{#hasinstructions}}
<section id="instructionsblock" class="block card mb-3">
<section id="instructionsblock" class="block card mb-3" style="max-width: 600px;margin-left: auto;margin-right: auto;">
{{! Beginn Block Container }}
<div class="card-body p-0">
{{! Block header }}
Expand Down Expand Up @@ -275,40 +281,6 @@
</section>
{{/hasinstructions}}

<section id="hintsblock" class="block card mb-3">
{{! Beginn Block Container }}
<div class="card-body p-0">
{{! Block header }}
<div class="block-header">
<h5 class="card-title d-inline">
Wichtige Hinweise zum Umgang mit Passwörtern
</h5>

</div>
{{! Block contents }}
<div class="card-text content p-3">
<p>
<img style="float: right; margin: 5px 0px 5px 5px; max-width: 50%" title="Informationen zum Serverzertifikat in Google Chrome" alt="Informationen zum Serverzertifikat in Google Chrome" src="/imperia/md/content/iv-sicherheit/chrome.png" />
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.
</p>

<h4>Weitere Informationen</h4>
<p><a href="/IV-Sicherheit/flyer/"><span class="fa fa-arrow-circle-o-right" aria-hidden="true"></span>
IV-Sicherheitsflyer</a></p>

<h4>Passwort vergessen?</h4>
<p><a href="/ZIV/MeinZIV/PasswortVergessen.html"><span class="fa fa-arrow-circle-o-right" aria-hidden="true"></span>
Hinweise zum Wiedererlangen vergessener Passwörter und Nutzerkennungen</a></p>

<h4>Nutzerzertifikat beantragen?</h4>
<p><a href="https://www.uni-muenster.de/WWUCA/"><span class="fa fa-arrow-circle-o-right" aria-hidden="true"></span>
Weiterführende Informationen bei der Zertifizierungsstelle der WWU</a></p>
</div>

</div>
{{! End Block Container }}
</section>

{{#hasidentityproviders}}
<div class="subcontent potentialidps">
<h6>{{#str}} potentialidps, auth {{/str}}</h6>
Expand Down
2 changes: 1 addition & 1 deletion templates/menu.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
</li>
<li role="none" class="main-menu-icon-item">
<a role="menuitem" href="{{{ssourl}}}"><span class="underline">
{{#str}}loginSSO_link, auth_sso{{/str}}
{{#str}}loginSSO_link, theme_wwu2019{{/str}}
</span></a>
</li>
{{/login}}
Expand Down