summaryrefslogtreecommitdiff
path: root/LedgerSMB/Sysconfig.pm
blob: a8b2e827883f873b91181dd0ebd29371ae247ac9 (plain)
  1. #  This is the new configuration file for LedgerSMB. Eventually all system
  2. # configuration directives will go here, This will probably not fully replace
  3. # the ledger-smb.conf until 1.3, however.
  4. package LedgerSMB::Sysconfig;
  5. use Config::Std;
  6. $session='DB';
  7. $logging=0; # No logging on by default
  8. @io_lineitem_columns = qw(unit onhand sellprice discount linetotal);
  9. # if you have latex installed set to 1
  10. $latex = 1;
  11. # spool directory for batch printing
  12. $spool = "spool";
  13. # path to user configuration files
  14. $userspath = "users";
  15. # templates base directory
  16. $templates = "templates";
  17. # member file
  18. $memberfile = "users/members";
  19. # location of sendmail
  20. $sendmail = "| /usr/sbin/sendmail -t";
  21. # set language for login and admin
  22. $language = "";
  23. # Maximum number of invoices that can be printed on a check
  24. $check_max_invoices = 5;
  25. # program to use for file compression
  26. $gzip = "gzip -S .gz";
  27. # Path to the translation files
  28. $localepath = 'locale/po';
  29. # available printers
  30. %printer = ( Laser => 'lpr -Plaser',
  31. Epson => 'lpr -PEpson',
  32. );
  33. #################################
  34. # Global database parameters
  35. #################################
  36. # These parameters *must* be set correctly
  37. # for LedgerSMB >= 1.2 to work
  38. my $globalDBConnect = 'dbi:Pg:dbname=ledgersmb;host=localhost;port=5432';
  39. my $globalUserName = "ledgersmb";
  40. my $globalPassword = "set me to correct password";
  41. my %config;
  42. read_config('ledger-smb.conf' => %config) or die;
  43. $logging = $config{''}{logging} if $config{''}{logging};
  44. $check_max_invoices = $config{''}{check_max_invoices} if
  45. $config{''}{check_max_invoices};
  46. $language = $config{''}{language} if $config{''}{language};
  47. $session = $config{''}{session} if $config{''}{session};
  48. $latex = $config{''}{latex} if $config{''}{latex};
  49. $ENV{PATH} .= ":".(join ':', @{$config{environment}{PATH}}) if
  50. $config{environment}{PATH};
  51. $ENV{PERL5LIB} .= ":".(join ':', @{$config{environment}{PERL5LIB}}) if
  52. $config{environment}{PERL5LIB};
  53. %printer = %{$config{printers}} if $config{printers};
  54. $memberfile = $config{paths}{memberfile} if $config{paths}{memberfile};
  55. $userspath = $config{paths}{userspath} if $config{paths}{userspath};
  56. $localepath = $config{paths}{localepath} if $config{paths}{localepath};
  57. $spool = $config{paths}{spool} if $config{paths}{spool};
  58. $templates = $config{paths}{tempates} if $config{paths}{tempates};
  59. $sendmail = $config{programs}{sendmail} if $config{programs}{sendmail};
  60. $gzip = $config{programs}{gzip} if $config{programs}{gzip};
  61. $globalDBConnect = $config{globaldb}{DBConnect} if $config{globaldb}{DBConnect};
  62. $globalUserName = $config{globaldb}{UserName} if $config{globaldb}{UserName};
  63. $globalPassword = $config{globaldb}{Password} if $config{globaldb}{Password};
  64. #$GLOBALDBH = DBI->connect($globalDBConnect, $globalDBUserName, $globalDBPassword);
  65. # These lines prevent other apps in mod_perl from seeing the global db
  66. # connection info
  67. my $globalDBConnect = undef;
  68. my $globalUserName = undef;
  69. my $globalPassword = undef;
  70. 1;