X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/0d601dd942a8b709adf5812045afcdc5873706c8..6564589a47862c108fa27f7be51ddf9f52011e80:/admin.php
diff --git a/admin.php b/admin.php
old mode 100755
new mode 100644
index 7aceff9..a0ae04b
--- a/admin.php
+++ b/admin.php
@@ -1,7 +1,7 @@
+ * Copyright (C) 2015 Jerome Jutteau
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -19,7 +19,7 @@
define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/');
-require (JIRAFEAU_ROOT . 'lib/config.php');
+require (JIRAFEAU_ROOT . 'lib/config.original.php');
require (JIRAFEAU_ROOT . 'lib/settings.php');
require (JIRAFEAU_ROOT . 'lib/functions.php');
require (JIRAFEAU_ROOT . 'lib/lang.php');
@@ -32,23 +32,12 @@ if (file_exists (JIRAFEAU_ROOT . 'install.php')
exit;
}
-/* Check if the install.php script is still in the directory. */
-if (file_exists (JIRAFEAU_ROOT . 'install.php'))
-{
- require (JIRAFEAU_ROOT . 'lib/template/header.php');
- echo ''.
- _('Installer script still present') .
- '
';
- require (JIRAFEAU_ROOT.'lib/template/footer.php');
- exit;
-}
-
/* Disable admin interface if we have a empty admin password. */
-if (!$cfg['admin_password'])
+if (empty($cfg['admin_password']) && empty($cfg['admin_http_auth_user']))
{
require (JIRAFEAU_ROOT . 'lib/template/header.php');
echo ''.
- _('Sorry, the admin interface is not enabled.') .
+ t('Sorry, the admin interface is not enabled.') .
'
';
require (JIRAFEAU_ROOT.'lib/template/footer.php');
exit;
@@ -61,23 +50,24 @@ session_start();
if (isset ($_POST['action']) && (strcmp ($_POST['action'], 'logout') == 0))
$_SESSION['admin_auth'] = false;
-/* Check password. */
-if (isset ($_POST['admin_password']))
+/* Check classic admin password authentification. */
+if (isset ($_POST['admin_password']) && empty($cfg['admin_http_auth_user']))
{
- if (strcmp ($cfg['admin_password'], $_POST['admin_password']) == 0)
+ if ($cfg['admin_password'] === $_POST['admin_password'])
$_SESSION['admin_auth'] = true;
else
{
$_SESSION['admin_auth'] = false;
require (JIRAFEAU_ROOT . 'lib/template/header.php');
echo ''.
- _('Wrong password.') . '
';
+ t('Wrong password.') . '
';
require (JIRAFEAU_ROOT.'lib/template/footer.php');
exit;
}
}
-/* Ask for password. */
-elseif (!isset ($_SESSION['admin_auth']) || $_SESSION['admin_auth'] != true)
+/* Ask for classic admin password authentification. */
+elseif ((!isset ($_SESSION['admin_auth']) || $_SESSION['admin_auth'] != true)
+ && empty($cfg['admin_http_auth_user']))
{
require (JIRAFEAU_ROOT . 'lib/template/header.php'); ?>