6$fail =
static function (
string $message,
int $code): void {
7 fwrite(STDERR,
"FAIL: $message\n");
19 'dbxAdmin/include/dbxUser.class.php' =>
20 'verify, lock, unlock und reset_password mit RID',
21 'dbxContent_admin/include/dbxContent_cms.class.php' =>
22 'CMS-JSON, Upload, Medien- und Sprachaktionen',
23 'dbxContent_admin/include/dbxContent_seo.class.php' =>
24 'SEO-JSON und gemeinsam genutzte CMS-Medienendpunkte',
25 'dbxKi/include/dbxKiCmsService.class.php' =>
26 'zweistufige plan/execute-API mit expliziter Bestaetigung',
27 'dbxLogin/include/login.class.php' =>
28 'Tokenausgabe fuer erneuten Versand der Registrierung',
29 'dbxLogin/include/register.class.php' =>
30 'Tokenpruefung fuer erneuten Versand der Registrierung',
31 'dbxSetup/include/dbxInstall.class.php' =>
32 'zustandsgebundene Schritte des Erstinstallationsassistenten',
33 'dbxSelfTest/include/dbxSelfTestController.class.php' =>
34 'JSON-Testorchestrierung mit eigenem, admininternem Aktionsscope',
35 'dbxShop_admin/include/dbxShopAdmin.class.php' =>
36 'Shop-Sammel-, Medien-, Installations- und Statusaktionen',
37 'dbxWorkflow/include/dbxWorkflowEngine.class.php' =>
38 'Workflow-Start und instanzgebundene Prozesskommandos',
39 'dbxWorkflow_admin/include/dbxWorkflowAdmin.class.php' =>
40 'Erzeugung instanzgebundener Workflow-Fortsetzungslinks',
43$calls = array(
'action_token',
'check_action_token');
45 new RecursiveDirectoryIterator(
$modulesRoot, FilesystemIterator::SKIP_DOTS)
49 if (!
$file->isFile() || strtolower(
$file->getExtension()) !==
'php') {
53 $path = str_replace(
'\\',
'/',
$file->getPathname());
54 if (strpos($path,
'/tests/') !==
false) {
58 $relative = ltrim(substr($path, strlen(str_replace(
'\\',
'/',
$modulesRoot))),
'/');
59 $source = (string)file_get_contents(
$file->getPathname());
60 $tokens = token_get_all(
$source);
63 foreach ($tokens as
$token) {
67 $name = strtolower((
string)
$token[1]);
68 if (in_array($name,
$calls,
true)) {
75 'Nicht dokumentierte manuelle Action-Token-Logik in ' . $relative
76 .
': ' . implode(
', ', array_keys($found)),
81 if (strpos(
$source,
'enable_delete_tab(') !==
false
82 && isset($found[
'check_action_token'])) {
84 'dbxReport delete_tab wird in ' . $relative
85 .
' zusaetzlich im Modul geprueft.',
93 if (!is_file(
$file)) {
94 $fail(
'Dokumentierte Token-Ausnahme fehlt: ' . $relative, 3);
100 || strpos(
$formSource,
'substr($posted') !==
false) {
101 $fail(
'dbxForm protokolliert weiterhin Teile eines Security-Tokens.', 4);
104echo
'OK dbx action token usage audit ('
106 .
" documented exceptions)\n";
$manualScopeAllowlist
Bewusste Ausnahmen vom zentralen Standardweg.
foreach( $iterator as $file) foreach($manualScopeAllowlist as $relative=> $reason) $formSource