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