Commit Graph

19 Commits

Author SHA1 Message Date
Naiel
a8936e55a2 Add organization management functionality and logo image
- Implemented organization creation, editing, and activity management in orgs.php.
- Added safe path segment function to sanitize input.
- Included file upload handling for activity photos.
- Created a new logo image for the application.
2026-03-07 12:30:08 +00:00
copilot-swe-agent[bot]
0c362fd40b feat: SQLite DB with migrations replaces all JSON file storage
- Add db.php with PDO singleton, migration runner, and all helper functions
- Add migrations/001_initial_schema.sql (full schema)
- Add migrations/002_import_json.php (one-time JSON → DB importer)
- Add _incl/switch_tenant.php POST endpoint for tenant/centro switching
- Update tools.auth.php: DB-backed login, cookie auth, session reload, init_active_centro()
- Update all sysadmin pages (users, centros, aularios, invitations, reset_password) to use DB
- Update aulatek/index.php, aulario.php, supercafe.php, supercafe_edit.php to use DB
- Update aulatek/comedor.php and api/comedor.php to use DB
- Update aulatek/paneldiario.php: aulario config + comedor data from DB
- Update aulatek/proyectos.php: aulario config + sharing metadata from DB
- Update club/cal.php, index.php, edit_data.php, upload/upload.php to use DB
- Update account/index.php: rich profile, tenant list, aula list, session info, permissions
- Update pre-body.php account dropdown: shows active org + inline tenant switcher
- Update DATA_STRUCTURE.md to document DB approach and migration system

Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
2026-03-06 22:00:48 +00:00
naielv
1b3f4b619f Refactor seguridad: agregar funciones de sanitización y reestructurar código en varios archivos 2026-02-26 23:27:44 +01:00
copilot-swe-agent[bot]
6e4496b050 SuperCafe: use Alumnos for persons, fix sysadmin add-user form
Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
2026-02-21 21:07:46 +00:00
copilot-swe-agent[bot]
69d7e46dc8 Add SuperCafe module inside EntreAulas based on TeleSec supercafe.js
Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
2026-02-21 19:12:26 +00:00
copilot-swe-agent[bot]
ffb6b6ce45 Security: fix auth bypass, open redirects, cookie security, OAuth CSRF, and Sf() misuse
- Fix critical inverted authentication logic in tools.auth.php (password_verify was inverted)
- Fix broken Sf() misuse for username lookups (was always returning empty string)
- Add safe_username_to_filename() to tools.security.php for proper username handling
- Fix open redirect vulnerability in _login.php for all redirect targets
- Add HttpOnly, Secure, SameSite cookie flags to all setcookie() calls
- Add CSRF nonce to OAuth state parameter and verify it on callback
- Add session_regenerate_id(true) after successful login
- Remove redundant session_regenerate_id() from tools.session.php (was called on every request)
- Add authentication check to entreaulas/_filefetch.php
- Fix broken Sf() usage in entreaulas pages (aulario.php, comedor.php, diario.php, paneldiario.php, proyectos.php, api/comedor.php)
- Fix broken Sf() usage in sysadmin/users.php and sysadmin/reset_password.php

Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
2026-02-21 18:55:06 +00:00
naielv
57ec8e57fc Refactor: update path for tools.security.php inclusion across multiple files 2026-02-19 22:45:15 +01:00
copilot-swe-agent[bot]
a095c91f5e Security: comprehensive filename sanitization, MIME validation, atomic file writes, and path deduplication
Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
2026-02-19 14:55:12 +00:00
Naiel
192002880a Refactor input sanitization functions and improve file path handling across multiple files
- Introduced `safe_id_segment`, `safe_centro_id`, and `safe_aulario_config_path` functions to sanitize input and construct file paths securely.
- Updated `index.php`, `paneldiario.php`, `proyectos.php`, `aularios.php`, `centros.php`, `club_mkthumb.php`, `reset_password.php`, and `users.php` to utilize new sanitization functions.
- Enhanced error handling for file existence checks and directory traversal prevention.
- Ensured consistent use of safe path handling in user input across the application.
2026-02-19 14:45:51 +00:00
copilot-swe-agent[bot]
1c5533c13d Address code review findings - add username validation and fix edge cases
Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
2026-02-19 09:32:46 +00:00
copilot-swe-agent[bot]
c9b5a1058f Apply security fixes for path validation and file handling
Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
2026-02-19 09:31:25 +00:00
naielv
98f430188c Enhance security and input sanitization across multiple files
- Added a new tools.security.php file containing functions for sanitizing filenames, paths, and user inputs to prevent directory traversal and XSS attacks.
- Updated various files to utilize the new sanitization functions (Sf, Si) for user inputs and file operations, ensuring safer handling of data.
- Improved HTML output safety by applying htmlspecialchars to user-generated content in pre-body.php, cal.php, and other relevant files.
- Refactored user authentication and data retrieval processes in tools.auth.php and _login.php to enhance security and maintainability.
- Ensured consistent use of sanitization functions in API endpoints and admin functionalities to mitigate potential security vulnerabilities.
2026-02-18 23:22:58 +01:00
naielv
6620980f02 Finished (for now) projects module, with secure PDF viewer. 2026-02-01 14:18:37 +01:00
naielv
dbe4601f65 update 2026-01-29 22:11:09 +01:00
naielv
436fd17cc6 Fix nav, paneldiario, index logout url, Refactor card-body divs to improve consistency across multiple files 2026-01-28 20:24:16 +01:00
naielv
2e956575aa Now using bootstrap 2026-01-27 19:21:49 +01:00
naielv
c8b22da45f fix sysadmin 2026-01-27 18:06:23 +01:00
naielv
37585269b8 update 2026-01-26 22:53:03 +01:00
naielv
5f45017997 update many stuff 2026-01-25 23:23:22 +01:00