X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/6df4b8055a0e63b554ed211760ab1aa5cb431306..70c7fd5765720621553b3ddaff1009c795f49a76:/auth.php diff --git a/auth.php b/auth.php index 120f84b..6d5210d 100644 --- a/auth.php +++ b/auth.php @@ -1,37 +1,37 @@ root . 'lib/utils.inc.php'; + require_once 'config.php'; + require_once $CFG->root . 'lib/utils.inc.php'; - $auth_url = $_SERVER['PHP_SELF'] . '?op=login'; - $login = $_SERVER['PHP_SELF']; - $login_form = << - - - Login - - - -
-
-

Login

-
-
- - - - -
-
-
- -
- + + + Login + + + +
+
+

Login

+
+
+ + + + +
+
+
+ +
+ LF; @@ -59,29 +59,29 @@ LF; LE; - $util = Utils::getInstance(); - if (isset($_GET['op'])) - $action = $_GET['op']; - else - $action = 'default'; + $util = new Utils; + if (isset($_GET['op'])) + $action = $_GET['op']; + else + $action = 'default'; - if ($action == 'logout') { - // logout - $util->logout(); - echo $login_form; - } else if ($action == 'login') { - // login - $user = $_POST['user']; - $password = $_POST['password']; - if ($util->login($user, $password)) { - header('Location: index.php'); - } else { - $error = $util->getLoginStatus(); - $error = str_replace('__ERROR__', $error, $login_error); - echo $error; - } - } else { - echo $login_form; - } + if ($action == 'logout') { + // logout + $util->logout(); + echo $login_form; + } else if ($action == 'login') { + // login + $user = $_POST['user']; + $password = $_POST['password']; + if ($util->login($user, $password)) { + header('Location: index.php'); + } else { + $error = $util->getLoginStatus(); + $error = str_replace('__ERROR__', $error, $login_error); + echo $error; + } + } else { + echo $login_form; + } ?>