aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/page/index.php7
-rw-r--r--admin/post/index.php7
-rw-r--r--admin/user/index.php7
3 files changed, 21 insertions, 0 deletions
diff --git a/admin/page/index.php b/admin/page/index.php
index 5a2a931..2ec4eab 100644
--- a/admin/page/index.php
+++ b/admin/page/index.php
@@ -28,6 +28,13 @@ $lastSite = ceil($count / $site_size);
$currentSite = HTTP::GET('site') ?? 1;
$currentSite = intval($currentSite);
+#===============================================================================
+# Redirect to page create form if no page exists
+#===============================================================================
+if(!$count) {
+ HTTP::redirect(Application::getAdminURL('page/insert.php'));
+}
+
if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
Application::error404();
}
diff --git a/admin/post/index.php b/admin/post/index.php
index e66d3b2..43d960a 100644
--- a/admin/post/index.php
+++ b/admin/post/index.php
@@ -28,6 +28,13 @@ $lastSite = ceil($count / $site_size);
$currentSite = HTTP::GET('site') ?? 1;
$currentSite = intval($currentSite);
+#===============================================================================
+# Redirect to post create form if no post exists
+#===============================================================================
+if(!$count) {
+ HTTP::redirect(Application::getAdminURL('post/insert.php'));
+}
+
if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
Application::error404();
}
diff --git a/admin/user/index.php b/admin/user/index.php
index 6513311..dce21db 100644
--- a/admin/user/index.php
+++ b/admin/user/index.php
@@ -27,6 +27,13 @@ $lastSite = ceil($count / $site_size);
$currentSite = HTTP::GET('site') ?? 1;
$currentSite = intval($currentSite);
+#===============================================================================
+# Redirect to user create form if no user exists
+#===============================================================================
+if(!$count) {
+ HTTP::redirect(Application::getAdminURL('user/insert.php'));
+}
+
if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
Application::error404();
}