X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/2dc4984ad57dfcb0ded829bfc9d45493484fe6e3..0325cfa4d56b6e1090896cca133f769dac06f8d6:/admin.php?ds=sidebyside diff --git a/admin.php b/admin.php index 4500a19..6560f10 100644 --- a/admin.php +++ b/admin.php @@ -53,72 +53,59 @@ if (php_sapi_name() == "cli") { } /* Unlog if asked. */ - if (isset($_POST['action']) && (strcmp($_POST['action'], 'logout') == 0)) { - $_SESSION['admin_auth'] = false; + if (jirafeau_admin_session_logged() && isset($_POST['action']) && (strcmp($_POST['action'], 'logout') == 0)) { + jirafeau_admin_session_end(); } - /* Check classic admin password authentification. */ - if (isset($_POST['admin_password']) && empty($cfg['admin_http_auth_user'])) { - if ($cfg['admin_password'] === $_POST['admin_password'] || - $cfg['admin_password'] === hash('sha256', $_POST['admin_password'])) { - $_SESSION['admin_auth'] = true; - } else { - $_SESSION['admin_auth'] = false; - require(JIRAFEAU_ROOT . 'lib/template/header.php'); - echo '
'. - t('BAD_PSW') . '
'. t('BAD_PSW') . '
'. - t('NO_ADMIN_AUTH') . - '
'; - require(JIRAFEAU_ROOT.'lib/template/footer.php'); - exit; - } /* Operations may take a long time. * Be sure PHP's safe mode is off. @@ -138,6 +125,7 @@ if (php_sapi_name() == "cli") {