diff --git a/PROJECT_CONTEXT.md b/PROJECT_CONTEXT.md
index f583545..5b493c9 100644
--- a/PROJECT_CONTEXT.md
+++ b/PROJECT_CONTEXT.md
@@ -33,7 +33,7 @@ Dateistruktur:
/config/: Datenbank-Zugangsdaten und Umgebungsvariablen. Die Subfolder staging/prod spielen keine technische Rolle und müssen so nicht in den Code integriert werden, denn sie werden so auch nicht synchronisiert. Beim Synchronisieren werden die beinhalteten Dateien automatisch in das Config Verzeichnis kopiert, als ob sie direkt drin liegen.
-/partials/landing/: Enthält die echten Landingpages, also den kompletten Aufbau der Seite
+/partials/landingpages/: Enthält die echten Landingpages, also den kompletten Aufbau der Seite
/partials/structure/: Enthält alle wiederverwendbaren Seiteninformationen, wie z.B. Header, Footer, Menue
@@ -46,4 +46,4 @@ Frontend: HTML5, CSS (evtl. Tailwind/Bootstrap), JavaScript (Vanilla oder leicht
4. Sicherheits-Vorgaben für den Assistenten
IP-Sperre: Der Zugriff ist strikt auf das Heimnetz (192.168.178.0/24) begrenzt (via Nginx).
-Pfadtrennung: Code-Generierung muss strikt zwischen dem Logik-Verzeichnis (außerhalb des Roots) und dem Web-Verzeichnis unterscheiden.
\ No newline at end of file
+Pfadtrennung: Code-Generierung muss strikt zwischen dem Logik-Verzeichnis (außerhalb des Roots) und dem Web-Verzeichnis unterscheiden.
diff --git a/partials/landing/main/home.php b/partials/landing/main/home.php
deleted file mode 100755
index e50d05d..0000000
--- a/partials/landing/main/home.php
+++ /dev/null
@@ -1,39 +0,0 @@
-assets()->addStyle('/assets/css/app.css', 'early');
-$app->assets()->addScript('/assets/js/app.js', 'footer', true);
-
-$flash = $app->flash()->get();
-?>
-
-
env: = htmlspecialchars(defined('APP_ENV') ? APP_ENV : 'local', ENT_QUOTES) ?>
-
= htmlspecialchars(t('common.title'), ENT_QUOTES) ?>
-
-
= htmlspecialchars(t('common.intro'), ENT_QUOTES) ?>
-
-
-
- = htmlspecialchars($flash['type'], ENT_QUOTES) ?>:
- = htmlspecialchars($flash['message'], ENT_QUOTES) ?>
-
-
-
-
-
-
Runtime
-
Current URL: = htmlspecialchars($app->request()->currentUrl(), ENT_QUOTES) ?>
-
Client-ID: = htmlspecialchars($GLOBALS['client_id'] ?? '', ENT_QUOTES) ?>
-
-
-
Actions
-
-
Flash uses SessionManager, no direct globals.
-
-
-
diff --git a/public/page/auth_callback.php b/partials/landingpages/auth/callback.php
similarity index 95%
rename from public/page/auth_callback.php
rename to partials/landingpages/auth/callback.php
index c62d195..b8bdcc7 100644
--- a/public/page/auth_callback.php
+++ b/partials/landingpages/auth/callback.php
@@ -74,7 +74,7 @@ if (defined('APP_AUTH_DEBUG') && APP_AUTH_DEBUG) {
],
'claim_source' => !empty($groups) ? 'id_token_or_access_token' : 'none',
];
- @file_put_contents(__DIR__ . '/../../debug/oidc_login.log', json_encode($log) . PHP_EOL, FILE_APPEND);
+ @file_put_contents(__DIR__ . '/../../../debug/oidc_login.log', json_encode($log) . PHP_EOL, FILE_APPEND);
}
redirect('/');
diff --git a/public/page/auth_login.php b/partials/landingpages/auth/login.php
similarity index 100%
rename from public/page/auth_login.php
rename to partials/landingpages/auth/login.php
diff --git a/public/page/auth_logout.php b/partials/landingpages/auth/logout.php
similarity index 100%
rename from public/page/auth_logout.php
rename to partials/landingpages/auth/logout.php
diff --git a/public/page/404.php b/partials/landingpages/errorpages/404.php
similarity index 100%
rename from public/page/404.php
rename to partials/landingpages/errorpages/404.php
diff --git a/public/page/index.php b/partials/landingpages/index.php
similarity index 100%
rename from public/page/index.php
rename to partials/landingpages/index.php
diff --git a/public/page/modules.php b/partials/landingpages/modules/index.php
similarity index 100%
rename from public/page/modules.php
rename to partials/landingpages/modules/index.php
diff --git a/public/page/modules_install.php b/partials/landingpages/modules/install.php
similarity index 100%
rename from public/page/modules_install.php
rename to partials/landingpages/modules/install.php
diff --git a/public/page/modules_setup.php b/partials/landingpages/modules/setup.php
similarity index 100%
rename from public/page/modules_setup.php
rename to partials/landingpages/modules/setup.php
diff --git a/public/page/debug.php b/partials/landingpages/retool/debug.php
similarity index 98%
rename from public/page/debug.php
rename to partials/landingpages/retool/debug.php
index a911089..fa51589 100644
--- a/public/page/debug.php
+++ b/partials/landingpages/retool/debug.php
@@ -18,7 +18,7 @@ if (!defined('APP_DEBUG_TOOL') || !APP_DEBUG_TOOL) {
return;
}
-$debugDir = __DIR__ . '/../../debug';
+$debugDir = __DIR__ . '/../../../debug';
if (!is_dir($debugDir)) {
if ($isList || $isRaw) {
http_response_code(404);
diff --git a/public/page/users.php b/partials/landingpages/users/index.php
similarity index 100%
rename from public/page/users.php
rename to partials/landingpages/users/index.php
diff --git a/public/page/settings.php b/partials/landingpages/users/settings.php
similarity index 100%
rename from public/page/settings.php
rename to partials/landingpages/users/settings.php
diff --git a/public/.htaccess b/public/.htaccess
index 8ca4b75..6459a87 100755
--- a/public/.htaccess
+++ b/public/.htaccess
@@ -13,7 +13,7 @@ Options -Indexes
RewriteRule ^assets/ - [L]
# -------------------------------------------------
-# 2) page/ von außen sperren (nur intern per require nutzbar)
+# 2) Legacy-Pfad blockieren (frueher public/page)
# -------------------------------------------------
RewriteRule ^page/ - [F,L]
diff --git a/public/index.php b/public/index.php
index e804356..a250507 100755
--- a/public/index.php
+++ b/public/index.php
@@ -42,24 +42,28 @@ if (str_contains($uriPath, '..')) {
exit('Bad request');
}
+// Basispfad fuer Landingpages
+$pagesBase = realpath(__DIR__ . '/../partials/landingpages') ?: (__DIR__ . '/../partials/landingpages');
+$page404 = $pagesBase . '/errorpages/404.php';
+
// Spezialrouten für Module
if (str_starts_with($uriPath, 'modules/install')) {
- $target = __DIR__ . '/page/modules_install.php';
+ $target = $pagesBase . '/modules/install.php';
} elseif (str_starts_with($uriPath, 'modules/setup/')) {
$_GET['module'] = trim(substr($uriPath, strlen('modules/setup/')), '/');
- $target = __DIR__ . '/page/modules_setup.php';
+ $target = $pagesBase . '/modules/setup.php';
} elseif ($uriPath === 'auth/login') {
- $target = __DIR__ . '/page/auth_login.php';
+ $target = $pagesBase . '/auth/login.php';
} elseif ($uriPath === 'auth/callback') {
- $target = __DIR__ . '/page/auth_callback.php';
+ $target = $pagesBase . '/auth/callback.php';
} elseif ($uriPath === 'auth/logout') {
- $target = __DIR__ . '/page/auth_logout.php';
+ $target = $pagesBase . '/auth/logout.php';
} elseif ($uriPath === 'settings') {
- $target = __DIR__ . '/page/settings.php';
+ $target = $pagesBase . '/users/settings.php';
} elseif ($uriPath === 'users') {
- $target = __DIR__ . '/page/users.php';
+ $target = $pagesBase . '/users/index.php';
} elseif ($uriPath === 'debug') {
- $target = __DIR__ . '/page/debug.php';
+ $target = $pagesBase . '/retool/debug.php';
} elseif (preg_match('~^module/([a-zA-Z0-9_-]+)(?:/(.+))?$~', $uriPath, $m)) {
$module = $m[1];
$page = isset($m[2]) && $m[2] !== '' ? trim($m[2], '/') : 'index';
@@ -68,12 +72,12 @@ if (str_starts_with($uriPath, 'modules/install')) {
$target = $modulePage;
} else {
http_response_code(404);
- $target = __DIR__ . '/page/404.php';
+ $target = $page404;
}
} elseif ($uriPath === '' || $uriPath === 'index' || $uriPath === 'index.php') {
- $target = __DIR__ . '/page/index.php';
+ $target = $pagesBase . '/index.php';
} else {
- $base = __DIR__ . '/page/' . $uriPath;
+ $base = $pagesBase . '/' . $uriPath;
// 1) Verzeichnis mit index.php
if (is_dir($base) && is_file($base . '/index.php')) {
$target = $base . '/index.php';
@@ -91,7 +95,7 @@ if (str_starts_with($uriPath, 'modules/install')) {
// 3) 404
else {
http_response_code(404);
- $target = __DIR__ . '/page/404.php';
+ $target = $page404;
}
}
// ------------------------------------
@@ -99,9 +103,9 @@ if (str_starts_with($uriPath, 'modules/install')) {
// ------------------------------------
$skipLayout = false;
$targetReal = realpath($target);
-$retoolBase = realpath(__DIR__ . '/page/retool');
+$retoolBase = realpath($pagesBase . '/retool/raw');
-// Beispiel: alles unter /page/raw/* ohne Layout
+// Beispiel: alles unter landingpages/retool/* ohne Layout
if ($targetReal && $retoolBase && str_starts_with($targetReal, $retoolBase)) {
$skipLayout = true;
}
diff --git a/src/App/functions.php b/src/App/functions.php
index 56f54b3..4a6e625 100644
--- a/src/App/functions.php
+++ b/src/App/functions.php
@@ -198,7 +198,7 @@ function module_fn(string $module, string $name, mixed ...$args): mixed
* @param string $folder Unterordner in /partials/
* @param array $data Daten, die im Template verfügbar sein sollen
*/
-function tpl(string $name, string $folder = 'landing', array $data = []): void
+function tpl(string $name, string $folder = 'landingpages', array $data = []): void
{
$base = __DIR__ . '/../../partials/';
@@ -210,9 +210,8 @@ function tpl(string $name, string $folder = 'landing', array $data = []): void
}
$paths = [];
- if ($folder === 'landing') {
- $paths[] = $base . 'landing/' . $name . '.php';
- $paths[] = $base . 'landing/main/' . $name . '.php';
+ if ($folder === 'landingpages') {
+ $paths[] = $base . 'landingpages/' . $name . '.php';
} else {
$paths[] = $base . 'structure/' . $name . '.php';
}