diff --git a/api/admin.php b/api/admin.php index eb4a4e040..b5631dfc8 100644 --- a/api/admin.php +++ b/api/admin.php @@ -25,11 +25,8 @@ } if($config['reset_remove_mailtxt']) { - $mailAddressesFile = $config['foldersAbs']['data'] . '/mail-addresses.txt'; - - // delete mail-addresses.txt - if(is_file($mailAddressesFile)){ - unlink($mailAddressesFile); + if (is_file(MAIL_FILE)) { + unlink(MAIL_FILE); // delete file } } diff --git a/api/sendPic.php b/api/sendPic.php index 0ce361f6b..88f9a9b9a 100644 --- a/api/sendPic.php +++ b/api/sendPic.php @@ -63,19 +63,17 @@ } if (isset($_POST['send-link']) && $_POST['send-link'] === 'yes') { - $mailAddressesFile = $config['foldersAbs']['data'] . '/mail-addresses.txt'; - - if (!file_exists($mailAddressesFile)) { + if (!file_exists(MAIL_FILE)) { $addresses = []; } else { - $addresses = json_decode(file_get_contents($mailAddressesFile)); + $addresses = json_decode(file_get_contents(MAIL_FILE)); } if (!in_array($_POST['sendTo'], $addresses)) { $addresses[] = $_POST['sendTo']; } - file_put_contents($mailAddressesFile, json_encode($addresses)); + file_put_contents(MAIL_FILE, json_encode($addresses)); die(json_encode([ 'success' => true, diff --git a/config/config.inc.php b/config/config.inc.php index 69f3685c1..6ac6a2ad9 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -55,6 +55,8 @@ $config['webserver_ip'] = null; $config['rounded_corners'] = false; $config['time_to_live'] = '90000'; +$config['db_file'] = 'db'; +$config['mail_file'] = 'mail-adresses'; // specify key id to use that key to take a picture or collage (e.g. 13 is the enter key) // use for example https://keycode.info to get the key code diff --git a/lib/configsetup.inc.php b/lib/configsetup.inc.php index f0e01bc80..870f165bd 100644 --- a/lib/configsetup.inc.php +++ b/lib/configsetup.inc.php @@ -49,6 +49,12 @@ 'name' => 'show_error_messages', 'value' => $config['show_error_messages'] ], + 'db_file' => [ + 'type' => 'input', + 'placeholder' => $defaultConfig['db_file'], + 'name' => 'db_file', + 'value' => $config['db_file'] + ], 'file_format_date' => [ 'type' => 'checkbox', 'name' => 'file_format_date', @@ -682,6 +688,12 @@ 'name' => 'send_all_later', 'value' => $config['send_all_later'] ], + 'file' => [ + 'type' => 'input', + 'placeholder' => $defaultConfig['mail_file'], + 'name' => 'mail_file', + 'value' => $config['mail_file'] + ], 'host' => [ 'type' => 'input', 'placeholder' => $defaultConfig['mail_host'], diff --git a/lib/db.php b/lib/db.php index 8f398e284..589bdd75b 100644 --- a/lib/db.php +++ b/lib/db.php @@ -1,7 +1,8 @@ https://keycode.info to find out the key id.", + "manual_general_db_file": "Name of the database file.", "manual_general_default_imagefilter": "Choose an imagefilter which is applied by default after taking a picture.", "manual_general_disabled_filters": "Choose filters which get removed from the available imagefilter.", "manual_general_ipCamPreviewRotation": "Choose to rotate the preview from URL.", @@ -150,6 +153,7 @@ "manual_login_enabled": "If enabled, a username and password will be needed to access the adminpage and/or start screen (depending on your setup).", "manual_login_password": "Define your password used for login. Please note: after saving your password will only be visible as a hash inside adminpanel. For login don't enter the hash, enter the password you have set.", "manual_login_username": "Define the username used to login into Photobooth.", + "manual_mail_file": "File name for the e-mail addresses database.", "manual_mail_fromAddress": "Enter your return address which is used while sending pictures via email.", "manual_mail_fromName": "Enter your sender name which is used while sending pictures via email.", "manual_mail_host": "Enter your email host adress.", @@ -247,7 +251,7 @@ "reload": "Reload Page", "remove_config": "Delete personal configuration (my.config.inc.php)", "remove_images": "Delete images", - "remove_mailtxt": "Delete \"mail-addresses.txt\"", + "remove_mailtxt": "Delete e-mail addresses database", "reset": "Reset", "rounded_corners": "Rounded corners", "save": "Save",