Skip to content

Commit

Permalink
New jnotify for login errors (#30277)
Browse files Browse the repository at this point in the history
* New jnotify for login errors

* fix to be ceznter

* fix top

---------

Co-authored-by: Hystepik <[email protected]>
Co-authored-by: Laurent Destailleur <[email protected]>
  • Loading branch information
3 people committed Jul 20, 2024
1 parent 87065f0 commit 88518a8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
36 changes: 25 additions & 11 deletions htdocs/core/tpl/login.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,20 +400,34 @@
<?php
// Show error message if defined
if (!empty($_SESSION['dol_loginmesg'])) {
?>
<div class="center login_main_message">
<?php
$message = $_SESSION['dol_loginmesg']; // By default this is an error message
if (preg_match('/<!-- warning -->/', $message)) { // if it contains this comment, this is a warning message
$message = str_replace('<!-- warning -->', '', $message);
print '<div class="warning" role="alert">';
if (!empty($conf->use_javascript_ajax)) {
if (preg_match('/<!-- warning -->/', $message)) { // if it contains this comment, this is a warning message
$message = str_replace('<!-- warning -->', '', $message);
dol_htmloutput_mesg($message, array(), 'warning');
} else {
dol_htmloutput_mesg($message, array(), 'error');
}
print '<script>
$(document).ready(function() {
$(".jnotify-container").addClass("jnotify-container-login");
});
</script>';
} else {
print '<div class="error" role="alert">';
?>
<div class="center login_main_message">
<?php
if (preg_match('/<!-- warning -->/', $message)) { // if it contains this comment, this is a warning message
$message = str_replace('<!-- warning -->', '', $message);
print '<div class="warning" role="alert">';
} else {
print '<div class="error" role="alert">';
}
print dol_escape_htmltag($message);
print '</div>'; ?>
</div>
<?php
}
print dol_escape_htmltag($message);
print '</div>'; ?>
</div>
<?php
}

// Add commit strip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
overflow-y: auto;
}

.jnotify-container-login {
left: 40% !important;
right: auto !important;
top: 20%;
}

.jnotify-container .jnotify-notification {
position: relative;
margin-top: 4px;
Expand Down

0 comments on commit 88518a8

Please sign in to comment.