Commit Diff


commit - 6fba688215ac7a3c407c4d47fb856056625e982b
commit + 555cc197a4870b03316dff30b9b27bae8cf76ccc
blob - c30f2e5bf70d48db4ca99d41632bcc2b788a5d28
blob + 5ecfee5f9364d5583f8e55703b2f93747d4207bd
--- conf.php-sample
+++ conf.php-sample
@@ -1,6 +1,5 @@
 <?php
 define('DEBUG', 'true');
-define('PAGE_SIZE', '10');
 
 define('DB_TYPE', 'mysql');
 define('DB_HOST', '');
@@ -8,10 +7,22 @@ define('DB_USER', '');
 define('DB_PASS', '');
 define('DB_NAME', '');
 
-define('ADMIN_EMAIL', 'postmaster@example.tld');
-
-define('LOGGING', 'YES');
 define('ALIASES', '10');
 define('MAILBOXES', '10');
+
 define('ALIAS_CONTROL', 'NO');
+define('VACATION', 'NO');
+
+define('ADMIN_EMAIL', 'postmaster@example.tld');
+
+define('DEFAULT_LANGUAGE', 'en');
+define('PAGE_SIZE', '25');
+define('LOGGING', 'YES');
+
+define('SHOW_HEADER', 'NO');
+define('HEADER_TEXT', ':: OpenSMTPD Admin ::');
+
+define('SHOW_FOOTER', 'YES');
+define('FOOTER_TEXT', 'Return to OpenSMTPD!');
+define('FOOTER_LINK', 'http://git.high5.nl/opensmtpdadmin');
 ?>
blob - 81d07ee7facc18e0693e3944f70a8dd615502dde (mode 644)
blob + /dev/null
--- config.inc.php.sample
+++ /dev/null
@@ -1,127 +0,0 @@
-<?php
-// 
-// OpenSMTPD Admin 
-// by Mischa Peters <mischa at high5 dot nl>
-// 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'] = <<<EOM
-Hi,
-
-Welcome to your new account.
-EOM;
-
-//
-// END OF CONFIG FILE
-//
-?>
blob - bdbefe497215224e0afa51213c8bc39f289ba6c3
blob + 3cb8829f4b5dd6330856ba7789651d462eebc043
--- functions.inc.php
+++ functions.inc.php
@@ -15,7 +15,7 @@ if(preg_match("/functions.inc.php/", $_SERVER['SCRIPT_
 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
blob - f2b6b763acd8ff27408619732061774039f73f58
blob + b4b7bcdbb2dc678bef078dd0b9969f9700812c4c
--- languages/en.lang
+++ languages/en.lang
@@ -139,6 +139,7 @@ $LANG['Sendmail_to_text_error'] = '<span class="error_
 $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'] = '<span class="error_msg">Unable to send message.</span>';
 $LANG['Sendmail_result_succes'] = 'The mailbox has been created.';
blob - 37b19b6600eb9da22fb92fc393de0da21929ebee
blob + 4fbca6c39204634150099bd9e08df85f53076e90
--- templates/footer.tpl
+++ templates/footer.tpl
@@ -1,9 +1,9 @@
 <div id="footer">
 <a href="https://git.high5.nl/opensmtpdadmin/">OpenSMTPD Admin <?php echo VERSION ?></a>
 <?php
-if (($CONF['show_footer_text'] == "YES") and ($CONF['footer_link'])) {
+if (SHOW_FOOTER == "YES" && FOOTER_LINK) {
 	echo "&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;";
-	echo "<a href=\"" . $CONF['footer_link'] . "\">" . $CONF['footer_text'] . "</a>\n";
+	echo "<a href=\"" . FOOTER_LINK . "\">" . FOOTER_TEXT . "</a>\n";
 }
 ?>
 </div>
blob - 8d09479d14b69af0fa1be1738f164695e15a1fb9
blob + fbd66492481ac086bde873ff90882d409908f2e2
--- templates/header.tpl
+++ templates/header.tpl
@@ -27,8 +27,8 @@ if (file_exists(realpath("../stylesheet.css"))) {
 	echo "<img id=\"login_header_logo\" src=\"../images/postbox.png\" />\n";
 	echo "<img id=\"login_header_logo\" height=\"30px\"% src=\"../images/opensmtpdadmin.png\" />\n";
 }
-if (($CONF['show_header_text'] == "YES") and ($CONF['header_text'])) {
-	echo "<h2>" . $CONF['header_text'] . "</h2>\n";
+if (SHOW_HEADER == "YES" && HEADER_TEXT) {
+	echo "<h2>" . HEADER_TEXT . "</h2>\n";
 }
 ?>
 </div>
blob - a2d6ecea9013237b4d43438eecf30f8c4f859656
blob + bcacbd117d32fea90868f3381b2957061a3ce885
--- templates/list-virtual.tpl
+++ templates/list-virtual.tpl
@@ -13,8 +13,6 @@ if ($list_domains[$domain_key]['aliases'] == 0) $list_
 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'];
 ?>
 </select>
 <input type="hidden" name="offset" value="0">
blob - 5921514c836191d6c74de33655a07a01df468130
blob + fb5f0322fb844107bc5aeff83acc56ed192ce8e5
--- templates/sendmail.tpl
+++ templates/sendmail.tpl
@@ -22,7 +22,7 @@
 	<tr>
 		<td><?php echo $LANG['Sendmail_body'] . ":" ?></td>
 		<td>
-		<textarea class="flat" rows="10" cols="60" name="body"><?php echo $CONF['welcome_text']; ?></textarea>
+		<textarea class="flat" rows="10" cols="60" name="body"><?php echo $LANG['Sendmail_body_text']; ?></textarea>
 		</td>
 		<td>&nbsp;</td>
 	</tr>
blob - f72f9a9b02e8736150ea6d5496d00a1a675a393b
blob + 94f1907404338800183e200e858fdd1109a25c4e
--- templates/users_main.tpl
+++ templates/users_main.tpl
@@ -4,7 +4,7 @@
 		<td>&nbsp;</td>
 		<td><?php echo $_SESSION['userid']['username']; ?></td>
 	</tr>
-	<?php if ($CONF['vacation'] == 'YES') { ?>
+	<?php if (VACATION == 'YES') { ?>
 	<tr>
 		<td nowrap><a target="_top" href="vacation.php"><?php echo $LANG['UsersMenu_vacation']; ?></a></td>
 		<td><?php echo $LANG['UsersMain_vacation']; ?></td>
blob - c2c604694c6a6d80465b0754a42cc7cfcc3e40f6
blob + d71d7813c82e1bcd6bebec775df0a097a6392dc1
--- templates/users_menu.tpl
+++ templates/users_menu.tpl
@@ -1,6 +1,6 @@
 <div id="menu">
 <ul>
-	<?php if ($CONF['vacation'] == "YES") { ?>
+	<?php if (VACATION == "YES") { ?>
 	<li><a target="_top" href="vacation.php"><?php echo $LANG['UsersMenu_vacation']; ?></a></li>
 	<?php } ?>
 	<li><a target="_top" href="password.php"><?php echo $LANG['UsersMenu_password']; ?></a></li>
blob - 48c1249bd0c4780c7e11fa0facc4824bd6d07125
blob + f6c4ee5d6c9949a0c45bf04149884e46b2edc67d
--- viewlog.php
+++ viewlog.php
@@ -36,7 +36,6 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") {
 		$log = $sth->fetchAll(); 
 	}
 }
-
 include './templates/header.tpl';
 include './templates/menu.tpl';
 include './templates/viewlog.tpl';