Skip to content

Commit 99fb1c8

Browse files
committed
Merge branch 'MDL-50472-36' of git://github.com/Chocolate-lightning/moodle into MOODLE_36_STABLE
2 parents 2b22c47 + 7c5d2eb commit 99fb1c8

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

auth/classes/output/login.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class login implements renderable, templatable {
7272
public $username;
7373
/** @var string The csrf token to limit login to requests that come from the login form. */
7474
public $logintoken;
75+
/** @var string Maintenance message, if Maintenance is enabled. */
76+
public $maintenance;
7577

7678
/**
7779
* Constructor.
@@ -109,6 +111,10 @@ public function __construct(array $authsequence, $username = '') {
109111
$this->instructions = get_string('loginsteps', 'core', 'signup.php');
110112
}
111113

114+
if ($CFG->maintenance_enabled == true && !empty($CFG->maintenance_message)) {
115+
$this->maintenance = $CFG->maintenance_message;
116+
}
117+
112118
// Identity providers.
113119
$this->identityproviders = \auth_plugin_base::get_identity_providers($authsequence);
114120
$this->logintoken = \core\session\manager::get_login_token();
@@ -145,6 +151,7 @@ public function export_for_template(renderer_base $output) {
145151
$data->signupurl = $this->signupurl->out(false);
146152
$data->username = $this->username;
147153
$data->logintoken = $this->logintoken;
154+
$data->maintenance = format_text($this->maintenance, FORMAT_MOODLE);
148155

149156
return $data;
150157
}

lib/templates/loginform.mustache

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"signupurl": "http://localhost/stable_master/login/signup.php",
3737
"cookieshelpiconformatted": "",
3838
"username": "",
39-
"logintoken": "randomstring"
39+
"logintoken": "randomstring",
40+
"maintenance": "For full access to this site, you need to login in as an admin."
4041
}
4142
}}
4243
{{#hasinstructions}}
@@ -163,6 +164,22 @@
163164
</div>
164165
</div>
165166

167+
{{#maintenance}}
168+
<div class="row justify-content-center mt-3">
169+
<div class="col-xl-6 col-sm-8">
170+
<div class="card">
171+
<div class="card-body">
172+
<div class="card-title">
173+
<h2>{{#str}}sitemaintenance, core_admin{{/str}}</h2>
174+
</div>
175+
<div>
176+
{{{maintenance}}}
177+
</div>
178+
</div>
179+
</div>
180+
</div>
181+
</div>
182+
{{/maintenance}}
166183
{{#js}}
167184
{{#error}}
168185
require(['jquery'], function($) {

0 commit comments

Comments
 (0)