Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New jnotify for login errors #30277

Merged
merged 4 commits into from
Jul 20, 2024
Merged
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
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