Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

0001-db_credentials.patch 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From: Norman Messtorff <normes@normes.org>
  2. Date: Sun, 23 Mar 2014 17:40:30 +0100
  3. Subject: db_credentials
  4. ---
  5. config.inc.php | 19 ++++++++++++-------
  6. 1 file changed, 12 insertions(+), 7 deletions(-)
  7. Index: postfixadmin/config.inc.php
  8. ===================================================================
  9. --- a/config.inc.php
  10. +++ b/config.inc.php
  11. @@ -15,6 +15,14 @@
  12. * Contains configuration options.
  13. */
  14. +
  15. +// Debian: This loads the automatic generated DB credentials from
  16. +// /etc/postfixadmin/dbconfig.inc.php
  17. +require_once('dbconfig.inc.php');
  18. +if (!isset($dbserver) || empty($dbserver)) {
  19. + $dbserver='localhost';
  20. +}
  21. +
  22. /*****************************************************************
  23. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  24. * You have to set $CONF['configured'] = true; before the
  25. @@ -22,7 +30,7 @@
  26. * Doing this implies you have changed this file as required.
  27. * i.e. configuring database etc; specifying setup.php password etc.
  28. */
  29. -$CONF['configured'] = false;
  30. +$CONF['configured'] = true;
  31. // In order to setup Postfixadmin, you MUST specify a hashed password here.
  32. // To create the hash, visit setup.php in a browser and type a password into the field,
  33. @@ -81,11 +89,11 @@
  34. // mysqli = MySQL 4.1+ or MariaDB
  35. // pgsql = PostgreSQL
  36. // sqlite = SQLite 3
  37. -$CONF['database_type'] = 'mysqli';
  38. -$CONF['database_host'] = 'localhost';
  39. -$CONF['database_user'] = 'postfix';
  40. -$CONF['database_password'] = 'postfixadmin';
  41. -$CONF['database_name'] = 'postfix';
  42. +$CONF['database_type'] = $dbtype;
  43. +$CONF['database_host'] = $dbserver;
  44. +$CONF['database_user'] = $dbuser;
  45. +$CONF['database_password'] = $dbpass;
  46. +$CONF['database_name'] = $dbname;
  47. // If you need to specify a different port for a MYSQL database connection, use e.g.
  48. // $CONF['database_host'] = '172.30.33.66:3308';
  49. // If you need to specify a different port for POSTGRESQL database connection