]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin.php
handling of boolean constants improved (not fully)
[mailer.git] / inc / modules / admin.php
index a4e8aeb1e4151bdc803cf70b141cd716893941e6..083009f303cfaac823b7ad6dfc62bd85afcd8cc9 100644 (file)
@@ -52,7 +52,7 @@ FIX_DELETED_COOKIES(array('admin_login', 'admin_md5', 'admin_last', 'admin_to'))
 // Is the logout empty?
 if (empty($_GET['logout'])) $_GET['logout'] = "";
 
 // Is the logout empty?
 if (empty($_GET['logout'])) $_GET['logout'] = "";
 
-if (!admin_registered) {
+if (!isBooleanConstantAndTrue('admin_registered')) {
        // Admin is not registered so we have to inform the user
        if ((isset($_POST['ok'])) && ((empty($_POST['login'])) || (empty($_POST['pass'])) || (strlen($_POST['pass']) < 4))) $_POST['ok'] = "***";
        if ((isset($_POST['ok'])) && ($_POST['ok'] != "***")) {
        // Admin is not registered so we have to inform the user
        if ((isset($_POST['ok'])) && ((empty($_POST['login'])) || (empty($_POST['pass'])) || (strlen($_POST['pass']) < 4))) $_POST['ok'] = "***";
        if ((isset($_POST['ok'])) && ($_POST['ok'] != "***")) {
@@ -89,7 +89,7 @@ if (!admin_registered) {
                                // Any other kind
                                $ret = "done";
                        }
                                // Any other kind
                                $ret = "done";
                        }
-                       if (!admin_registered) {
+                       if (!isBooleanConstantAndTrue('admin_registered')) {
                                // Write to config that registration is done
                                admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define ('admin_registered', ", ");", "true", 0);
 
                                // Write to config that registration is done
                                admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define ('admin_registered', ", ");", "true", 0);
 
@@ -255,7 +255,7 @@ if (!admin_registered) {
        }
 } elseif ($_GET['logout'] == "1") {
        // Only try to remove cookies
        }
 } elseif ($_GET['logout'] == "1") {
        // Only try to remove cookies
-       if (set_session("admin_login", "", (time() - 3600), COOKIE_PATH) && set_session("admin_md5", "", (time() - 3600), COOKIE_PATH) && set_session("admin_last", "", (time() - 3600), COOKIE_PATH) && set_session("admin_to", "", (time() - 3600), COOKIE_PATH)) {
+       if (set_session("admin_login", "") && set_session("admin_md5", "") && set_session("admin_last", "") && set_session("admin_to", "")) {
                // Also remove array elements
                unset($_SESSION['admin_login']);
                unset($_SESSION['admin_md5']);
                // Also remove array elements
                unset($_SESSION['admin_login']);
                unset($_SESSION['admin_md5']);
@@ -337,7 +337,7 @@ if (!admin_registered) {
        }
 }
 
        }
 }
 
-if (admin_registered)
+if (isBooleanConstantAndTrue('admin_registered'))
 {
        // Check config.php and inc directory for right access rights
        if (is_INCWritable("config"))     ADD_FATAL(FATAL_CONFIG_WRITABLE);
 {
        // Check config.php and inc directory for right access rights
        if (is_INCWritable("config"))     ADD_FATAL(FATAL_CONFIG_WRITABLE);