summaryrefslogtreecommitdiff
path: root/LedgerSMB/Sysconfig.pm
blob: 4e79f72ae31cf48519ea8f97925232439330fd70 (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. # SMTP settings
  23. $smtphost = '';
  24. $smtptimout = 60;
  25. # set language for login and admin
  26. $language = "";
  27. # Maximum number of invoices that can be printed on a check
  28. $check_max_invoices = 5;
  29. # program to use for file compression
  30. $gzip = "gzip -S .gz";
  31. # Path to the translation files
  32. $localepath = 'locale/po';
  33. # available printers
  34. %printer = ( Laser => 'lpr -Plaser',
  35. Epson => 'lpr -PEpson',
  36. );
  37. my %config;
  38. read_config('ledger-smb.conf' => %config) or die;
  39. $logging = $config{''}{logging} if $config{''}{logging};
  40. $check_max_invoices = $config{''}{check_max_invoices} if
  41. $config{''}{check_max_invoices};
  42. $language = $config{''}{language} if $config{''}{language};
  43. $session = $config{''}{session} if $config{''}{session};
  44. $latex = $config{''}{latex} if $config{''}{latex};
  45. $ENV{PATH} .= ":".(join ':', @{$config{environment}{PATH}}) if
  46. $config{environment}{PATH};
  47. $ENV{PERL5LIB} .= ":".(join ':', @{$config{environment}{PERL5LIB}}) if
  48. $config{environment}{PERL5LIB};
  49. %printer = %{$config{printers}} if $config{printers};
  50. $memberfile = $config{paths}{memberfile} if $config{paths}{memberfile};
  51. $userspath = $config{paths}{userspath} if $config{paths}{userspath};
  52. $localepath = $config{paths}{localepath} if $config{paths}{localepath};
  53. $spool = $config{paths}{spool} if $config{paths}{spool};
  54. $templates = $config{paths}{tempates} if $config{paths}{tempates};
  55. $gzip = $config{programs}{gzip} if $config{programs}{gzip};
  56. $sendmail = $config{mail}{sendmail} if $config{mail}{sendmail};
  57. $smtphost = $config{mail}{smtphost} if $config{mail}{smtphost};
  58. $smtptimeout = $config{mail}{smtptimeout} if $config{mail}{smtptimeout};
  59. $globalDBConnect = $config{globaldb}{DBConnect} if $config{globaldb}{DBConnect};
  60. $globalDBUserName = $config{globaldb}{DBUserName} if $config{globaldb}{DBUserName};
  61. $globalDBPassword = $config{globaldb}{DBPassword} if $config{globaldb}{DBPassword};
  62. #putting this in an if clause for now so not to break other devel users
  63. if ($config{globaldb}{DBConnect}){
  64. $GLOBALDBH = DBI->connect($globalDBConnect, $globalDBUserName, $globalDBPassword) or die;
  65. }
  66. # These lines prevent other apps in mod_perl from seeing the global db
  67. # connection info
  68. my $globalDBConnect = undef;
  69. my $globalUserName = undef;
  70. my $globalPassword = undef;
  71. 1;