CashMan H.A. organizes every authenticated user into one of five roles. Each role maps to a dedicated portal with its own dashboard, navigation, and permitted operations. Role assignment is managed by an Administrator at registration time and is stored as an integer ID in both the database and the active PHP session. Every protected route inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/DanielRivera03/SistemaBancario/llms.txt
Use this file to discover all available pages before exploring further.
cGestionesCashman.php checks $_SESSION['id_rol'] before rendering any view, ensuring users can never access functionality outside their assigned role.
Role Overview
| Role ID | Name (ES / EN) | Description | Dashboard Route |
|---|---|---|---|
| 1 | Administrador / Administrator | Full system control: user registration, role management, product management, savings account operations, all reports and queries. Generates initial credential PDFs for every new user. | ?cashmanhagestion=inicioadministradores |
| 2 | Presidencia / Presidency | Final credit approval authority, executive dashboards, product catalog editing, and high-level transaction reports. | ?cashmanhagestion=iniciopresidencia |
| 3 | Gerencia / Management | First-level credit review and recommendation, transaction management, and management-level operational reports. | ?cashmanhagestion=iniciogerencia |
| 4 | Atención al Cliente / Customer Service | Processes savings account deposits, withdrawals, and openings; assists clients with queries; handles support tickets. | ?cashmanhagestion=inicioatencionclientes |
| 5 | Clientes / Client | Self-service portal: view credit status, make loan installment payments, transfer funds between savings accounts, send messages, and download statements and payment receipts. | ?cashmanhagestion=inicioclientes |
Additional roles can be registered in the database, but doing so requires significant code-level changes throughout both controllers and all associated views to wire up the new role’s portal and permissions.
Access Control Mechanism
Role enforcement is applied inline within everycase block of cGestionesCashman.php. Before any model call or view include is executed, the controller compares $_SESSION['id_rol'] against the expected integer for that route. If the check fails, the user is immediately redirected to the system redirection handler:
redirecciones-sistema-cashmanha case acts as a central routing fallback that inspects the session role and forwards the user to their correct home dashboard, preventing any cross-role view exposure.
Session Variables
When a user successfully authenticates throughcIniciosSesionesUsuarios.php?cashmanha=validar-sesiones, the following session keys are populated from the database record returned by the IniciarSesion stored procedure:
| Session Key | Source Column | Description |
|---|---|---|
$_SESSION['id_usuario'] | idusuarios | Unique numeric user ID |
$_SESSION['nombre_usuario'] | nombres | User’s first name(s) |
$_SESSION['apellido_usuario'] | apellidos | User’s last name(s) |
$_SESSION['usuario_unico'] | codigousuario | Unique username / login handle |
$_SESSION['id_rol'] | idrol | Integer role ID (1–5) used for all access checks |
$_SESSION['correo_usuario'] | correo | Email address (used for SMTP notifications) |
$_SESSION['foto_perfil'] | fotoperfil | Profile photo filename |
$_SESSION['estado_usuario'] | estado_usuario | Account status flag |
$_SESSION['comprobar_iniciosesion_primeravez'] | nuevousuario | First-login flag — triggers mandatory credential setup |
$_SESSION['habilitar_sistema'] | habilitarsistema | Whether the user’s associated credit has been approved |
$_SESSION['comprobacioncuenta_ahorros'] | poseecuenta | Whether the user holds a savings account |
$_SESSION['comprobacioncreditos_clientes'] | poseecredito | Whether the user has an active credit on record |
First-Login Credential Setup
Thecomprobar_iniciosesion_primeravez flag (sourced from the nuevousuario column) identifies users who are logging in for the first time. When this flag is set, the system enforces a mandatory credential-change flow before granting full portal access.
Why is this required for all new users?
Why is this required for all new users?
When an Administrator registers a new user, the system generates a PDF containing the user’s initial login credentials. Those credentials are considered temporary. The first-login flag ensures that every new user — whether administrative staff or a client — must immediately set a personal password (and optionally a new unique username, depending on their role) before they can access their portal. This prevents any user from operating under the default credentials distributed at registration.
habilitar_sistema controls whether Client-role users can access the full self-service portal. If a client’s associated credit application has not yet been approved, certain functions remain locked until the approval workflow completes.