mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
8.4 KiB
8.4 KiB
TODO
Admin area cleanup
- Combine
acces-etudiante.php+file-access.phpintoacces.php(two<section>blocks) - Move
system.phpcontent intoparametres.php(system section + logs section) - Use
<section>for sections,<fieldset>only where form fields are present - Redirect legacy URLs (acces-etudiante.php, file-access.php, system.php) with 301
- Update action redirects to point to new pages
- Update admin nav header (merged 3 items → 2)
Bug fixes
- Fix
$enabledAccessTypesundefined /array_map()TypeError on edit page — controller was fetchinggetAccessTypes()instead ofgetEnabledFormAccessTypes()and returning it under the wrong key - Fix fatal TypeError:
old()called with wrong arity injury-fieldset.phppartial under partage context — removed?: nullcoercions so$juryPresident/$juryPromoteurare''notnull, keeping$addModefalse - Fix
$formDatadestroyed by included partials (fieldset-academic.php,fieldset-metadata.php,fieldset-licence-explanation.phpwere incorrectly unsetting$formData/wrong variable in caller scope)
Form help blocks — sortable admin UI
- Migration 005: add
sort_ordercolumn toform_help_blocks Database::getAllFormHelpBlocks()— ORDER BY sort_order, expose sort_order in returned dataDatabase::reorderFormHelpBlocks(array $keys)— persist new orderactions/form-help-reorder.php— HTMX POST handler (CSRF-protected, 204 response)templates/admin/contenus.php— replace table with two-panel layout:- Left: SortableJS + htmx drag-and-drop card list
- Right: static form structure reference (fieldsets + inputs)
- CSS in admin.css:
.fhb-*classes for layout, cards, ghost/chosen/drag states schema.sql— updatedform_help_blocksDDL withsort_order- Vendor SortableJS 1.15.2 into
assets/js/sortable.min.js(remove CDN dependency)
Bug fixes (continued)
-
Fix missing favicon tags in
partage/recapitulatif.php -
Fix fatal
Class "SmtpRelay" not foundinStudentEmail.php— addrequire_once SmtpRelay.phpbeforeStudentEmail.phpinpartage/index.php -
Add missing favicon tags to all three
<head>blocks inpartage/index.php(error page, password gate, main form)
Rename posterg → xamxam throughout codebase
- Rename
nginx/posterg.conf→nginx/xamxam.conf(+.conf.reference) - Update nginx conf:
server_name, log paths, htpasswd path, header comments - Update
justfile: SSH host alias, group, DB filename, conf path, tmp paths - Update
scripts/deploy-server.sh: group, conf paths, site names, URLs - Update
scripts/setup-server.sh: APP_DIR, APP_GROUP, comments - Update
scripts/manage-admin-users.sh: htpasswd path - Update
scripts/migrate.sh: DB filename - Update
scripts/setup-dev.sh: DB filename - Update
scripts/copy_crash_logs.sh: log filenames, hostname - Update
README.md: SSH host, paths, DB name - Update
nginx/README.md,nginx/SETUP.md, and allnginx/docs/*.md - Update PHP source:
Database.php,SystemController.php,MediaController.php,LiveReloadController.php,SmtpRelay.php,live-reload.php, export actions - Update
app/migrations/run.php,app/tests/README.md,app/storage/README.md - Replace all remaining "Post-ERG" branding with "XAMXAM" (scripts, PHP source, schema, docs)
deploy-server.sh: remove legacysites-enabled/postergsymlink to fix duplicatelimit_req_zonenginx errordeploy-server.sh: auto-migrate.htpasswd-posterg→.htpasswd-xamxamif new file absentdeploy-server.sh: auto-migrateposterg.db→xamxam.dbif new DB missing/empty; remove legacy filedeploy-server.sh: clean up legacy posterg nginx configs and prune old backups- Rename local
storage/posterg.db→storage/xamxam.db
LDAP auth migration (pending client access)
- Get LDAP server hostname, port, service-account DN+password, base DN, user attr, group DN from client
- Verify TCP reachability from XAMXAM VM to LDAP server (port 636)
- See
docs/LDAP_AUTH_PLAN.mdfor full phase-by-phase plan
SMTP transport security hardening
- Enable TLS peer verification (
verify_peer,verify_peer_name,peer_name) on bothsmtpSendandsmtpProbe— removes MITM vulnerability fromverify_peer: false - Add
caBundlePath()— resolves system CA bundle path (php.ini → Debian/RHEL/Alpine candidates → PHP built-in fallback) - Set SSL context options explicitly on socket before
stream_socket_enable_crypto()for STARTTLS (both probe and send paths) - Add
sanitiseEnvelope()— strips CR/LF from envelope addresses to prevent SMTP command injection - Fix RFC 5321 §4.5.2 dot-stuffing: replace
preg_replacewith correct CRLF-normalise →str_replace("\r\n.", "\r\n..")sequence
SMTP notify_email fix
- Migration 006: add
notify_emailcolumn tosmtp_settings SmtpRelay::getSettings()— includenotify_emailin SELECT + defaultsSmtpRelay::updateSettings()— persistnotify_emailSmtpRelay::getNotifyEmail()— returnsnotify_email??from_emailrequest-access.php— usegetNotifyEmail()instead offrom_emailfor admin notificationsactions/settings.php— wiresmtp_notify_emailPOST field- Template: add "Adresse de notification admin" field to SMTP form
schema.sql— updated DDL
SMTP credential validation
- Add
SmtpProbeExceptionwithfieldproperty for structured error classification - Add
SmtpRelay::test()— returns{ok, error, field}with field = input id to highlight smtpProbe()throws typed exceptions per failure point:- connect fail → name resolution error →
smtp_host - connect fail → port refused →
smtp_port - connect fail → timeout →
smtp_host - bad greeting / timeout after connect →
smtp_host/smtp_port - STARTTLS not supported / TLS negotiation fail →
smtp_encryption - AUTH rejected, code 535 →
smtp_password; other auth failures →smtp_username
- connect fail → name resolution error →
actions/settings.php: store$_SESSION['_flash_smtp_field']on probe failureparametres.phpcontroller: consume + clear_flash_smtp_fieldinto$smtpErrorField- Template:
aria-invalid,aria-describedby, inline<small class="param-field-error">per field - JS: scroll + focus the offending field on page load
- CSS: red
border-bottomon[aria-invalid],.param-field-errorerror text style
Répertoire layout
- Make column headings sticky/non-scrollable; only
ulscrolls per column - Remove padding from
.search-mainand.repertoire-index - Minimal horizontal padding inside columns (
var(--space-2xs)) - Align all column headings to the same baseline row (2-row grid via
display: contents)
SMTP 550 recipient-rejected handling
- Add
SmtpSendException— carriessmtpCode+smtpResponse;isRecipientRejected()for 550–554 smtpSend()$expectclosure throwsSmtpSendException(with code) instead of plainRuntimeExceptionSmtpRelay::send()re-throwsSmtpSendExceptionso callers can reactrequest-access.php(new auto-approve): catch 550 → roll back token + approval, return HTTP 422 with user-facing messagerequest-access.php(resend path): catch 550 → return HTTP 422 instead of silent "access approved"StudentEmail::sendConfirmation(): catchSmtpSendException→ log + return false (submission must not be aborted)admin/actions/access-request.php: catchSmtpSendExceptionafter approval → flash warning distinguishing recipient-rejected vs transientdocs/SMTP_550_POSTFIX_FIX.md— report for Postfix admin (diagnosis, 3 fix options, verification steps)
CSS refactor
- Move semantic HTML element baseline styles into common.css
fieldset(background, border, padding, radius)legend(font, weight, color, transform)small(size, color, display, margin)table,th,td(collapse, sizing, spacing)dialog+::backdropdetails > summary
- Remove duplicated rules from admin.css, form.css, system.css, file-access.css
- Fix file-access.css to use real design tokens (was using undefined --border, --surface, --accent, etc.)
- Remove redundant @import url("./variables.css") from admin.css, system.css, file-access.css