summaryrefslogtreecommitdiff
path: root/LedgerSMB/Sysconfig.pm
blob: 962c16fcc227b141639a7877e7f6c15285dba89d (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. use DBI qw(:sql_types);
  7. $session='DB';
  8. $logging=0; # No logging on by default
  9. @io_lineitem_columns = qw(unit onhand sellprice discount linetotal);
  10. # if you have latex installed set to 1
  11. $latex = 1;
  12. # spool directory for batch printing
  13. $spool = "spool";
  14. # path to user configuration files
  15. $userspath = "users";
  16. # templates base directory
  17. $templates = "templates";
  18. # member file
  19. $memberfile = "users/members";
  20. # location of sendmail
  21. $sendmail = "| /usr/sbin/sendmail -t";
  22. # set language for login and admin
  23. $language = "";
  24. # Maximum number of invoices that can be printed on a check
  25. $check_max_invoices = 5;
  26. # program to use for file compression
  27. $gzip = "gzip -S .gz";
  28. # Path to the translation files
  29. $localepath = 'locale/po';
  30. # available printers
  31. %printer = ( Laser => 'lpr -Plaser',
  32. Epson => 'lpr -PEpson',
  33. );
  34. my %config;
  35. read_config('ledger-smb.conf' => %config) or die;
  36. $logging = $config{''}{logging} if $config{''}{logging};
  37. $check_max_invoices = $config{''}{check_max_invoices} if
  38. $config{''}{check_max_invoices};
  39. $language = $config{''}{language} if $config{''}{language};
  40. $session = $config{''}{session} if $config{''}{session};
  41. $latex = $config{''}{latex} if $config{''}{latex};
  42. $ENV{PATH} .= ":".(join ':', @{$config{environment}{PATH}}) if
  43. $config{environment}{PATH};
  44. $ENV{PERL5LIB} .= ":".(join ':', @{$config{environment}{PERL5LIB}}) if
  45. $config{environment}{PERL5LIB};
  46. %printer = %{$config{printers}} if $config{printers};
  47. $memberfile = $config{paths}{memberfile} if $config{paths}{memberfile};
  48. $userspath = $config{paths}{userspath} if $config{paths}{userspath};
  49. $localepath = $config{paths}{localepath} if $config{paths}{localepath};
  50. $spool = $config{paths}{spool} if $config{paths}{spool};
  51. $templates = $config{paths}{tempates} if $config{paths}{tempates};
  52. $sendmail = $config{programs}{sendmail} if $config{programs}{sendmail};
  53. $gzip = $config{programs}{gzip} if $config{programs}{gzip};
  54. $globalDBConnect = $config{globaldb}{DBConnect} if $config{globaldb}{DBConnect};
  55. $globalDBUserName = $config{globaldb}{DBUserName} if $config{globaldb}{DBUserName};
  56. $globalDBPassword = $config{globaldb}{DBPassword} if $config{globaldb}{DBPassword};
  57. #putting this in an if clause for now so not to break other devel users
  58. if ($config{globaldb}{DBConnect}){
  59. $GLOBALDBH = DBI->connect($globalDBConnect, $globalDBUserName, $globalDBPassword) or die;
  60. }
  61. # These lines prevent other apps in mod_perl from seeing the global db
  62. # connection info
  63. my $globalDBConnect = undef;
  64. my $globalUserName = undef;
  65. my $globalPassword = undef;
  66. 1;