Heray-Was-Here
Server : Apache
System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.2.31
Disable Function : NONE
Directory :  /var/www/mailsvr/padmin/debian/patches/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/mailsvr/padmin/debian/patches/config-debian.diff
--- a/config.inc.php
+++ b/config.inc.php
@@ -31,6 +31,16 @@
 ################################################################################
 
 
+// Debian: This loads the automatic generated DB credentials from /etc/postfixadmin/dbconfig.inc.php
+$db_config = dirname(__FILE__) . '/dbconfig.inc.php';
+if (file_exists($db_config) && !is_readable($db_config)) {
+    die("Could not read: $db_config\n");
+}
+require_once($db_config);
+
+if (!isset($dbserver) || empty($dbserver)) {
+    $dbserver = 'localhost';
+}
 
 /*****************************************************************
  *  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
@@ -39,7 +49,7 @@
  * Doing this implies you have changed this file as required.
  * i.e. configuring database etc; specifying setup.php password etc.
  */
-$CONF['configured'] = false;
+$CONF['configured'] = true;
 
 // In order to setup Postfixadmin, you MUST specify a hashed password here.
 // To create the hash, visit setup.php in a browser and type a password into the field,
@@ -98,11 +108,11 @@ function language_hook($PALANG, $language) {
 // mysqli = MySQL 4.1+ or MariaDB
 // pgsql = PostgreSQL
 // sqlite = SQLite 3
-$CONF['database_type'] = 'mysqli';
-$CONF['database_host'] = 'localhost';
-$CONF['database_user'] = 'postfix';
-$CONF['database_password'] = 'postfixadmin';
-$CONF['database_name'] = 'postfix';
+$CONF['database_type'] = $dbtype;
+$CONF['database_host'] = $dbserver;
+$CONF['database_user'] = $dbuser;
+$CONF['database_password'] = $dbpass;
+$CONF['database_name'] = $dbname;
 
 // Database SSL Config
 $CONF['database_use_ssl'] = false;

Hry