mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 11:39:18 +02:00
Requirements: - parametres.php toggle: 'restricted_files_enabled' enables/disables the feature - Public TFE page: when enabled + access_type=Interne, hides files, shows French restriction message + access request form (metadata/synopsis still visible) - ERG emails (@erg.school / @erg.be): auto-approve, send 24h access link immediately - External emails: show justification textarea, create pending request, notify admin - Admin panel /admin/file-access.php: approve/reject requests with optional notes, sends access email on approval (linked from admin nav with pending count badge) Security: - One-time 24h email tokens (used_at + is_valid=0 on first click) - Token redeemed via POST /validate-access (GET shows confirmation page only) - Long-lived 30-day browser session in file_access_sessions table - Cookie: HttpOnly + Secure + SameSite=Strict - CSRF on all mutations, rate limiting on request submission - Audit trail: IP, UA, event, timestamp in file_access_audit Bug fixes: - admin/file-access.php: $vars never extract()ed → page was blank - Template had self-contained head/footer includes (double-include) - Admin approval URL used $requestId instead of $request['thesis_id'] - App::boot() now starts session so CSRF token works on public pages - Dispatcher routes /validate-access and /request-access through front controller
283 lines
5.6 KiB
CSS
283 lines
5.6 KiB
CSS
/* ============================================================
|
|
FILE ACCESS REQUESTS — ADMIN PAGE
|
|
============================================================ */
|
|
|
|
@import url("./variables.css");
|
|
|
|
.access-req-stats {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
|
gap: var(--space-m);
|
|
margin-bottom: var(--space-l);
|
|
}
|
|
|
|
.access-req-stat-card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
padding: var(--space-m);
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.access-req-stat-number {
|
|
font-size: var(--step-2);
|
|
font-weight: 700;
|
|
color: var(--text-primary);
|
|
line-height: 1;
|
|
}
|
|
|
|
.access-req-stat-label {
|
|
font-size: var(--step--1);
|
|
color: var(--text-secondary);
|
|
margin-top: var(--space-3xs);
|
|
}
|
|
|
|
/* Tab navigation */
|
|
.access-req-tabs {
|
|
display: flex;
|
|
gap: var(--space-xs);
|
|
margin-bottom: var(--space-l);
|
|
border-bottom: 2px solid var(--border);
|
|
}
|
|
|
|
.access-req-tab {
|
|
padding: var(--space-2xs) var(--space-s);
|
|
color: var(--text-secondary);
|
|
text-decoration: none;
|
|
border-bottom: 2px solid transparent;
|
|
margin-bottom: -2px;
|
|
transition: color 0.2s, border-color 0.2s;
|
|
}
|
|
|
|
.access-req-tab:hover {
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.access-req-tab.active {
|
|
color: var(--accent);
|
|
border-bottom-color: var(--accent);
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* Empty state */
|
|
.access-req-empty {
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
padding: var(--space-xl);
|
|
text-align: center;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
/* Request list */
|
|
.access-req-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-m);
|
|
}
|
|
|
|
.access-req-card {
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
padding: var(--space-m);
|
|
transition: box-shadow 0.2s;
|
|
}
|
|
|
|
.access-req-card:hover {
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.access-req-card__header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: flex-start;
|
|
gap: var(--space-m);
|
|
margin-bottom: var(--space-s);
|
|
}
|
|
|
|
.access-req-card__thesis h3 {
|
|
font-size: var(--step-1);
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
margin: 0 0 var(--space-3xs) 0;
|
|
line-height: 1.3;
|
|
}
|
|
|
|
.access-req-card__authors {
|
|
font-size: var(--step--1);
|
|
color: var(--text-secondary);
|
|
margin: 0;
|
|
}
|
|
|
|
.access-req-card__meta {
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.access-req-badge {
|
|
display: inline-block;
|
|
padding: var(--space-3xs) var(--space-2xs);
|
|
border-radius: 12px;
|
|
font-size: var(--step--2);
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
|
|
.access-req-badge--pending {
|
|
background: #fef3c7;
|
|
color: #92400e;
|
|
}
|
|
|
|
.access-req-badge--approved {
|
|
background: #d1fae5;
|
|
color: #065f46;
|
|
}
|
|
|
|
.access-req-badge--rejected {
|
|
background: #fee2e2;
|
|
color: #991b1b;
|
|
}
|
|
|
|
.access-req-card__body {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-s);
|
|
}
|
|
|
|
.access-req-card__info {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: var(--space-m);
|
|
font-size: var(--step--1);
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.access-req-card__info strong {
|
|
color: var(--text-primary);
|
|
margin-right: var(--space-3xs);
|
|
}
|
|
|
|
.access-req-card__info a {
|
|
color: var(--accent);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.access-req-card__info a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.access-req-card__justification,
|
|
.access-req-card__admin-notes {
|
|
background: var(--background);
|
|
padding: var(--space-s);
|
|
border-radius: 4px;
|
|
font-size: var(--step--1);
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.access-req-card__justification strong,
|
|
.access-req-card__admin-notes strong {
|
|
display: block;
|
|
margin-bottom: var(--space-3xs);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.access-req-card__justification p,
|
|
.access-req-card__admin-notes p {
|
|
margin: 0;
|
|
}
|
|
|
|
.access-req-card__actions {
|
|
display: flex;
|
|
gap: var(--space-s);
|
|
margin-top: var(--space-s);
|
|
}
|
|
|
|
.access-req-btn {
|
|
font-family: inherit;
|
|
font-size: var(--step--1);
|
|
font-weight: 600;
|
|
padding: var(--space-2xs) var(--space-m);
|
|
border: none;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
transition: background 0.2s, opacity 0.2s;
|
|
}
|
|
|
|
.access-req-btn--approve {
|
|
background: var(--accent);
|
|
color: white;
|
|
}
|
|
|
|
.access-req-btn--approve:hover {
|
|
background: var(--accent-dark);
|
|
}
|
|
|
|
.access-req-btn--reject {
|
|
background: #e53e3e;
|
|
color: white;
|
|
}
|
|
|
|
.access-req-btn--reject:hover {
|
|
background: #c53030;
|
|
}
|
|
|
|
/* Pagination */
|
|
.access-req-pagination {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
gap: var(--space-m);
|
|
margin-top: var(--space-l);
|
|
padding: var(--space-s) 0;
|
|
}
|
|
|
|
.access-req-pagination__link {
|
|
padding: var(--space-2xs) var(--space-s);
|
|
color: var(--accent);
|
|
text-decoration: none;
|
|
font-weight: 600;
|
|
transition: color 0.2s;
|
|
}
|
|
|
|
.access-req-pagination__link:hover {
|
|
color: var(--accent-dark);
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.access-req-pagination__info {
|
|
font-size: var(--step--1);
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
/* Dialog enhancements */
|
|
.admin-dialog textarea {
|
|
width: 100%;
|
|
font-family: inherit;
|
|
font-size: var(--step--1);
|
|
padding: var(--space-2xs);
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
background: var(--background);
|
|
color: var(--text-primary);
|
|
resize: vertical;
|
|
margin: var(--space-s) 0;
|
|
}
|
|
|
|
.admin-dialog label {
|
|
display: block;
|
|
font-weight: 600;
|
|
margin-bottom: var(--space-3xs);
|
|
}
|
|
|
|
.admin-btn--danger {
|
|
background: #e53e3e !important;
|
|
}
|
|
|
|
.admin-btn--danger:hover {
|
|
background: #c53030 !important;
|
|
}
|