mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
- ThesisCreateController: comma-split auteurice, sort alphabetically, use setThesisAuthors() instead of hardcoded createThesis() author_id - Database::createThesis(): removed author_id param and hardcoded insert - Database::findDuplicateThesis(): accepts array of author names, matches any shared author via IN + DISTINCT - ThesisEditController::save(): sort authors alphabetically on save - File folder naming: slug from all authors alphabetically sorted - v_theses_full GROUP_CONCAT: ORDER BY a.name ASC for deterministic display - Migration 012_author_view_order.sql: rebuilds view with alphabetical order
6.3 KiB
6.3 KiB
XAMXAM TODO
Duplicate TFE submission prevention (fixes)
DuplicateThesisException— typed exception carrying existing thesis metadataDatabase::findDuplicateThesis()— year + author + normalised-title matching (exact, prefix, Levenshtein ≤10%)ThesisCreateController::submit()— calls duplicate check before any DB write, throwsDuplicateThesisExceptionAppLogger::logDuplicate()— dedicated log action (status: duplicate) for audit trailApp::flash/consumeFlash— extended to supportwarningtype alongsideerror/successadmin/actions/formulaire.php— catchesDuplicateThesisExceptionseparately; logs it; flashes HTML warning with link to existing thesis; repopulates formpartage/index.php— same catch block; plain-text warning (no admin link) surfaced on the student form viaflash-warningbanner; form repopulatedtoast.php— renderstoast--warningblockadmin.css—.toast--warningstyle + link colourform.css—.flash-warningstyle (partage form)
Admin audit logging
AdminLoggerclass — JSON-lines to/var/log/xamxam.log(prod) orstorage/logs/admin.log(dev), mirrors toadmin_audit_logDB tableadmin_audit_logDB table — created in schema + migratedshare_links.is_archivedcolumn — archive replaces delete; stats preservedShareLink::archive()— new method;toggleActivereturns new state;listActive()/listArchived()split;validateLinkblocks archived slugsactions/acces-etudiante.php— delete→archive, all actions logged (create, toggle, set_password, archive)actions/publish.php— publish/unpublish loggedactions/delete.php— delete / bulk-delete / delete-all loggedactions/visibility.php— visibility changes loggedactions/export-csv.php— CSV export loggedactions/export-db.php— DB export loggedactions/edit.php— TFE edit loggedactions/formulaire.php— TFE add from admin loggedactions/tag.php— rename/merge/delete loggedactions/page.php— static page edits loggedactions/apropos.php— à-propos edits loggedactions/form-help.php— form structure edits loggedactions/access-request.php— approve/reject loggedactions/maintenance.php— maintenance on/off loggedactions/settings.php— formulaire toggles, objet types, SMTP update loggedactions/smtp-test.php— SMTP test loggedtemplates/admin/acces.php— archive button, archived links collapsible sectionscripts/setup-server.sh— provision/var/log/xamxam.logwith correct ownership
Multi-author support
ThesisCreateController::validateAndSanitise()— comma-splitauteurice, sort alphabetically, build author entries arrayDatabase::createThesis()— removed hardcodedauthor_idinsert; authors linked viasetThesisAuthors()insteadThesisEditController::save()— authors sorted alphabetically beforesetThesisAuthors()Database::findDuplicateThesis()— acceptsarrayof author names, matches any shared author viaIN+DISTINCT- File folder naming — slug generated from all authors alphabetically sorted (both create and edit)
v_theses_fullGROUP_CONCAT —ORDER BY a.name ASCfor deterministic alphabetical display- Migration
012_author_view_order.sql— rebuilds view with alphabetical author ordering
Fix remote 500s and broken TFE pages (post-deploy)
migrations/pending/008_share_links_is_archived.sql—ALTER TABLE share_links ADD COLUMN is_archived(missing on remote; breaksacces.php)migrations/pending/009_admin_audit_log.sql—CREATE TABLE admin_audit_log(missing on remote)migrations/pending/010_smtp_notify_email.sql—ALTER TABLE smtp_settings ADD COLUMN notify_email(missing on remote; breaksparametres.phpviaSmtpRelay::getSettings())migrations/pending/011_thesis_files_sort_and_label.sql—ALTER TABLE thesis_files ADD COLUMN sort_order / display_label(missing on remote; breaks every public TFE detail page)justfile— addeddeploy-migraterecipe: SSHes to remote and runsphp migrations/run.php
Replace browser dialogs with <dialog> modals
admin/index.php—alert()(no selection) →<dialog id="no-selection-dialog">;confirm()bulk publish/unpublish →<dialog id="bulk-confirm-dialog">;confirm()bulk delete →<dialog id="bulk-delete-dialog">;confirm()single delete →<dialog id="delete-thesis-dialog">; inlineconfirm()on Dépublier button removed (no confirmation needed for reversible action)admin/tags.php—confirm()merge →<dialog id="merge-tag-dialog">;confirm()delete →<dialog id="delete-tag-dialog">admin/acces-etudiante.php—confirm()delete link →<dialog id="delete-link-dialog">admin/acces.php—confirm()archive link →<dialog id="archive-link-dialog">admin/parametres.php—confirm()enable maintenance →<dialog id="enable-maintenance-dialog">;confirm()delete all TFE →<dialog id="delete-all-tfe-dialog">; admin passwordconfirm()kept withTODOcommentadmin/account.php— admin passwordconfirm()kept withTODOcommentadmin.css— added.admin-dialog--sm,.admin-dialog__alert,.admin-dialog__footerstyles
Fix 403 on HTMX tab requests in parametres.php
AdminAuth::requireLogin()— now sets$_SESSION[SESSION_KEY]when accepting nginx Basic Auth credentials (was returning early without marking the session)AdminAuth::isAuthenticated()— now falls back toPHP_AUTH_PWverification (same logic asrequireLogin) so HTMX requests tosystem-fragment.phpauthenticate even before a session exists
Duplicate warning display fixes
toast-fragment.php— 204 guard now also checkswarning; warning was silently discarded beforepartage/index.php— warning stored as plain text (no pre-escaping);htmlspecialchars()applied once at render; was double-encoded beforepartage/index.php—flash-warningdiv getsid+tabindex=-1; inline JS scrolls and focuses it on loadadmin/footer.php—htmx:afterSettlelistener focuses.toast--warningafter HTMX injects the toast fragment