-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from G10-ISPC/DelfinaAricoma
Añadi roles(un administrador y un usuario)
- Loading branch information
Showing
6 changed files
with
36 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,16 +30,40 @@ document.addEventListener('DOMContentLoaded', function() { | |
} | ||
|
||
|
||
/*Roles: | ||
1:Administrador | ||
2:Cliente */ | ||
|
||
var listUsers= | ||
[//nombre apellido correo contraseña rol | ||
['NombreAdm1','ApellidoAdm1','[email protected]','1234Admi','1'], | ||
['NombreCliente1','ApellidoCliente1','[email protected]','1234Cliente','2'] | ||
]; | ||
|
||
|
||
|
||
|
||
|
||
emailInput.addEventListener('input', validarEmail); | ||
contrasenaInput.addEventListener('input', validarContrasena); | ||
|
||
|
||
submitButton.addEventListener('click', function(event) { | ||
if (emailRegExpression.test(emailInput.value) && passwordRegExpression.test(contrasenaInput.value)) { | ||
emailInput.value = ''; | ||
contrasenaInput.value = ''; | ||
mensajeError.textContent = ''; | ||
window.location= "https://g10-ispc.github.io/IntegradorFullStack-G10/ricco/frontend/index.html"; | ||
if (emailRegExpression.test(emailInput.value) && passwordRegExpression.test(contrasenaInput.value) ) { | ||
if (emailInput.value==listUsers[0][2] && contrasenaInput.value==listUsers[0][3] && listUsers[0][4]=="1"){ | ||
window.location= "administrador.html"; | ||
window.alert('¡Bienvenido Administrador!'); | ||
} | ||
if(emailInput.value==listUsers[1][2] && contrasenaInput.value==listUsers[1][3] && listUsers[1][4]=="2") { | ||
window.location= "../index.html"; | ||
window.alert('Ricco Burgers valora a cada uno de sus clientes, ¡Bienvenido!'); | ||
} | ||
else{ | ||
mensajeError.textContent = 'Su correo no posee una cuenta, debe registrarse.';} | ||
//emailInput.value = ''; | ||
//contrasenaInput.value = ''; | ||
//mensajeError.textContent = ''; | ||
|
||
} else { | ||
event.preventDefault(); | ||
mensajeError.textContent = 'E-mail o contraseña incorrecta.'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters