X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/0d601dd942a8b709adf5812045afcdc5873706c8..8435b608be88a1b612cede53989a3a8952e495e4:/admin.php
diff --git a/admin.php b/admin.php
old mode 100755
new mode 100644
index 7aceff9..2cad589
--- 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,8 +50,8 @@ 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)
$_SESSION['admin_auth'] = true;
@@ -71,13 +60,14 @@ if (isset ($_POST['admin_password']))
$_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'); ?>