From 76343fb91511b9f53e58b6c01b258bfe00ddb4c6 Mon Sep 17 00:00:00 2001
From: Lukas Fleischer
Date: Fri, 24 Oct 2014 08:31:47 +0200
Subject: Use an INI-style configuration file
Replace web/lib/config.inc.php with an INI-style configuration file.
This allows us to get rid of several globals and makes it easier to use
the same configuration file in external scripts.
Signed-off-by: Lukas Fleischer
---
web/html/login.php | 9 ++---
web/html/pkgsubmit.php | 8 ++---
web/lib/DB.class.php | 17 +++++++--
web/lib/acctfuncs.inc.php | 66 ++++++++++++++++------------------
web/lib/aur.inc.php | 26 +++++++++-----
web/lib/aurjson.class.php | 13 ++++---
web/lib/config.inc.php.proto | 72 -------------------------------------
web/lib/confparser.inc.php | 20 +++++++++++
web/lib/credentials.inc.php | 1 -
web/lib/pkgbasefuncs.inc.php | 17 ++-------
web/lib/pkgfuncs.inc.php | 7 +---
web/lib/pkgreqfuncs.inc.php | 41 +++++++++------------
web/lib/routing.inc.php | 18 +++++-----
web/lib/translator.inc.php | 8 ++---
web/template/actions_form.php | 2 +-
web/template/header.php | 2 +-
web/template/pkg_details.php | 13 +++----
web/template/pkgbase_details.php | 13 +++----
web/template/pkgreq_results.php | 5 +--
web/template/tu_last_votes_list.php | 2 +-
20 files changed, 153 insertions(+), 207 deletions(-)
delete mode 100644 web/lib/config.inc.php.proto
create mode 100644 web/lib/confparser.inc.php
(limited to 'web')
diff --git a/web/html/login.php b/web/html/login.php
index e458fec..dba3af5 100644
--- a/web/html/login.php
+++ b/web/html/login.php
@@ -5,7 +5,8 @@ include_once("aur.inc.php");
set_lang();
check_sid();
-if (!$DISABLE_HTTP_LOGIN || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'])) {
+$disable_http_login = config_get_bool('options', 'disable_http_login');
+if (!$disable_http_login || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'])) {
$login = try_login();
$login_error = $login['error'];
}
@@ -19,7 +20,7 @@ html_header('AUR ' . __("Login"));
= __("Logged-in as: %s", '' . username_from_sid($_COOKIE["AURSID"]) . ''); ?>
[= __("Logout"); ?>]
-
+