-// Copyright (c) 2016-2022 by the citadel.org team
+// Copyright (c) 2016-2023 by the citadel.org team
//
-// This program is open source software. It runs great on the
-// Linux operating system (and probably elsewhere). You can use,
-// copy, and run it under the terms of the GNU General Public
-// License version 3. Richard Stallman is an asshole communist.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
+// This program is open source software. Use, duplication, or
+// disclosure is subject to the GNU General Public License v3.
// This is where the login screen (modal) is displayed.
// It appears in the "ctdl_big_modal" div which is defined in index.html and is used for several different modals.
// If you want to change the look of the login dialog, this is where to change it.
function display_login_screen(any_message) {
- document.getElementById("ctdl_big_modal").innerHTML =
- "<div class=\"w3-modal-content w3-animate-zoom\">"
- + "<div class=\"w3-panel w3-border w3-border-blue w3-topbar w3-bottombar w3-leftbar w3-rightbar\"><center>"
- + "<p>FIXME put a login banner here, dummy</p>"
- + "<p>" + any_message + "</p>"
- + "<table border=0><tr><td>"
- + _("User name:") + "</td><td><input type=\"text\" id=\"username\"></td></tr><tr><td>"
- + _("Password:") + "</td><td><input type=\"password\" id=\"password\"></td></tr></table><br>"
- + "<p>"
- + "<button class=\"w3-button w3-blue\" onClick=\"javascript:login_button()\">" + _("Log in") + "</button>"
- + "</p>"
- + "</center></div>"
- + "</div>";
+ document.getElementById("ctdl_big_modal").innerHTML = `
+
+ <div class="ctdl-modal-header">
+ <span><i class="fa fa-user"></i></span>
+ <span>${any_message}</span>
+ </div>
+
+ <div class="ctdl-login-screen-grid-container">
+ <div class="ctdl-login-screen-grid-item"><label><b>${_("User name:")}</b></label></div>
+ <div class="ctdl-login-screen-grid-item"><input type="text" id="username" required></div>
+ <div class="ctdl-login-screen-grid-item"><label><b>${_("Password:")}</b></label></div>
+ <div class="ctdl-login-screen-grid-item"><input type="password" id="password" required></div>
+ <div class="ctdl-login-screen-grid-item"></div>
+ <div class="ctdl-login-screen-grid-item">
+ <input type="checkbox" checked="checked">
+ Remember me
+ </div>
+ <div class="ctdl-login-screen-grid-item"></div>
+ <div class="ctdl-login-screen-grid-item">
+ <button onClick="javascript:login_button()">${_("Log in")}</button>
+ <button type="button">Cancel</button>
+ </div>
+ </div>
+ `;
+
document.getElementById("ctdl_big_modal").style.display = "block";
}
// When the user elects to log out, we just call /ctdl/a/logout and let the system flush the session.
// When we go back to ctdl_startup() it will detect that we are no longer logged in, and do the right thing.
//function logout() {
-logout = async() => {
- response = await fetch("/ctdl/a/logout");
- ctdl_startup(); // let the regular startup code take care of everything else
-}
+//logout = async() => {
+ //response = await fetch("/ctdl/a/logout");
+ //ctdl_startup(); // let the regular startup code take care of everything else
+//}
function login_button(username) {