summaryrefslogtreecommitdiff
path: root/LedgerSMB/Sysconfig.pm
blob: 91fe33b35e2ab20ae83cbf40c1da75632cf34dd4 (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 LedgerSMB::Form;
  6. use Config::Std;
  7. use DBI qw(:sql_types);
  8. binmode STDOUT, ':utf8';
  9. # For Win32, change $pathsep to ';';
  10. $pathsep=':';
  11. $session='DB';
  12. $logging=0; # No logging on by default
  13. @io_lineitem_columns = qw(unit onhand sellprice discount linetotal);
  14. # Whitelist for redirect destination
  15. @scripts = ('aa.pl', 'admin.pl', 'am.pl', 'ap.pl', 'ar.pl', 'arap.pl',
  16. 'arapprn.pl', 'bp.pl', 'ca.pl', 'cp.pl', 'ct.pl', 'gl.pl', 'hr.pl',
  17. 'ic.pl', 'io.pl', 'ir.pl', 'is.pl', 'jc.pl', 'login.pl', 'menu.pl',
  18. 'oe.pl', 'pe.pl', 'pos.pl', 'ps.pl', 'pw.pl', 'rc.pl', 'rp.pl');
  19. # if you have latex installed set to 1
  20. $latex = 1;
  21. # spool directory for batch printing
  22. $spool = "spool";
  23. # path to user configuration files
  24. $userspath = "users";
  25. # templates base directory
  26. $templates = "templates";
  27. # member file
  28. $memberfile = "users/members";
  29. # location of sendmail
  30. $sendmail = "/usr/sbin/sendmail -t";
  31. # SMTP settings
  32. $smtphost = '';
  33. $smtptimout = 60;
  34. # set language for login and admin
  35. $language = "";
  36. # Maximum number of invoices that can be printed on a check
  37. $check_max_invoices = 5;
  38. # program to use for file compression
  39. $gzip = "gzip -S .gz";
  40. # Path to the translation files
  41. $localepath = 'locale/po';
  42. # available printers
  43. %printer = ( Laser => 'lpr -Plaser',
  44. Epson => 'lpr -PEpson',
  45. );
  46. my %config;
  47. read_config('ledger-smb.conf' => %config) or die;
  48. $logging = $config{''}{logging} if $config{''}{logging};
  49. $check_max_invoices = $config{''}{check_max_invoices} if
  50. $config{''}{check_max_invoices};
  51. $language = $config{''}{language} if $config{''}{language};
  52. $session = $config{''}{session} if $config{''}{session};
  53. $latex = $config{''}{latex} if $config{''}{latex};
  54. $ENV{PATH} .= $pathsep.(join $pathsep, @{$config{environment}{PATH}}) if
  55. $config{environment}{PATH};
  56. $ENV{PERL5LIB} .= ":".(join ':', @{$config{environment}{PERL5LIB}}) if
  57. $config{environment}{PERL5LIB};
  58. %printer = %{$config{printers}} if $config{printers};
  59. $memberfile = $config{paths}{memberfile} if $config{paths}{memberfile};
  60. $userspath = $config{paths}{userspath} if $config{paths}{userspath};
  61. $localepath = $config{paths}{localepath} if $config{paths}{localepath};
  62. $spool = $config{paths}{spool} if $config{paths}{spool};
  63. $templates = $config{paths}{templates} if $config{paths}{templates};
  64. $gzip = $config{programs}{gzip} if $config{programs}{gzip};
  65. $sendmail = $config{mail}{sendmail} if $config{mail}{sendmail};
  66. $smtphost = $config{mail}{smtphost} if $config{mail}{smtphost};
  67. $smtptimeout = $config{mail}{smtptimeout} if $config{mail}{smtptimeout};
  68. $globalDBConnect = $config{globaldb}{DBConnect} if $config{globaldb}{DBConnect};
  69. $globalDBUserName = $config{globaldb}{DBUserName} if $config{globaldb}{DBUserName};
  70. $globalDBPassword = $config{globaldb}{DBPassword} if $config{globaldb}{DBPassword};
  71. #putting this in an if clause for now so not to break other devel users
  72. if ($config{globaldb}{DBConnect}){
  73. $GLOBALDBH = DBI->connect($globalDBConnect, $globalDBUserName,
  74. $globalDBPassword);
  75. if (!$GLOBALDBH){
  76. $form = new Form;
  77. $form->error("No GlobalDBH Configured or Could not Connect");
  78. }
  79. }
  80. # These lines prevent other apps in mod_perl from seeing the global db
  81. # connection info
  82. my $globalDBConnect = undef;
  83. my $globalUserName = undef;
  84. my $globalPassword = undef;
  85. 1;