summaryrefslogtreecommitdiffstats
path: root/common/admin/inc
diff options
context:
space:
mode:
Diffstat (limited to 'common/admin/inc')
-rw-r--r--common/admin/inc/auth.inc.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/common/admin/inc/auth.inc.php b/common/admin/inc/auth.inc.php
index d21467b..0acf934 100644
--- a/common/admin/inc/auth.inc.php
+++ b/common/admin/inc/auth.inc.php
@@ -1,11 +1,13 @@
<?php
-include (dirname(__FILE__).'/pwd.inc.php');
-if ( isset($_COOKIE['auth']) && $_COOKIE['auth'] == $password ) {
- //ok, cool
-} else {
- setcookie('auth','', time()-3600);
+include dirname(__FILE__).'/pwd.inc.php';
+
+if (!class_exists('Planet')) {
+ require __DIR__.'/../../vendor/autoload.php';
+}
+
+if (!Planet::authenticateUser($_COOKIE['auth'], $password)) {
+ setcookie('auth', '', time() - 3600);
header('Location: login.php');
- die;
+ die();
}
-?> \ No newline at end of file