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