Die Zugriffspruefung lief bisher in 19 Dateien auf einen Fallback gegen die Legacy-Tabelle kl_Mitarbeiter (checkKaffeelisteAdmin/-Access). Der Zugang haengt jetzt ausschliesslich an der SaaS-Anmeldung. - Fallback-Bloecke in allen 19 Dateien entfernt, ebenso getUserName/getUserId - functions.php besteht nur noch aus der SaaS-Anmeldung; die per String zusammengebaute Abfrage "WHERE Email like '<eingabe>'" ist damit weg - config.php baut keine sqlsrv-Verbindung mehr auf, der Kompatibilitaetslayer lib/sqlsrv_mysql_compat.php ist verwaist und entfaellt - Auto-Login per DEV_AUTH_EMAIL gibt es nicht mehr: er meldete jeden Besucher an und machte damit den Login-Schutz unpruefbar. Angemeldet wird auch lokal ueber login.php; die Variable dient nur noch scripts/init-mysql-dev.php http-smoke war an die Golden-Master-Daten des Default-Mandanten gebunden und hatte deshalb sechs dauerhaft rote Pruefungen. Der Test legt sich jetzt einen eigenen Mandanten mit bekannten Salden an, meldet sich per HTTP an und raeumt danach auf. Geschuetzte Seiten werden nicht mehr ueber das Wort "Login" im Text geprueft, sondern ueber die tatsaechliche 302-Umleitung. http-smoke 27 PASS / 6 FAIL -> 33 PASS / 0 FAIL role-matrix 55 PASS / 0 FAIL -> unveraendert tenant-isolation 9 PASS / 1 FAIL -> 11 PASS / 1 FAIL (Altfehler) Ausserdem "keine Zugang" -> "keinen Zugang" in zwei Fehlermeldungen; der Rollentest erkannte die Ablehnung an genau diesem Tippfehler und wurde mitgezogen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
100 lines
2.4 KiB
PHP
100 lines
2.4 KiB
PHP
<?php
|
|
|
|
include "functions.php";
|
|
require_once __DIR__ . "/app/ledger.php";
|
|
|
|
$pdo = app_db_pdo();
|
|
$saasUser = saas_current_user($pdo);
|
|
$tenantId = 0;
|
|
$hasAccess = false;
|
|
|
|
function kaffeeliste_money(int $cents): string
|
|
{
|
|
return saas_format_money_cents($cents) . ' €';
|
|
}
|
|
|
|
if ($saasUser !== null && saas_user_has_role(['owner', 'admin', 'treasurer'], $saasUser)) {
|
|
$tenantId = (int)$saasUser['tenant_id'];
|
|
$hasAccess = true;
|
|
}
|
|
|
|
$participants = $hasAccess
|
|
? ledger_fetch_participant_summaries($pdo, $tenantId, ['active_only' => true])
|
|
: [];
|
|
|
|
include "header.php";
|
|
include "headerline.php";
|
|
include "nav.php";
|
|
?>
|
|
|
|
<section id="banner">
|
|
<div class="content">
|
|
<?php
|
|
if ($hasAccess) {
|
|
?>
|
|
<h2>Aktive Mitarbeiter mit Gesamtstand</h2>
|
|
<br>
|
|
<ul class="actions">
|
|
<li>
|
|
<form action="exportKaffeeliste.php" method="get">
|
|
<button type="submit">Kaffeeliste exportieren</button>
|
|
</form>
|
|
</li>
|
|
<li>
|
|
<form action="letzteneintraege.php" method="get">
|
|
<button type="submit">Letzten Einträge</button>
|
|
</form>
|
|
</li>
|
|
<li>
|
|
<form action="csvupload.php" method="get">
|
|
<button type="submit">CSV Upload</button>
|
|
</form>
|
|
</li>
|
|
</ul>
|
|
|
|
<br>
|
|
<table border="1" class="table table-striped table-bordered">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>E-Mail</th>
|
|
<th>Aktueller Stand</th>
|
|
<th>Gesamtausgabe (€)</th>
|
|
<th>Gesamtstriche</th>
|
|
<th>Gesamteinzahlungen</th>
|
|
</tr>
|
|
<?php
|
|
foreach ($participants as $participant) {
|
|
$participantId = (int)$participant['participant_id'];
|
|
$name = saas_html($participant['display_name']);
|
|
$email = saas_html((string)($participant['email'] ?? ''));
|
|
$balance = kaffeeliste_money((int)$participant['balance_cents']);
|
|
$totalCosts = kaffeeliste_money((int)$participant['total_costs_cents']);
|
|
$totalMarks = number_format((int)$participant['total_marks'], 0, ',', '.');
|
|
$totalPayments = kaffeeliste_money((int)$participant['total_payments_cents']);
|
|
|
|
echo "<tr>";
|
|
echo "<td><a href=\"teilnehmerauswertung.php?participant_id={$participantId}\">{$name}</a></td>";
|
|
echo "<td>{$email}</td>";
|
|
echo "<td>{$balance}</td>";
|
|
echo "<td>{$totalCosts}</td>";
|
|
echo "<td>{$totalMarks}</td>";
|
|
echo "<td>{$totalPayments}</td>";
|
|
echo "</tr>";
|
|
}
|
|
?>
|
|
</table>
|
|
<br><br>
|
|
|
|
<form action="mailversenden.php" method="get">
|
|
<button type="submit">Info-Mail versenden</button>
|
|
</form>
|
|
<?php
|
|
} else {
|
|
echo "<h2>Kein Zugriff</h2>";
|
|
}
|
|
?>
|
|
</div>
|
|
</section>
|
|
|
|
<?php include "footer.php"; ?>
|