Allow custom error messages for the login page
This commit is contained in:
parent
857695ec87
commit
8a9acc5083
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue