X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/f55334d19ee35f6a163f574a54546449f7d44ca0..b6f423726c6f71c769fc7d7f3b842f623595a808:/admin.php?ds=sidebyside
diff --git a/admin.php b/admin.php
index bcc291b..cfdfe30 100644
--- a/admin.php
+++ b/admin.php
@@ -43,40 +43,40 @@ if (php_sapi_name() == "cli") {
}
} else {
/* Disable admin interface if we have a empty admin password. */
- if (empty($cfg['admin_password']) && empty($cfg['admin_http_auth_user'])) {
- require(JIRAFEAU_ROOT . 'lib/template/header.php');
- echo '
'.
+ if (empty($cfg['admin_password']) && empty($cfg['admin_http_auth_user'])) {
+ require(JIRAFEAU_ROOT . 'lib/template/header.php');
+ echo '
';
- require(JIRAFEAU_ROOT.'lib/template/footer.php');
- exit;
- }
+ require(JIRAFEAU_ROOT.'lib/template/footer.php');
+ exit;
+ }
- /* Unlog if asked. */
- if (jirafeau_admin_session_logged() && isset($_POST['action']) && (strcmp($_POST['action'], 'logout') == 0)) {
- jirafeau_admin_session_end();
- }
+ /* Unlog if asked. */
+ if (jirafeau_admin_session_logged() && isset($_POST['action']) && (strcmp($_POST['action'], 'logout') == 0)) {
+ jirafeau_admin_session_end();
+ }
- if (!jirafeau_admin_session_logged()) {
- /* Test HTTP authentification. */
- if (!empty($cfg['admin_http_auth_user']) &&
+ if (!jirafeau_admin_session_logged()) {
+ /* Test HTTP authentification. */
+ if (!empty($cfg['admin_http_auth_user']) &&
$cfg['admin_http_auth_user'] == $_SERVER['PHP_AUTH_USER']) {
- jirafeau_admin_session_start();
- }
- /* Test web password authentification. */
- else if (!empty($cfg['admin_password']) && isset($_POST['admin_password'])) {
- if ($cfg['admin_password'] === hash('sha256', $_POST['admin_password'])) {
- jirafeau_admin_session_start();
- } else {
- require(JIRAFEAU_ROOT . 'lib/template/header.php');
- echo '
';
- require(JIRAFEAU_ROOT.'lib/template/footer.php');
- exit;
- }
- }
- /* Admin password prompt form. */
- else {
- require(JIRAFEAU_ROOT . 'lib/template/header.php'); ?>
+ jirafeau_admin_session_start();
+ }
+ /* Test web password authentification. */
+ elseif (!empty($cfg['admin_password']) && isset($_POST['admin_password'])) {
+ if ($cfg['admin_password'] === hash('sha256', $_POST['admin_password'])) {
+ jirafeau_admin_session_start();
+ } else {
+ require(JIRAFEAU_ROOT . 'lib/template/header.php');
+ echo '
';
+ require(JIRAFEAU_ROOT.'lib/template/footer.php');
+ exit;
+ }
+ }
+ /* Admin password prompt form. */
+ else {
+ require(JIRAFEAU_ROOT . 'lib/template/header.php'); ?>