Commit 8a9acc50 authored by Robin Appelman's avatar Robin Appelman
Browse files

Allow custom error messages for the login page

parent 857695ec
......@@ -19,6 +19,11 @@ script('core', [
<small><?php p($l->t('Please contact your administrator.')); ?></small>
</div>
<?php endif; ?>
<?php foreach($_['messages'] as $message): ?>
<div class="warning">
<?php p($message); ?><br>
</div>
<?php endforeach; ?>
<p id="message" class="hidden">
<img class="float-spinner" alt=""
src="<?php p(\OCP\Util::imagePath('core', 'loading-dark.gif'));?>" />
......
......@@ -778,12 +778,14 @@ class OC_Util {
/**
* @param array $errors
* @param string[] $messages
*/
public static function displayLoginPage($errors = array()) {
public static function displayLoginPage($errors = array(), $messages = []) {
$parameters = array();
foreach ($errors as $value) {
$parameters[$value] = true;
}
$parameters['messages'] = $messages;
if (!empty($_REQUEST['user'])) {
$parameters["username"] = $_REQUEST['user'];
$parameters['user_autofocus'] = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment