From 555cc197a4870b03316dff30b9b27bae8cf76ccc Mon Sep 17 00:00:00 2001 From: mischa Date: Sun, 4 Sep 2022 20:32:35 +0000 Subject: [PATCH] remove last in favor of define --- conf.php-sample | 19 ++++-- config.inc.php.sample | 127 ------------------------------------- functions.inc.php | 2 +- languages/en.lang | 1 + templates/footer.tpl | 4 +- templates/header.tpl | 4 +- templates/list-virtual.tpl | 2 - templates/sendmail.tpl | 2 +- templates/users_main.tpl | 2 +- templates/users_menu.tpl | 2 +- viewlog.php | 1 - 11 files changed, 24 insertions(+), 142 deletions(-) delete mode 100644 config.inc.php.sample diff --git a/conf.php-sample b/conf.php-sample index c30f2e5..5ecfee5 100644 --- a/conf.php-sample +++ b/conf.php-sample @@ -1,6 +1,5 @@ diff --git a/config.inc.php.sample b/config.inc.php.sample deleted file mode 100644 index 81d07ee..0000000 --- a/config.inc.php.sample +++ /dev/null @@ -1,127 +0,0 @@ - -// Copyright (c) 2022 High5! -// License Info: LICENSE.TXT -// -// File: config.inc.php -// -if (preg_match("/config.inc.php/", $_SERVER['SCRIPT_NAME'])) { - header("Location: login.php"); - exit; -} - -// Debug mode -// Enables PHP error output -$CONF['debug'] = 'false'; - -// Language config -// Language files are located in './languages'. -$CONF['default_language'] = 'en'; - -// Database Config -// mysqli = MySQL 4.1 -// pgsql = PostgreSQL -$CONF['database_type'] = 'mysqli'; -$CONF['database_host'] = 'localhost'; -$CONF['database_user'] = 'opensmtpdadmin'; -$CONF['database_password'] = 'RandomStringOfChars'; -$CONF['database_name'] = 'opensmtpd'; -$CONF['database_prefix'] = ''; - -// Site Admin -// Define the Site Admins email address below. -// This will be used to send emails from to create mailboxes. -$CONF['admin_email'] = 'postmaster@change-this-to-your.domain.tld'; - -// Encrypt -$CONF['encrypt'] = 'bcrypt'; - -// Generate Password -// Generate a random password for a mailbox and display it. -// If you want to automagically generate paswords set this to 'YES'. -$CONF['generate_password'] = 'NO'; - -// Page Size -// Set the number of entries that you would like to see -// in one page. -$CONF['page_size'] = '25'; - -// Default Aliases -// The default aliases that need to be created for all domains. -$CONF['default_aliases'] = array ( - 'abuse' => 'abuse@change-this-to-your.domain.tld', - 'hostmaster' => 'hostmaster@change-this-to-your.domain.tld', - 'postmaster' => 'postmaster@change-this-to-your.domain.tld', - 'webmaster' => 'webmaster@change-this-to-your.domain.tld' -); - -// Mailboxes -// If you want to store the mailboxes per domain set this to 'YES'. -// Example: /usr/local/virtual/domain.tld/username@domain.tld -$CONF['domain_path'] = 'NO'; -// If you don't want to have the domain in your mailbox set this to 'NO'. -// Example: /usr/local/virtual/domain.tld/username -$CONF['domain_in_mailbox'] = 'YES'; - -// Default Domain Values -// Specify your default values below. Quota in MB. -$CONF['aliases'] = '10'; -$CONF['mailboxes'] = '10'; -$CONF['maxquota'] = '0'; - -// Quota -// When you want to enforce quota for your mailbox users set this to 'YES'. -$CONF['quota'] = 'NO'; -// You can either use '1024000' or '1048576' -$CONF['quota_multiplier'] = '1024000'; - -// Transport -// If you want to define additional transport options for a domain set this to 'YES'. -// Read the transport file of the OpenSMTPD documentation. -$CONF['transport'] = 'NO'; - -// Virtual Vacation -// If you want to use virtual vacation for you mailbox users set this to 'YES'. -$CONF['vacation'] = 'NO'; - -// Alias Control -// OpenSMTPD Admin inserts an alias in the alias table for every mailbox it creates. -// The reason for this is that when you want catch-all and normal mailboxes -// to work you need to have the mailbox replicated in the alias table. -// If you want to take control of these aliases as well set this to 'YES'. -$CONF['alias_control'] = 'NO'; - -// Special Alias Control -// Set to 'NO' if you don't want your domain admins to change the default aliases. -$CONF['special_alias_control'] = 'YES'; - -// Logging -// If you don't want logging set this to 'NO'; -$CONF['logging'] = 'YES'; - -// Header -$CONF['show_header_text'] = 'NO'; -$CONF['header_text'] = ':: OpenSMTPD Admin ::'; - -// Footer -// Below information will be on all pages. -// If you don't want the footer information to appear set this to 'NO'. -$CONF['show_footer_text'] = 'YES'; -$CONF['footer_text'] = 'Return to change-this-to-your.domain.tld!'; -$CONF['footer_link'] = 'http://change-this-to-your.domain.tld/'; - -// Welcome Message -// This message is send to every newly created mailbox. -// Change the text between EOM. -$CONF['welcome_text'] = << diff --git a/functions.inc.php b/functions.inc.php index bdbefe4..3cb8829 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -15,7 +15,7 @@ if(preg_match("/functions.inc.php/", $_SERVER['SCRIPT_NAME'])) { DEFINE("VERSION", "version 1.0.0"); DEFINE('ROOT_PATH', dirname(__FILE__) . '/'); require_once ROOT_PATH . 'conf.php'; -require_once ROOT_PATH . 'config.inc.php'; +#require_once ROOT_PATH . 'config.inc.php'; // // Check of debug is enabled or not diff --git a/languages/en.lang b/languages/en.lang index f2b6b76..b4b7bcd 100644 --- a/languages/en.lang +++ b/languages/en.lang @@ -139,6 +139,7 @@ $LANG['Sendmail_to_text_error'] = 'TO is empty or is not $LANG['Sendmail_subject'] = 'Subject'; $LANG['Sendmail_subject_text'] = 'Welcome'; $LANG['Sendmail_body'] = 'Body'; +$LANG['Sendmail_body_text'] = "Hi,\n\nWelcome to your new account."; $LANG['Sendmail_button'] = 'Send Message'; $LANG['Sendmail_result_error'] = 'Unable to send message.'; $LANG['Sendmail_result_succes'] = 'The mailbox has been created.'; diff --git a/templates/footer.tpl b/templates/footer.tpl index 37b19b6..4fbca6c 100644 --- a/templates/footer.tpl +++ b/templates/footer.tpl @@ -1,9 +1,9 @@ diff --git a/templates/header.tpl b/templates/header.tpl index 8d09479..fbd6649 100644 --- a/templates/header.tpl +++ b/templates/header.tpl @@ -27,8 +27,8 @@ if (file_exists(realpath("../stylesheet.css"))) { echo "\n"; echo "\n"; } -if (($CONF['show_header_text'] == "YES") and ($CONF['header_text'])) { - echo "

