summaryrefslogtreecommitdiffstats
path: root/public/admin/inc/auth.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'public/admin/inc/auth.inc.php')
-rw-r--r--public/admin/inc/auth.inc.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/public/admin/inc/auth.inc.php b/public/admin/inc/auth.inc.php
new file mode 100644
index 0000000..32615e7
--- /dev/null
+++ b/public/admin/inc/auth.inc.php
@@ -0,0 +1,9 @@
+<?php
+
+include config_path('pwd.inc.php');
+
+if (!Planet::authenticateUser($_COOKIE['auth'] ?? '', $password)) {
+ setcookie('auth', '', time() - 3600);
+ header('Location: login.php');
+ die();
+}