Skip to content

Commit c5fe7d0

Browse files
committed
force commit
1 parent 3dcb173 commit c5fe7d0

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>Campus Hub Check-In</title>
7+
<title>Control de Acceso Robotech</title>
88
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
99
<link rel="stylesheet" href="style.css">
1010
</head>
1111
<body>
1212
<div class="app-container">
1313
<header class="header">
14-
<h1 class="header-title">Campus Hub</h1>
14+
<h1 class="header-title">Control de Acceso Robotech</h1>
1515
<div class="header-actions">
1616
<div id="loginSection" class="login-section">
17-
<input type="text" id="loginDniInput" placeholder="Introduce tu DNI" class="login-input">
17+
<input type="text" id="loginDniInput" placeholder="Introduce tu Username" class="login-input">
1818
<button class="button" id="loginBtn">Entrar</button>
1919
</div>
2020
<div id="loggedInSection" class="logged-in-section hidden">
@@ -119,12 +119,12 @@ <h3 class="card-title">Acciones de Emergencia</h3>
119119
</div>
120120

121121
<div class="admin-table-section">
122-
<h3>DNI Autorizados</h3>
122+
<h3>Username Autorizados</h3>
123123
<div class="table-container">
124124
<table id="authorizedDnisTable" class="data-table">
125125
<thead>
126126
<tr>
127-
<th>DNI</th>
127+
<th>Username</th>
128128
<th>Admin</th>
129129
<th>Acción</th>
130130
</tr>
@@ -133,7 +133,7 @@ <h3>DNI Autorizados</h3>
133133
</table>
134134
</div>
135135
<div class="form-actions-inline">
136-
<input type="text" id="newDniInput" placeholder="Añadir nuevo DNI">
136+
<input type="text" id="newDniInput" placeholder="Añadir nuevo Username">
137137
<div class="checkbox-container">
138138
<input type="checkbox" id="isAdminCheckbox"> <label for="isAdminCheckbox">Es admin</label>
139139
</div>

script.js

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ const firebaseConfig = {
1414
firebase.initializeApp(firebaseConfig);
1515
const db = firebase.firestore();
1616

17-
const HARDCODED_ADMIN_DNI = 'ADMIN';
18-
1917
// ===============================================
2018
// Variables de Estado y Sincronización
2119
// ===============================================
@@ -83,10 +81,7 @@ const ELEMENTS = {
8381
// Funciones de Sincronización con Firebase
8482
// ===============================================
8583
async function loadStateFromFirebase() {
86-
const adminDoc = await db.collection('authorizedUsers').doc(HARDCODED_ADMIN_DNI).get();
87-
if (!adminDoc.exists) {
88-
await addAuthorizedDni(HARDCODED_ADMIN_DNI, true);
89-
}
84+
9085

9186
db.collection('authorizedUsers').onSnapshot(snapshot => {
9287
authorizedUsers = {};
@@ -324,13 +319,7 @@ async function loginUser() {
324319
return;
325320
}
326321

327-
if (dni === HARDCODED_ADMIN_DNI) {
328-
loggedInUser = dni;
329-
isAdmin = true;
330-
setCookie('userDni', dni, 30);
331-
renderMainUI();
332-
ELEMENTS.loginDniInput.value = '';
333-
} else {
322+
334323
const userDoc = await db.collection('authorizedUsers').doc(dni).get();
335324
if (userDoc.exists) {
336325
loggedInUser = dni;
@@ -341,7 +330,7 @@ async function loginUser() {
341330
} else {
342331
alert('DNI no autorizado.');
343332
}
344-
}
333+
345334
}
346335

347336
function logoutUser() {
@@ -548,10 +537,6 @@ async function addDni() {
548537
return;
549538
}
550539

551-
if (newDni === HARDCODED_ADMIN_DNI) {
552-
alert('No puedes añadir o modificar el DNI de administrador por defecto.');
553-
return;
554-
}
555540

556541
const userDoc = await db.collection('authorizedUsers').doc(newDni).get();
557542

0 commit comments

Comments
 (0)