" . $CONF['header_text'] . "

\n"; +if (SHOW_HEADER == "YES" && HEADER_TEXT) { + echo "

" . HEADER_TEXT . "

\n"; } ?> diff --git a/templates/list-virtual.tpl b/templates/list-virtual.tpl index a2d6ece..bcacbd1 100644 --- a/templates/list-virtual.tpl +++ b/templates/list-virtual.tpl @@ -13,8 +13,6 @@ if ($list_domains[$domain_key]['aliases'] == 0) $list_domains[$domain_key]['alia if ($list_domains[$domain_key]['aliases'] < 0) $list_domains[$domain_key]['aliases'] = $LANG['Overview_disabled']; if ($list_domains[$domain_key]['mailboxes'] == 0) $list_domains[$domain_key]['mailboxes'] = $LANG['Overview_unlimited']; if ($list_domains[$domain_key]['mailboxes'] < 0) $list_domains[$domain_key]['mailboxes'] = $LANG['Overview_disabled']; -if ($list_domains[$domain_key]['maxquota'] == 0) $list_domains[$domain_key]['maxquota'] = $LANG['Overview_unlimited']; -if ($list_domains[$domain_key]['maxquota'] < 0) $list_domains[$domain_key]['maxquota'] = $LANG['Overview_disabled']; ?> diff --git a/templates/sendmail.tpl b/templates/sendmail.tpl index 5921514..fb5f032 100644 --- a/templates/sendmail.tpl +++ b/templates/sendmail.tpl @@ -22,7 +22,7 @@ - +   diff --git a/templates/users_main.tpl b/templates/users_main.tpl index f72f9a9..94f1907 100644 --- a/templates/users_main.tpl +++ b/templates/users_main.tpl @@ -4,7 +4,7 @@   - + diff --git a/templates/users_menu.tpl b/templates/users_menu.tpl index c2c6046..d71d781 100644 --- a/templates/users_menu.tpl +++ b/templates/users_menu.tpl @@ -1,6 +1,6 @@