db_credentials 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Description: This patch sets the dbconfig placeholders in config.inc.php.
  2. Forwarded: not-needed
  3. Author: Norman Messtorff <normes@normes.org>
  4. Last-Update: 2012-05-28
  5. Index: postfixadmin/config.inc.php
  6. ===================================================================
  7. --- postfixadmin.orig/config.inc.php 2015-09-26 15:03:05.000000000 +0100
  8. +++ postfixadmin/config.inc.php 2015-09-26 15:03:16.000000000 +0100
  9. @@ -15,6 +15,11 @@
  10. * Contains configuration options.
  11. */
  12. +// This loads the automatic generated DB credentials from /etc/postfixadmin/dbconfig.inc.php
  13. +require_once('/etc/postfixadmin/dbconfig.inc.php');
  14. +if (!isset($dbserver) || empty($dbserver))
  15. + $dbserver='localhost';
  16. +
  17. /*****************************************************************
  18. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  19. * You have to set $CONF['configured'] = true; before the
  20. @@ -22,7 +27,7 @@
  21. * Doing this implies you have changed this file as required.
  22. * i.e. configuring database etc; specifying setup.php password etc.
  23. */
  24. -$CONF['configured'] = false;
  25. +$CONF['configured'] = true;
  26. // In order to setup Postfixadmin, you MUST specify a hashed password here.
  27. // To create the hash, visit setup.php in a browser and type a password into the field,
  28. @@ -80,11 +85,11 @@
  29. // mysql = MySQL 3.23 and 4.0, 4.1 or 5
  30. // mysqli = MySQL 4.1+ or MariaDB
  31. // pgsql = PostgreSQL
  32. -$CONF['database_type'] = 'mysqli';
  33. -$CONF['database_host'] = 'localhost';
  34. -$CONF['database_user'] = 'postfix';
  35. -$CONF['database_password'] = 'postfixadmin';
  36. -$CONF['database_name'] = 'postfix';
  37. +$CONF['database_type'] = $dbtype;
  38. +$CONF['database_host'] = $dbserver;
  39. +$CONF['database_user'] = $dbuser;
  40. +$CONF['database_password'] = $dbpass;
  41. +$CONF['database_name'] = $dbname;
  42. // If you need to specify a different port for a MYSQL database connection, use e.g.
  43. // $CONF['database_host'] = '172.30.33.66:3308';
  44. // If you need to specify a different port for POSTGRESQL database connection