production hardening: future-date guard, per-day hour cap, totalHours in history, header cleanup

This commit is contained in:
BizzleBot
2026-02-19 04:48:43 +00:00
parent 47c35c1e3a
commit a0234cdd31
11 changed files with 222 additions and 51 deletions
+14
View File
@@ -281,6 +281,20 @@ function ManageUsers() {
<option value="office">Office Staff</option>
{user?.role === 'super_admin' && <option value="super_admin">Admin</option>}
</select>
<button
onClick={async () => {
const newPass = prompt(`Reset password for ${u.name}?\nEnter new password (min 8 characters):`);
if (!newPass || newPass.length < 8) { if (newPass) alert('Password must be at least 8 characters'); return; }
try {
await api.put(`/admin/users/${u.id}/reset-password`, { newPassword: newPass });
alert(`Password reset for ${u.name}. They can now log in with the new password.`);
} catch (err) { alert(err.response?.data?.error || 'Failed to reset password'); }
}}
className="text-xs px-2.5 py-1.5 rounded-lg bg-amber-50 dark:bg-amber-500/10 text-amber-600 dark:text-amber-400 hover:bg-amber-100 dark:hover:bg-amber-500/20 font-medium"
title="Reset Password"
>
🔑 Reset PW
</button>
{u.isActive === false ? (
<button
onClick={async () => {