-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
34 lines (29 loc) · 1.3 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
document.getElementById("createUserBtn").onclick = function() {
document.getElementById("adminLoginModal").style.display = "block";
}
function closeAdminLoginModal() {
document.getElementById("adminLoginModal").style.display = "none";
}
function closeCreateUserModal() {
document.getElementById("createUserModal").style.display = "none";
}
function adminLogin() {
var adminUsername = document.getElementById("adminUsername").value;
var adminPassword = document.getElementById("adminPassword").value;
// Simulación de verificación de credenciales de administrador
if ((adminUsername === "admin" || adminUsername === "root") && adminPassword === "adminpassword") {
document.getElementById("adminLoginModal").style.display = "none";
document.getElementById("createUserModal").style.display = "block";
} else {
alert("Credenciales de administrador incorrectas");
}
}
// Cerrar el modal cuando el usuario hace clic fuera de él
window.onclick = function(event) {
if (event.target == document.getElementById("adminLoginModal")) {
document.getElementById("adminLoginModal").style.display = "none";
}
if (event.target == document.getElementById("createUserModal")) {
document.getElementById("createUserModal").style.display = "none";
}
}