From dfbf0c788a11cfe6337651a33a60790ea60c1b57 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Tue, 4 Jan 2022 03:21:04 +0000 Subject: [PATCH 1/3] Check that config.php is writable at the start of setup. --- setup.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/setup.php b/setup.php index a9fbc2e5..b7d2cb78 100644 --- a/setup.php +++ b/setup.php @@ -329,6 +329,7 @@ $currencies_array = array( if(isset($_POST['add_database'])){ + // Check if database has been setup already. If it has, direct user to edit directly instead. if(file_exists('config.php')){ $_SESSION['alert_message'] = "Database already configured. Any further changes should be made by editing the config.php file."; header("Location: setup.php?user"); @@ -951,6 +952,16 @@ if(isset($_POST['add_company_settings'])){
  • Get List of Emails in CSV to export to a mailing list
  • Acquire balance can be useful for customer's to get their balance by phone
  • + Warning: config.php is not writable. Ensure Apache has write access. "; + } + else { + // Else, able to write. Tidy up + unlink("config.php"); + } + ?>
    Setup
    From ae98902a96f1a45bae3e1f81b83ce18b86c9e0ae Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Tue, 4 Jan 2022 03:32:50 +0000 Subject: [PATCH 2/3] Add support for storing client certificate public key --- add_certificate_modal.php | 14 ++++++++++++-- client_certificates.php | 1 + db.sql | 1 + edit_certificate_modal.php | 14 ++++++++++++-- post.php | 26 ++++++++++++++++++++++++-- 5 files changed, 50 insertions(+), 6 deletions(-) diff --git a/add_certificate_modal.php b/add_certificate_modal.php index 9323b168..6bf683c4 100644 --- a/add_certificate_modal.php +++ b/add_certificate_modal.php @@ -32,12 +32,12 @@
    - +
    - +
    @@ -51,6 +51,16 @@ +
    + +
    +
    + +
    + +
    +
    +
    - +
    - +
    @@ -51,6 +51,16 @@ +
    + +
    +
    + +
    + +
    +
    + -
    +
    -
    - -
    - +
    + +
    +
    -
    +
    -
    +
    -
    - -
    - +
    + +
    +
    -
    +
    "; - } - else { - // Else, able to write. Tidy up - unlink("config.php"); - } + // Check that there is access to write config.php + if(!file_put_contents("config.php", "Test")){ + echo "
    Warning: config.php is not writable. Ensure the webserver user has write access.
    "; + }else{ + // Else, able to write. Tidy up + unlink("config.php"); + } ?>
    Setup