[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [268] trunk



Revision: 268
          http://svn.sourceforge.net/ledger-smb/?rev=268&view=rev
Author:   einhverfr
Date:     2006-10-23 17:01:16 -0700 (Mon, 23 Oct 2006)

Log Message:
-----------
Moved all scalars out of ledger-smb.conf

Modified Paths:
--------------
    trunk/LedgerSMB/AA.pm
    trunk/LedgerSMB/AM.pm
    trunk/LedgerSMB/BP.pm
    trunk/LedgerSMB/CP.pm
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB/IR.pm
    trunk/LedgerSMB/IS.pm
    trunk/LedgerSMB/JC.pm
    trunk/LedgerSMB/Log.pm
    trunk/LedgerSMB/OE.pm
    trunk/LedgerSMB/Session.pm
    trunk/LedgerSMB/Sysconfig.pm
    trunk/LedgerSMB/User.pm
    trunk/admin.pl
    trunk/bin/aa.pl
    trunk/bin/admin.pl
    trunk/bin/am.pl
    trunk/bin/arap.pl
    trunk/bin/arapprn.pl
    trunk/bin/bp.pl
    trunk/bin/cp.pl
    trunk/bin/hr.pl
    trunk/bin/io.pl
    trunk/bin/is.pl
    trunk/bin/jc.pl
    trunk/bin/login.pl
    trunk/bin/oe.pl
    trunk/bin/pe.pl
    trunk/bin/pos.pl
    trunk/bin/rp.pl
    trunk/ledger-smb.conf
    trunk/login.pl
    trunk/menu.pl

Modified: trunk/LedgerSMB/AA.pm
===================================================================
--- trunk/LedgerSMB/AA.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/AA.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -595,11 +595,11 @@
 	my $sth = $dbh->prepare($query);
 	$sth->execute($form->{id}) || $form->dberror($query);
 
-	my $spoolfile;
+	my ${LedgerSMB::Sysconfig::spool}file;
 	my @spoolfiles = ();
 
-	while (($spoolfile) = $sth->fetchrow_array) {
-		push @spoolfiles, $spoolfile;
+	while ((${LedgerSMB::Sysconfig::spool}file) = $sth->fetchrow_array) {
+		push @spoolfiles, ${LedgerSMB::Sysconfig::spool}file;
 	}
  
 	$sth->finish;
@@ -611,8 +611,8 @@
 	my $rc = $dbh->commit;
 
 	if ($rc) {
-		foreach $spoolfile (@spoolfiles) {
-			unlink "$spool/$spoolfile" if $spoolfile;
+		foreach ${LedgerSMB::Sysconfig::spool}file (@spoolfiles) {
+			unlink "${LedgerSMB::Sysconfig::spool}/$spoolfile" if $spoolfile;
 		}
 	}
 

Modified: trunk/LedgerSMB/AM.pm
===================================================================
--- trunk/LedgerSMB/AM.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/AM.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -1238,9 +1238,9 @@
 	if ($form->{file} =~ /^(.:)*?\/|\.\.\/|^\//){
 		$form->error("Directory transversal not allowed.");
 	}
-	my $userspath = ${main::userspath};
-	if ($form->{file} =~ /^$userspath\//){
-		$form->error("Not allowed to access $userspath/ with this method");
+	my ${LedgerSMB::Sysconfig::userspath} = ${main::userspath};
+	if ($form->{file} =~ /^${LedgerSMB::Sysconfig::userspath}\//){
+		$form->error("Not allowed to access ${LedgerSMB::Sysconfig::userspath}/ with this method");
 	}
 	my $whitelisted = 0;
 	for (@allowedsuff){
@@ -1292,7 +1292,7 @@
 
 sub save_preferences {
 
-	my ($self, $myconfig, $form, $memberfile, $userspath) = @_;
+	my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::memberfile}, ${LedgerSMB::Sysconfig::userspath}) = @_;
 
 	# connect to database
 	my $dbh = $form->{dbh};
@@ -1317,7 +1317,7 @@
 
 	$dbh->commit;
 
-	my $myconfig = new User "$memberfile", "$form->{login}";
+	my $myconfig = new User "${LedgerSMB::Sysconfig::memberfile}", "$form->{login}";
 
 	foreach my $item (keys %$form) {
 		$myconfig->{$item} = $form->{$item};
@@ -1325,7 +1325,7 @@
 
 	$myconfig->{password} = $form->{new_password} if ($form->{old_password} ne $form->{new_password});
 
-	$myconfig->save_member($memberfile, $userspath);
+	$myconfig->save_member(${LedgerSMB::Sysconfig::memberfile}, ${LedgerSMB::Sysconfig::userspath});
 
 	1;
 
@@ -1565,7 +1565,7 @@
 
 sub backup {
 
-	my ($self, $myconfig, $form, $userspath, $gzip) = @_;
+	my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::userspath}, ${LedgerSMB::Sysconfig::gzip}) = @_;
 
 	my $mail;
 	my $err;
@@ -1577,7 +1577,7 @@
 	$t[4] = substr("0$t[4]", -2);
 
 	my $boundary = time;
-	my $tmpfile = "$userspath/$boundary.$myconfig->{dbname}-$form->{dbversion}-$t[5]$t[4]$t[3].sql";
+	my $tmpfile = "${LedgerSMB::Sysconfig::userspath}/$boundary.$myconfig->{dbname}-$form->{dbversion}-$t[5]$t[4]$t[3].sql";
 	my $out = $form->{OUT};
 	$form->{OUT} = ">$tmpfile";
 
@@ -1596,8 +1596,8 @@
 	my $suffix = "";
 
 	if ($form->{media} eq 'email') {
-		if ($gzip){
-			print OUT `pg_dump -U $myconfig->{dbuser} -h $myconfig->{dbhost} $myconfig->{dbname} | $gzip`;
+		if (${LedgerSMB::Sysconfig::gzip}){
+			print OUT `pg_dump -U $myconfig->{dbuser} -h $myconfig->{dbhost} $myconfig->{dbname} | ${LedgerSMB::Sysconfig::gzip}`;
 		} else {
 			print OUT `pg_dump -U $myconfig->{dbuser} -h $myconfig->{dbhost} $myconfig->{dbname}`;
 		}
@@ -1625,8 +1625,8 @@
 
 		print OUT qq|Content-Type: application/file;\n| .
 		qq|Content-Disposition: attachment; filename="$myconfig->{dbname}-$form->{dbversion}-$t[5]$t[4]$t[3].sql$suffix"\n\n|;
-		if ($gzip){
-			print OUT `pg_dump -U $myconfig->{dbuser} -h $myconfig->{dbhost} $myconfig->{dbname} | $gzip`;
+		if (${LedgerSMB::Sysconfig::gzip}){
+			print OUT `pg_dump -U $myconfig->{dbuser} -h $myconfig->{dbhost} $myconfig->{dbname} | ${LedgerSMB::Sysconfig::gzip}`;
 		} else {
 			print OUT `pg_dump -U $myconfig->{dbuser} -h $myconfig->{dbhost} $myconfig->{dbname}`;
 		}

Modified: trunk/LedgerSMB/BP.pm
===================================================================
--- trunk/LedgerSMB/BP.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/BP.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -242,7 +242,7 @@
 
 sub delete_spool {
 
-	my ($self, $myconfig, $form, $spool) = @_;
+	my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::spool}) = @_;
 
 	# connect to database, turn AutoCommit off
 	my $dbh = $form->dbconnect_noauto($myconfig);
@@ -278,7 +278,7 @@
 
 	if ($rc) {
 		foreach my $i (1 .. $form->{rowcount}) {
-			$_ = qq|$spool/$form->{"spoolfile_$i"}|;
+			$_ = qq|${LedgerSMB::Sysconfig::spool}/$form->{"spoolfile_$i"}|;
 			if ($form->{"checked_$i"}) {
 				unlink;
 			}
@@ -291,7 +291,7 @@
 
 sub print_spool {
 
-	my ($self, $myconfig, $form, $spool) = @_;
+	my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::spool}) = @_;
 
 	# connect to database
 	my $dbh = $form->dbconnect_noauto($myconfig);
@@ -310,10 +310,10 @@
 			open(OUT, $form->{OUT}) or $form->error("$form->{OUT} : $!");
 			binmode(OUT);
 
-			$spoolfile = qq|$spool/$form->{"spoolfile_$i"}|;
+			${LedgerSMB::Sysconfig::spool}file = qq|$spool/$form->{"spoolfile_$i"}|;
 
 			# send file to printer
-			open(IN, $spoolfile) or $form->error("$spoolfile : $!");
+			open(IN, ${LedgerSMB::Sysconfig::spool}file) or $form->error("$spoolfile : $!");
 			binmode(IN);
 
 			while (<IN>) {

Modified: trunk/LedgerSMB/CP.pm
===================================================================
--- trunk/LedgerSMB/CP.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/CP.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -266,7 +266,7 @@
 
 	my $vth = $dbh->prepare($query);
 
-	my $spoolfile;
+	my ${LedgerSMB::Sysconfig::spool}file;
 
 	while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
 
@@ -276,8 +276,8 @@
 		$vth->execute($ref->{id});
 		$ref->{queue} = "";
 	
-		while (($spoolfile) = $vth->fetchrow_array) {
-			$ref->{queued} .= "$form->{formname} $spoolfile ";
+		while ((${LedgerSMB::Sysconfig::spool}file) = $vth->fetchrow_array) {
+			$ref->{queued} .= "$form->{formname} ${LedgerSMB::Sysconfig::spool}file ";
 		}
 
 		$vth->finish;

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/Form.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -570,7 +570,7 @@
 
 sub parse_template {
 
-	my ($self, $myconfig, $userspath) = @_;
+	my ($self, $myconfig, ${LedgerSMB::Sysconfig::userspath}) = @_;
 
 	my ($chars_per_line, $lines_on_first_page, $lines_on_second_page) = (0, 0, 0);
 	my ($current_page, $current_line) = (1, 1);
@@ -605,7 +605,7 @@
 	my $fileid = time;
 	my $tmpfile = $self->{IN};
 	$tmpfile =~ s/\./_$self->{fileid}./ if $self->{fileid};
-	$self->{tmpfile} = "$userspath/${fileid}_${tmpfile}";
+	$self->{tmpfile} = "${LedgerSMB::Sysconfig::userspath}/${fileid}_${tmpfile}";
 
 	if ($self->{format} =~ /(postscript|pdf)/ || $self->{media} eq 'email') {
 		$out = $self->{OUT};
@@ -822,15 +822,15 @@
 
 		use Cwd;
 		$self->{cwd} = cwd();
-		$self->{tmpdir} = "$self->{cwd}/$userspath";
+		$self->{tmpdir} = "$self->{cwd}/${LedgerSMB::Sysconfig::userspath}";
 
-		unless (chdir("$userspath")) {
+		unless (chdir("${LedgerSMB::Sysconfig::userspath}")) {
 			$err = $!;
 			$self->cleanup;
 			$self->error("chdir : $err");
 		}
 
-		$self->{tmpfile} =~ s/$userspath\///g;
+		$self->{tmpfile} =~ s/${LedgerSMB::Sysconfig::userspath}\///g;
 
 		$self->{errfile} = $self->{tmpfile};
 		$self->{errfile} =~ s/tex$/err/;
@@ -2407,7 +2407,7 @@
 	my $dbh = $self->{dbh};
 
 	my %queued = split / +/, $self->{queued};
-	my $spoolfile = ($queued{$self->{formname}}) ? "'$queued{$self->{formname}}'" : 'NULL';
+	my ${LedgerSMB::Sysconfig::spool}file = ($queued{$self->{formname}}) ? "'$queued{$self->{formname}}'" : 'NULL';
 
 	my $query = qq|DELETE FROM status
 					WHERE formname = ?
@@ -2427,7 +2427,7 @@
 		VALUES (?, ?, ?, ?, ?)|;
 
 	$sth = $dbh->prepare($query);
-	$sth->execute($self->{id}, $printed, $emailed, $spoolfile, 
+	$sth->execute($self->{id}, $printed, $emailed, ${LedgerSMB::Sysconfig::spool}file, 
 			$self->{formname});
 	$sth->finish;
 

Modified: trunk/LedgerSMB/IR.pm
===================================================================
--- trunk/LedgerSMB/IR.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/IR.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -703,11 +703,11 @@
   my $sth = $dbh->prepare($query);
   $sth->execute || $form->dberror($query);
 
-  my $spoolfile;
+  my ${LedgerSMB::Sysconfig::spool}file;
   my @spoolfiles = ();
 
-  while (($spoolfile) = $sth->fetchrow_array) {
-    push @spoolfiles, $spoolfile;
+  while ((${LedgerSMB::Sysconfig::spool}file) = $sth->fetchrow_array) {
+    push @spoolfiles, ${LedgerSMB::Sysconfig::spool}file;
   }
   $sth->finish;
   
@@ -728,8 +728,8 @@
       $dbh->commit;
     }
 
-    foreach $spoolfile (@spoolfiles) {
-      unlink "$spool/$spoolfile" if $spoolfile;
+    foreach ${LedgerSMB::Sysconfig::spool}file (@spoolfiles) {
+      unlink "${LedgerSMB::Sysconfig::spool}/$spoolfile" if $spoolfile;
     }
   }
   

Modified: trunk/LedgerSMB/IS.pm
===================================================================
--- trunk/LedgerSMB/IS.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/IS.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -1224,7 +1224,7 @@
 
 
 sub delete_invoice {
-  my ($self, $myconfig, $form, $spool) = @_;
+  my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::spool}) = @_;
 
   # connect to database
   my $dbh = $form->dbconnect_noauto($myconfig);
@@ -1251,11 +1251,11 @@
   my $sth = $dbh->prepare($query);
   $sth->execute || $form->dberror($query);
 
-  my $spoolfile;
+  my ${LedgerSMB::Sysconfig::spool}file;
   my @spoolfiles = ();
   
-  while (($spoolfile) = $sth->fetchrow_array) {
-    push @spoolfiles, $spoolfile;
+  while ((${LedgerSMB::Sysconfig::spool}file) = $sth->fetchrow_array) {
+    push @spoolfiles, ${LedgerSMB::Sysconfig::spool}file;
   }
   $sth->finish;  
 
@@ -1267,8 +1267,8 @@
   my $rc = $dbh->commit;
 
   if ($rc) {
-    foreach $spoolfile (@spoolfiles) {
-      unlink "$spool/$spoolfile" if $spoolfile;
+    foreach ${LedgerSMB::Sysconfig::spool}file (@spoolfiles) {
+      unlink "${LedgerSMB::Sysconfig::spool}/$spoolfile" if $spoolfile;
     }
   }
   

Modified: trunk/LedgerSMB/JC.pm
===================================================================
--- trunk/LedgerSMB/JC.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/JC.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -308,11 +308,11 @@
   my $sth = $dbh->prepare($query);
   $sth->execute || $form->dberror($query);
 
-  my $spoolfile;
+  my ${LedgerSMB::Sysconfig::spool}file;
   my @spoolfiles = ();
 
-  while (($spoolfile) = $sth->fetchrow_array) {
-    push @spoolfiles, $spoolfile;
+  while ((${LedgerSMB::Sysconfig::spool}file) = $sth->fetchrow_array) {
+    push @spoolfiles, ${LedgerSMB::Sysconfig::spool}file;
   }
   $sth->finish;
 
@@ -325,8 +325,8 @@
   my $rc = $dbh->commit;
 
   if ($rc) {
-    foreach $spoolfile (@spoolfiles) {
-      unlink "$spool/$spoolfile" if $spoolfile;
+    foreach ${LedgerSMB::Sysconfig::spool}file (@spoolfiles) {
+      unlink "${LedgerSMB::Sysconfig::spool}/$spoolfile" if $spoolfile;
     }
   }
 

Modified: trunk/LedgerSMB/Log.pm
===================================================================
--- trunk/LedgerSMB/Log.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/Log.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -46,7 +46,7 @@
 our $fh;
 
 sub print { 
-	if (!$LSMBConfig::logging){
+	if (!$LedgerSMB::Sysconfig::logging){
 		return 0;
 	}
 	shift;

Modified: trunk/LedgerSMB/OE.pm
===================================================================
--- trunk/LedgerSMB/OE.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/OE.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -665,7 +665,7 @@
 
 
 sub delete {
-	my ($self, $myconfig, $form, $spool) = @_;
+	my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::spool}) = @_;
 
 	# connect to database
 	my $dbh = $form->{dbh};
@@ -678,11 +678,11 @@
 	$sth = $dbh->prepare($query);
 	$sth->execute($form->{id}) || $form->dberror($query);
 
-	my $spoolfile;
+	my ${LedgerSMB::Sysconfig::spool}file;
 	my @spoolfiles = ();
 
-	while (($spoolfile) = $sth->fetchrow_array) {
-		push @spoolfiles, $spoolfile;
+	while ((${LedgerSMB::Sysconfig::spool}file) = $sth->fetchrow_array) {
+		push @spoolfiles, ${LedgerSMB::Sysconfig::spool}file;
 	}
 	$sth->finish;
 
@@ -751,8 +751,8 @@
 	$dbh->disconnect;
 
 	if ($rc) {
-		foreach $spoolfile (@spoolfiles) {
-			unlink "$spool/$spoolfile" if $spoolfile;
+		foreach ${LedgerSMB::Sysconfig::spool}file (@spoolfiles) {
+			unlink "${LedgerSMB::Sysconfig::spool}/$spoolfile" if $spoolfile;
 		}
   	}
   

Modified: trunk/LedgerSMB/Session.pm
===================================================================
--- trunk/LedgerSMB/Session.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/Session.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -16,8 +16,8 @@
 
 use LedgerSMB::Sysconfig;
 
-if (!${LSMBConfig::session}){
-	${LSMBConfig::session} = 'DB';
+if (!${LedgerSMB::Sysconfig::session}){
+	${LedgerSMB::Sysconfig::session} = 'DB';
 }
 
-require "LedgerSMB/Session/".${LSMBConfig::session}.".pm";
+require "LedgerSMB/Session/".${LedgerSMB::Sysconfig::session}.".pm";

Modified: trunk/LedgerSMB/Sysconfig.pm
===================================================================
--- trunk/LedgerSMB/Sysconfig.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/Sysconfig.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -2,12 +2,50 @@
 # configuration directives will go here,  This will probably not fully replace
 # the ledger-smb.conf until 1.3, however.
 
-package LSMBConfig;
+package LedgerSMB::Sysconfig;
 
 $session='DB';
 $logging=0; # No logging on by default
 
 @io_lineitem_columns = qw(unit onhand sellprice discount linetotal);
 
+# if you have latex installed set to 1
+$latex = 1;
 
+# spool directory for batch printing
+$spool = "spool";
+
+# path to user configuration files
+$userspath = "users";
+
+# templates base directory
+$templates = "templates";
+
+# member file
+$memberfile = "users/members";
+
+# location of sendmail
+$sendmail = "| /usr/sbin/sendmail -t";
+
+# set language for login and admin
+$language = "";
+
+# Maximum number of invoices that can be printed on a check
+$check_max_invoices = 5;
+
+# program to use for file compression
+$gzip = "gzip -S .gz";
+
+#################################
+# Global database parameters
+#################################
+# These parameters *must* be set correctly
+# for LedgerSMB >= 1.2 to work
+my $globalDBConnect = 'dbi:Pg:dbname=ledgersmb;host=localhost;port=5432';
+my $globalUserName = "ledgersmb";
+my $globalPassword = "set me to correct password";
+
+#$GLOBALDBH = DBI->connect($globalDBConnect, $globalDBUserName, $globalDBPassword); 
+
+
 1;

Modified: trunk/LedgerSMB/User.pm
===================================================================
--- trunk/LedgerSMB/User.pm	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/LedgerSMB/User.pm	2006-10-24 00:01:16 UTC (rev 268)
@@ -98,7 +98,7 @@
 
 
 sub login {
-  my ($self, $form, $userspath) = @_;
+  my ($self, $form, ${LedgerSMB::Sysconfig::userspath}) = @_;
 
   my $rc = -1;
   
@@ -112,9 +112,9 @@
     }
     
 	#there shouldn't be any harm in always doing this. It might even un-bork things.
-  	$self->create_config("$userspath/$self->{login}.conf");
+  	$self->create_config("${LedgerSMB::Sysconfig::userspath}/$self->{login}.conf");
     
-    do "$userspath/$self->{login}.conf";
+    do "${LedgerSMB::Sysconfig::userspath}/$self->{login}.conf";
     $myconfig{dbpasswd} = unpack 'u', $myconfig{dbpasswd};
   
     # check if database is down
@@ -752,18 +752,18 @@
 
 
 sub save_member {
-	my ($self, $memberfile, $userspath) = @_;
+	my ($self, ${LedgerSMB::Sysconfig::memberfile}, ${LedgerSMB::Sysconfig::userspath}) = @_;
 
 	# format dbconnect and dboptions string
 	&dbconnect_vars($self, $self->{dbname});
 
-	$self->error("$memberfile locked!") if (-f "${memberfile}.LCK");
+	$self->error("${LedgerSMB::Sysconfig::memberfile} locked!") if (-f "${memberfile}.LCK");
 	open(FH, ">${memberfile}.LCK") or $self->error("${memberfile}.LCK : $!");
 	close(FH);
 
-	if (! open(CONF, "+<$memberfile")) {
+	if (! open(CONF, "+<${LedgerSMB::Sysconfig::memberfile}")) {
 		unlink "${memberfile}.LCK";
-		$self->error("$memberfile : $!");
+		$self->error("${LedgerSMB::Sysconfig::memberfile} : $!");
 	}
 
 	@config = <CONF>;
@@ -819,7 +819,7 @@
 	# create conf file
 	if (! $self->{'root login'}) {
 
-		$self->create_config("$userspath/$self->{login}.conf");
+		$self->create_config("${LedgerSMB::Sysconfig::userspath}/$self->{login}.conf");
 
 		$self->{dbpasswd} =~ s/\\'/'/g;
 		$self->{dbpasswd} =~ s/\\\\/\\/g;

Modified: trunk/admin.pl
===================================================================
--- trunk/admin.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/admin.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -52,7 +52,7 @@
 # setup defaults, DO NOT CHANGE
 $userspath = "users";
 $spool = "spool";
-$templates = "templates";
+${LedgerSMB::Sysconfig::templates} = "templates";
 $memberfile = "users/members";
 $sendmail = "| /usr/sbin/sendmail -t";
 %printer = ( Printer => 'lpr' );

Modified: trunk/bin/aa.pl
===================================================================
--- trunk/bin/aa.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/aa.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -132,7 +132,7 @@
   
   $form->{selectformname} = qq|<option value="transaction">|.$locale->text('Transaction');
   
-  if ($latex) {
+  if (${LedgerSMB::Sysconfig::latex}) {
     if ($form->{ARAP} eq 'AR') {
       $form->{selectformname} .= qq|
   <option value="receipt">|.$locale->text('Receipt');
@@ -721,14 +721,14 @@
 	for ("Post", "Print and Post", "Delete") { delete $button{$_} }
       }
 	
-      if (!$latex) {
+      if (!${LedgerSMB::Sysconfig::latex}) {
 	for ("Print and Post", "Print and Post as new") { delete $button{$_} }
       }
 
     } else {
       
       for ("Post as new", "Print and Post as new", "Delete") { delete $button{$_} }
-      delete $button{"Print and Post"} if ! $latex;
+      delete $button{"Print and Post"} if ! ${LedgerSMB::Sysconfig::latex};
       
       if ($transdate <= $closedto) {
 	for ("Post", "Print and Post") { delete $button{$_} }
@@ -944,7 +944,7 @@
 
 sub yes {
 
-  if (AA->delete_transaction(\%myconfig, \%$form, $spool)) {
+  if (AA->delete_transaction(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::spool})) {
     $form->redirect($locale->text('Transaction deleted!'));
   } else {
     $form->error($locale->text('Cannot delete transaction!'));

Modified: trunk/bin/admin.pl
===================================================================
--- trunk/bin/admin.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/admin.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -43,7 +43,7 @@
 
 $form = new Form;
 
-$locale = LedgerSMB::Locale->get_handle($language);
+$locale = LedgerSMB::Locale->get_handle(${LedgerSMB::Sysconfig::language});
 $locale->encoding('UTF-8');
 $form->{charset} = 'UTF-8';
 #$form->{charset} = $locale->encoding;
@@ -78,8 +78,8 @@
 	$form->error($locale->text('No Database Drivers available!')) unless (User->dbdrivers);
 
 	# create memberfile
-	if (! -f $memberfile) {
-		open(FH, ">$memberfile") or $form->error("$memberfile : $!");
+	if (! -f ${LedgerSMB::Sysconfig::memberfile}) {
+		open(FH, ">${LedgerSMB::Sysconfig::memberfile}") or $form->error("$memberfile : $!");
 		print FH qq|# LedgerSMB Accounting members
 
 [root login]
@@ -88,7 +88,7 @@
 		close FH;
 	}
 
-	$root = new User "$memberfile", "root login";
+	$root = new User "${LedgerSMB::Sysconfig::memberfile}", "root login";
 
 	unless($root && $root->{password}) { 
 		 &setup_initial_password();
@@ -192,7 +192,7 @@
 sub logout {
 
 	$form->{callback} = "$form->{script}?path=$form->{path}&amp;endsession=1";
-	unlink "$userspath/adminhash";
+	unlink "${LedgerSMB::Sysconfig::userspath}/adminhash";
 	print qq|Set-Cookie: LedgerSMB=; path=/;\n|; 
 	$form->redirect($locale->text('You are logged out'));
 
@@ -248,11 +248,11 @@
 
 sub list_users {
 
-	open(FH, "$memberfile") or $form->error("$memberfile : $!");
+	open(FH, "${LedgerSMB::Sysconfig::memberfile}") or $form->error("$memberfile : $!");
 
 	$nologin = qq|<button type="submit" class="submit" name="action" value="lock_system">|.$locale->text('Lock System').qq|</button>|;
 
-	if (-e "$userspath/nologin") {
+	if (-e "${LedgerSMB::Sysconfig::userspath}/nologin") {
 		$nologin = qq|<button type="submit" class="submit" name="action" value="unlock_system">|.$locale->text('Unlock System').qq|</button>|;
 	}
 
@@ -318,7 +318,7 @@
 		$href = "$script?action=edit&amp;login=$key&amp;path=$form->{path}&amp;sessionid=$form->{sessionid}";
 		$href =~ s/ /%20/g;
 
-		$member{$key}{templates} =~ s/^$templates\///;
+		$member{$key}{templates} =~ s/^${LedgerSMB::Sysconfig::templates}\///;
 		$member{$key}{dbhost} = $locale->text('localhost') unless $member{$key}{dbhost};
 
 		$column_data{login} = qq|<td><a href="$href">$key</a></td>|;
@@ -372,13 +372,13 @@
 	if ($form->{login}) {
 
 		# get user
-		$myconfig = new User "$memberfile", "$form->{login}";
+		$myconfig = new User "${LedgerSMB::Sysconfig::memberfile}", "$form->{login}";
 
 		for (qw(company address signature)) { $myconfig->{$_} = $form->quote($myconfig->{$_}) }
 		for (qw(address signature)) { $myconfig->{$_} =~ s/\\n/\n/g }
 
 		# strip basedir from templates directory
-		$myconfig->{templates} =~ s/^$templates\///;
+		$myconfig->{templates} =~ s/^${LedgerSMB::Sysconfig::templates}\///;
 		$myconfig->{dbpasswd} = unpack 'u', $myconfig->{dbpasswd};
 	}
 
@@ -404,11 +404,11 @@
 	$countrycodes = qq|<option value="">English</option>\n$countrycodes|;
 
 	# is there a templates basedir
-	if (! -d "$templates") {
-		$form->error($locale->text('Directory').": $templates ".$locale->text('does not exist'));
+	if (! -d "${LedgerSMB::Sysconfig::templates}") {
+		$form->error($locale->text('Directory').": ${LedgerSMB::Sysconfig::templates} ".$locale->text('does not exist'));
 	}
 
-	opendir TEMPLATEDIR, "$templates/." or $form->error("$templates : $!");
+	opendir TEMPLATEDIR, "${LedgerSMB::Sysconfig::templates}/." or $form->error("$templates : $!");
 	@all = grep !/^\.\.?$/, readdir TEMPLATEDIR;
 	closedir TEMPLATEDIR;
 
@@ -417,7 +417,7 @@
 	@alldir = ();
 	for (@all) {
 
-		if (-d "$templates/$_") {
+		if (-d "${LedgerSMB::Sysconfig::templates}/$_") {
 			push @alldir, $_;
 		}
 	}
@@ -464,7 +464,7 @@
 
 	$selectstylesheet .= "<option></option>\n";
 
-	if (%printer && $latex) {
+	if (%printer && ${LedgerSMB::Sysconfig::latex}) {
 
 		$selectprinter = "<option></option>\n";
 
@@ -770,7 +770,7 @@
 	# check for duplicates
 	if (!$form->{edit}) {
 
-		$temp = new User "$memberfile", "$form->{login}";
+		$temp = new User "${LedgerSMB::Sysconfig::memberfile}", "$form->{login}";
 
 		if ($temp->{login}) {
 			$form->error("$form->{login} ".$locale->text('is already a member!'));
@@ -787,15 +787,15 @@
 	}
 
 	# is there a basedir
-	if (! -d "$templates") {
-		$form->error($locale->text('Directory').": $templates ".$locale->text('does not exist'));
+	if (! -d "${LedgerSMB::Sysconfig::templates}") {
+		$form->error($locale->text('Directory').": ${LedgerSMB::Sysconfig::templates} ".$locale->text('does not exist'));
 	}
 
 	# add base directory to $form->{templates}
-	$form->{templates} = "$templates/$form->{templates}";
+	$form->{templates} = "${LedgerSMB::Sysconfig::templates}/$form->{templates}";
 
 
-	$myconfig = new User "$memberfile", "$form->{login}";
+	$myconfig = new User "${LedgerSMB::Sysconfig::memberfile}", "$form->{login}";
 
 	# redo acs variable and delete all the acs codes
 	@acs = split /;/, $form->{acs};
@@ -838,7 +838,7 @@
 
 	$myconfig->{packpw} = 1;
 
-	$myconfig->save_member($memberfile, $userspath);
+	$myconfig->save_member(${LedgerSMB::Sysconfig::memberfile}, ${LedgerSMB::Sysconfig::userspath});
 	# create user template directory and copy master files
 	if (! -d "$form->{templates}") {
 
@@ -849,13 +849,13 @@
 			umask(007);
 
 			# copy templates to the directory
-			opendir TEMPLATEDIR, "$templates/." or $form->error("$templates : $!");
+			opendir TEMPLATEDIR, "${LedgerSMB::Sysconfig::templates}/." or $form->error("$templates : $!");
 			@templates = grep /$form->{mastertemplates}-/, readdir TEMPLATEDIR;
 			closedir TEMPLATEDIR;
 
 			foreach $file (@templates) {
 
-				open(TEMP, "$templates/$file") or $form->error("$templates/$file : $!");
+				open(TEMP, "${LedgerSMB::Sysconfig::templates}/$file") or $form->error("$templates/$file : $!");
 
 				$file =~ s/$form->{mastertemplates}-//;
 				open(NEW, ">$form->{templates}/$file") or $form->error("$form->{templates}/$file : $!");
@@ -879,16 +879,16 @@
 
 sub delete {
 
-	$form->{templates} = ($form->{templates}) ? "$templates/$form->{templates}" : "$templates/$form->{login}";
+	$form->{templates} = ($form->{templates}) ? "${LedgerSMB::Sysconfig::templates}/$form->{templates}" : "$templates/$form->{login}";
 
-	$form->error("$memberfile ".$locale->text('locked!')) if (-f ${memberfile}.LCK);
+	$form->error("${LedgerSMB::Sysconfig::memberfile} ".$locale->text('locked!')) if (-f ${memberfile}.LCK);
 
 	open(FH, ">${memberfile}.LCK") or $form->error("${memberfile}.LCK : $!");
 	close(FH);
 
-	if (! open(CONF, "+<$memberfile")) {
+	if (! open(CONF, "+<${LedgerSMB::Sysconfig::memberfile}")) {
 		unlink "${memberfile}.LCK";
-		$form->error("$memberfile : $!");
+		$form->error("${LedgerSMB::Sysconfig::memberfile} : $!");
 	}
 
 	@config = <CONF>;
@@ -972,7 +972,7 @@
 		User->delete_login(\%$form);
 
 		# delete config file for user
-		unlink "$userspath/$form->{login}.conf";
+		unlink "${LedgerSMB::Sysconfig::userspath}/$form->{login}.conf";
 	}
 
 	$form->redirect($locale->text('User deleted!'));
@@ -1035,7 +1035,7 @@
 	$form->error($locale->text('Passwords do not match!')) if $form->{new_password} ne $form->{confirm_password};
 	$root->{password} = $form->{new_password};
 	$root->{'root login'} = 1;
-	$root->save_member($memberfile);
+	$root->save_member(${LedgerSMB::Sysconfig::memberfile});
 	$form->{callback} = "$form->{script}?action=list_users&amp;path=$form->{path}&amp;sessionid=$form->{sessionid}";
 	$form->redirect($locale->text('Password changed!'));
 }
@@ -1048,7 +1048,7 @@
 
 sub check_password {
 
-	$root = new User "$memberfile", "root login";
+	$root = new User "${LedgerSMB::Sysconfig::memberfile}", "root login";
 
 	if ($root->{password}) {
 
@@ -1064,7 +1064,7 @@
 
 			&get_hash;
 
-			open(HASHFILE, "> $userspath/adminhash") || $form->error("Can't Open Hashfile: $!");
+			open(HASHFILE, "> ${LedgerSMB::Sysconfig::userspath}/adminhash") || $form->error("Can't Open Hashfile: $!");
 			print HASHFILE $form->{hash}; 
 			print qq|Set-Cookie: LedgerSMB=$form->{hash}; path=/;\n|;
 
@@ -1077,14 +1077,14 @@
 				$cookie = ($form->{path} eq 'bin/lynx') ? $cookie{login} : $cookie{"LedgerSMB-root login"};
 
 				#fixes problem with first login and such
-				if (!(-f "$userspath/adminhash")) {
+				if (!(-f "${LedgerSMB::Sysconfig::userspath}/adminhash")) {
 					&get_hash;
-					open(HASHFILE, "> $userspath/adminhash") || $form->error("Can't Open Hashfile: $!");
+					open(HASHFILE, "> ${LedgerSMB::Sysconfig::userspath}/adminhash") || $form->error("Can't Open Hashfile: $!");
 					print HASHFILE $form->{hash}; 
 					close(HASHFILE);
 				}	
 
-				open (HASHFILE, "< $userspath/adminhash") || $form->error("Can't Open Hashfile: $!");
+				open (HASHFILE, "< ${LedgerSMB::Sysconfig::userspath}/adminhash") || $form->error("Can't Open Hashfile: $!");
 				chomp($form->{hash} = <HASHFILE>);
 				%cookies = split /[=;]/, $ENV{HTTP_COOKIE};
 
@@ -1372,7 +1372,7 @@
 
 sub delete_dataset {
 
-	if (@dbsources = User->dbsources_unused(\%$form, $memberfile)) {
+	if (@dbsources = User->dbsources_unused(\%$form, ${LedgerSMB::Sysconfig::memberfile})) {
 
 		foreach $item (sort @dbsources) {
 			$dbsources .= qq|<input name="db" class="radio" type="radio" value="$item" />&nbsp;$item |;
@@ -1463,7 +1463,7 @@
 
 sub unlock_system {
 
-	unlink "$userspath/nologin";
+	unlink "${LedgerSMB::Sysconfig::userspath}/nologin";
 	$form->{callback} = "$form->{script}?action=list_users&amp;path=$form->{path}&amp;sessionid=$form->{sessionid}";
 	$form->redirect($locale->text('Lockfile removed!'));
 }
@@ -1471,7 +1471,7 @@
 
 sub lock_system {
 
-	open(FH, ">$userspath/nologin") or $form->error($locale->text('Cannot create Lock!'));
+	open(FH, ">${LedgerSMB::Sysconfig::userspath}/nologin") or $form->error($locale->text('Cannot create Lock!'));
 	close(FH);
 	$form->{callback} = "$form->{script}?action=list_users&amp;path=$form->{path}&amp;sessionid=$form->{sessionid}";
 	$form->redirect($locale->text('Lockfile created!'));

Modified: trunk/bin/am.pl
===================================================================
--- trunk/bin/am.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/am.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -2064,7 +2064,7 @@
   }
   $selectstylesheet .= "<option>\n";
   
-  if (%printer && $latex) {
+  if (%printer && ${LedgerSMB::Sysconfig::latex}) {
     $selectprinter = "<option>\n";
     foreach $item (sort keys %printer) {
       if ($myconfig{printer} eq $item) {
@@ -2233,7 +2233,7 @@
     $form->error($locale->text('Password does not match!')) if $form->{new_password} ne $form->{confirm_password};
   }
 
-  if (AM->save_preferences(\%myconfig, \%$form, $memberfile, $userspath)) {
+  if (AM->save_preferences(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::memberfile}, ${LedgerSMB::Sysconfig::userspath})) {
     $form->redirect($locale->text('Preferences saved!'));
   } else {
     $form->error($locale->text('Cannot save preferences!'));
@@ -2247,12 +2247,12 @@
   if ($form->{media} eq 'email') {
     $form->error($locale->text('No email address for')." $myconfig{name}") unless ($myconfig{email});
     
-    $form->{OUT} = "$sendmail";
+    $form->{OUT} = "${LedgerSMB::Sysconfig::sendmail}";
 
   }
 
   $SIG{INT} = 'IGNORE';
-  AM->backup(\%myconfig, \%$form, $userspath, $gzip);
+  AM->backup(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::userspath}, ${LedgerSMB::Sysconfig::gzip});
 
   if ($form->{media} eq 'email') {
     $form->redirect($locale->text('Backup sent to').qq| $myconfig{email}|);
@@ -2954,7 +2954,7 @@
   }
   
   $form->{selectformat} = qq|<option value="html">html\n|;
-  if ($latex) {
+  if (${LedgerSMB::Sysconfig::latex}) {
     $form->{selectformat} .= qq|
             <option value="postscript">|.$locale->text('Postscript').qq|
 	    <option value="pdf">|.$locale->text('PDF');
@@ -3083,7 +3083,7 @@
 	  $form->info(" ..... ".$locale->text('done'));
 	  
 	  # print form
-	  if ($latex && $ok) {
+	  if (${LedgerSMB::Sysconfig::latex} && $ok) {
 	    $ok = &print_recurring(\%$pt, $defaultprinter);
 	  }
 	  
@@ -3136,7 +3136,7 @@
 	  }
 
 	  # print form
-	  if ($latex && $ok) {
+	  if (${LedgerSMB::Sysconfig::latex} && $ok) {
 	    &print_recurring(\%$pt, $defaultprinter);
 	  }
 

Modified: trunk/bin/arap.pl
===================================================================
--- trunk/bin/arap.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/arap.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -615,7 +615,7 @@
   }
 
 
-  if (%printer && $latex && %formname) {
+  if (%printer && ${LedgerSMB::Sysconfig::latex} && %formname) {
     $selectprinter = qq|<option>\n|;
     for (sort keys %printer) { $selectprinter .= qq|<option value="$_">$_\n| }
     

Modified: trunk/bin/arapprn.pl
===================================================================
--- trunk/bin/arapprn.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/arapprn.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -107,7 +107,7 @@
   }
   if ($filename = $queued{$form->{formname}}) {
     $form->{queued} =~ s/$form->{formname} $filename//;
-    unlink "$spool/$filename";
+    unlink "${LedgerSMB::Sysconfig::spool}/$filename";
     $filename =~ s/\..*$//g;
   } else {
     $filename = time;
@@ -115,7 +115,7 @@
   }
 
   $filename .= ($form->{format} eq 'postscript') ? '.ps' : '.pdf';
-  $form->{OUT} = ">$spool/$filename";
+  $form->{OUT} = ">${LedgerSMB::Sysconfig::spool}/$filename";
 
   $form->{queued} .= " $form->{formname} $filename";
   $form->{queued} =~ s/^ //;
@@ -215,7 +215,7 @@
                    id          => $form->{id} );
 
     $form->{audittrail} .= $form->audittrail("", \%myconfig, \%audittrail);
-    $form->{OUT} = ">$spool/$filename";
+    $form->{OUT} = ">${LedgerSMB::Sysconfig::spool}/$filename";
 
     $form->{queued} .= " $form->{formname} $filename";
     $form->{queued} =~ s/^ //;
@@ -252,7 +252,7 @@
   $form->{fileid} = $invnumber;
   $form->{fileid} =~ s/(\s|\W)+//g;
 
-  $form->parse_template(\%myconfig, $userspath);
+  $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath});
 
   if ($form->{previousform}) {
   
@@ -415,7 +415,7 @@
 
     if ($filename = $queued{$form->{formname}}) {
       $form->{queued} =~ s/$form->{formname} $filename//;
-      unlink "$spool/$filename";
+      unlink "${LedgerSMB::Sysconfig::spool}/$filename";
       $filename =~ s/\..*$//g;
     } else {
       $filename = time;
@@ -423,7 +423,7 @@
     }
 
     $filename .= ($form->{format} eq 'postscript') ? '.ps' : '.pdf';
-    $form->{OUT} = ">$spool/$filename";
+    $form->{OUT} = ">${LedgerSMB::Sysconfig::spool}/$filename";
 
     $form->{queued} .= " $form->{formname} $filename";
     $form->{queued} =~ s/^ //;
@@ -468,7 +468,7 @@
   $form->{fileid} = $form->{invnumber};
   $form->{fileid} =~ s/(\s|\W)+//g;
 
-  $form->parse_template(\%myconfig, $userspath);
+  $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath});
 
   if (%$old_form) {
     $old_form->{invnumber} = $form->{invnumber};
@@ -625,12 +625,12 @@
 
   $form->{selectformat} = qq|<option value="html">html\n|;
   
-  if (%printer && $latex) {
+  if (%printer && ${LedgerSMB::Sysconfig::latex}) {
     for (sort keys %printer) { $media .= qq| 
           <option value="$_">$_| }
   }
 
-  if ($latex) {
+  if (${LedgerSMB::Sysconfig::latex}) {
     $form->{selectformat} .= qq|
             <option value="postscript">|.$locale->text('Postscript').qq|
 	    <option value="pdf">|.$locale->text('PDF');

Modified: trunk/bin/bp.pl
===================================================================
--- trunk/bin/bp.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/bp.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -253,7 +253,7 @@
   $form->info($locale->text('Removing marked entries from queue ...'));
   $form->{callback} .= "&header=1" if $form->{callback};
 
-  if (BP->delete_spool(\%myconfig, \%$form, $spool)) {
+  if (BP->delete_spool(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::spool})) {
     $form->redirect($locale->text('Removed spoolfiles!'));
   } else {
     $form->error($locale->text('Cannot remove files!'));
@@ -274,7 +274,7 @@
       $form->{OUT} = "| $printer{$form->{media}}";
       $form->info($locale->text('Printing')." ...");
 
-      if (BP->print_spool(\%myconfig, \%$form, $spool)) {
+      if (BP->print_spool(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::spool})) {
 	print $locale->text('done');
 	$form->redirect($locale->text('Marked entries printed!'));
       }
@@ -432,7 +432,7 @@
     
     $column_data{transdate} = "<td>$ref->{transdate}&nbsp;</td>";
 
-    if ($spoolfile eq $ref->{spoolfile}) {
+    if (${LedgerSMB::Sysconfig::spool}file eq $ref->{spoolfile}) {
       $column_data{checked} = qq|<td></td>|;
     } else {
       $column_data{checked} = qq|<td><input name=checked_$i type=checkbox class=checkbox $form->{"checked_$i"} $form->{"checked_$i"}></td>|;
@@ -458,11 +458,11 @@
     
    
     $column_data{name} = "<td>$ref->{name}</td>";
-    $column_data{spoolfile} = qq|<td><a href=$spool/$ref->{spoolfile}>$ref->{spoolfile}</a></td>
+    $column_data{spoolfile} = qq|<td><a href=${LedgerSMB::Sysconfig::spool}/$ref->{spoolfile}>$ref->{spoolfile}</a></td>
 
 |;
 
-    $spoolfile = $ref->{spoolfile};
+    ${LedgerSMB::Sysconfig::spool}file = $ref->{spoolfile};
     
     $j++; $j %= 2;
     print "
@@ -496,7 +496,7 @@
 
   $form->hide_form(qw(callback title vc type sort module account path login sessionid));
     
-  if (%printer && $latex) {
+  if (%printer && ${LedgerSMB::Sysconfig::latex}) {
     foreach $key (sort keys %printer) {
       print qq|
 <input name=media type=radio class=radio value="$key" |;

Modified: trunk/bin/cp.pl
===================================================================
--- trunk/bin/cp.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/cp.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -452,7 +452,7 @@
   $transdate = $form->datetonum(\%myconfig, $form->{datepaid});
   $closedto = $form->datetonum(\%myconfig, $form->{closedto});
   
-  if ($latex) {
+  if (${LedgerSMB::Sysconfig::latex}) {
    
     $media = qq|<select name=media>
           <option value=screen>|.$locale->text('Screen');
@@ -486,7 +486,7 @@
 	     'Post' => { ndx => 4, key => 'O', value => $locale->text('Post') },
 	    ); 
 
-  if (! $latex) {
+  if (! ${LedgerSMB::Sysconfig::latex}) {
     delete $button{'Print'};
   }
 
@@ -1051,7 +1051,7 @@
   $transdate = $form->datetonum(\%myconfig, $form->{datepaid});
   $closedto = $form->datetonum(\%myconfig, $form->{closedto});
 
-  if ($latex) {
+  if (${LedgerSMB::Sysconfig::latex}) {
     if ($form->{selectlanguage}) {
       $form->{"selectlanguage"} = $form->unescape($form->{"selectlanguage"});
       $form->{"selectlanguage"} =~ s/ selected//;
@@ -1088,7 +1088,7 @@
 	     'Post' => { ndx => 4, key => 'O', value => $locale->text('Post') },
 	    ); 
 
-  if (! $latex) {
+  if (! ${LedgerSMB::Sysconfig::latex}) {
     delete $button{'Print'};
   }
 
@@ -1269,7 +1269,7 @@
     $form->{OUT} = "| $printer{$form->{media}}";
   }
 
-  $form->parse_template(\%myconfig, $userspath);
+  $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath});
 
 }
 
@@ -1286,8 +1286,8 @@
   %temp = ();
   for (@a) { $temp{$_} = $form->{$_} }
 
-  if (scalar @{$form->{invnumber}} > $check_max_invoices) {
-    $#{$form->{invnumber}} = $check_max_invoices - 1;
+  if (scalar @{$form->{invnumber}} > ${LedgerSMB::Sysconfig::check_max_invoices}) {
+    $#{$form->{invnumber}} = ${LedgerSMB::Sysconfig::check_max_invoices} - 1;
     $form->{invnumbers_maxed} = 1;
     $form->{message} = $locale->text("Please see attatched report for list of invoices paid.");
   }

Modified: trunk/bin/hr.pl
===================================================================
--- trunk/bin/hr.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/hr.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -716,7 +716,7 @@
 
   # if it is a login change memberfile and .conf
   if ($form->{employeelogin}) {
-    $user = new User $memberfile, $form->{employeelogin};
+    $user = new User ${LedgerSMB::Sysconfig::memberfile}, $form->{employeelogin};
 
     for (qw(name email role)) { $user->{$_} = $form->{$_} }
 
@@ -726,7 +726,7 @@
     for (qw(dbpasswd password)) { $user->{"old_$_"} = $user->{$_} }
     $user->{packpw} = 1;
 
-    $user->save_member($memberfile, $userspath) if $user->{login};
+    $user->save_member(${LedgerSMB::Sysconfig::memberfile}, ${LedgerSMB::Sysconfig::userspath}) if $user->{login};
   }
   
   $form->redirect($locale->text('Employee saved!'));

Modified: trunk/bin/io.pl
===================================================================
--- trunk/bin/io.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/io.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -1099,11 +1099,11 @@
     $media = qq|<select name=media>
 	    <option value="screen">|.$locale->text('Screen');
  
-    if (%printer && $latex) {
+    if (%printer && ${LedgerSMB::Sysconfig::latex}) {
       for (sort keys %printer) { $media .= qq|
             <option value="$_">$_| }
     }
-    if ($latex) {
+    if (${LedgerSMB::Sysconfig::latex}) {
       $media .= qq|
             <option value="queue">|.$locale->text('Queue');
     }
@@ -1118,7 +1118,7 @@
   $form->{selectformat} = qq|<option value="html">html\n|;
 #	    <option value="txt">|.$locale->text('Text');
 
-  if ($latex) {
+  if (${LedgerSMB::Sysconfig::latex}) {
     $form->{selectformat} .= qq|
             <option value="postscript">|.$locale->text('Postscript').qq|
 	    <option value="pdf">|.$locale->text('PDF');
@@ -1138,7 +1138,7 @@
     <td>$media</td>
 |;
 
-  if (%printer && $latex && $form->{media} ne 'email') {
+  if (%printer && ${LedgerSMB::Sysconfig::latex} && $form->{media} ne 'email') {
     print qq|
     <td nowrap>|.$locale->text('Copies').qq|
     <input name=copies size=2 value=$form->{copies}></td>
@@ -1457,7 +1457,7 @@
     $form->{subject} = qq|$form->{label} $form->{"${inv}number"}| unless $form->{subject};
 
     $form->{plainpaper} = 1;
-    $form->{OUT} = "$sendmail";
+    $form->{OUT} = "${LedgerSMB::Sysconfig::sendmail}";
 
     if ($form->{emailed} !~ /$form->{formname}/) {
       $form->{emailed} .= " $form->{formname}";
@@ -1505,7 +1505,7 @@
 
     if ($filename = $queued{$form->{formname}}) {
       $form->{queued} =~ s/$form->{formname} $filename//;
-      unlink "$spool/$filename";
+      unlink "${LedgerSMB::Sysconfig::spool}/$filename";
       $filename =~ s/\..*$//g;
     } else {
       $filename = time;
@@ -1513,7 +1513,7 @@
     }
 
     $filename .= ($form->{format} eq 'postscript') ? '.ps' : '.pdf';
-    $form->{OUT} = ">$spool/$filename";
+    $form->{OUT} = ">${LedgerSMB::Sysconfig::spool}/$filename";
 
     $form->{queued} .= " $form->{formname} $filename";
     $form->{queued} =~ s/^ //;
@@ -1539,7 +1539,7 @@
   $form->{fileid} = $form->{"${inv}number"};
   $form->{fileid} =~ s/(\s|\W)+//g;
   
-  $form->parse_template(\%myconfig, $userspath);
+  $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath});
 
   # if we got back here restore the previous form
   if (defined %$old_form) {

Modified: trunk/bin/is.pl
===================================================================
--- trunk/bin/is.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/is.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -663,7 +663,7 @@
 	for ("Post", "Print and Post", "Delete") { delete $button{$_} }
       }
      
-      if (!$latex) {
+      if (!${LedgerSMB::Sysconfig::latex}) {
 	for ("Print and Post", "Print and Post as new") { delete $button{$_} }
       }
 
@@ -672,7 +672,7 @@
       if ($transdate > $closedto) {
 	
 	for ("Update", "Ship to", "Print", "E-mail", "Post", "Schedule") { $a{$_} = 1 }
-	$a{'Print and Post'} = 1 if $latex;
+	$a{'Print and Post'} = 1 if ${LedgerSMB::Sysconfig::latex};
 	
       }
       for (keys %button) { delete $button{$_} if ! $a{$_} }
@@ -962,7 +962,7 @@
 
 sub yes {
 
-  if (IS->delete_invoice(\%myconfig, \%$form, $spool)) {
+  if (IS->delete_invoice(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::spool})) {
     $form->redirect($locale->text('Invoice deleted!'));
   } else {
     $form->error($locale->text('Cannot delete invoice!'));

Modified: trunk/bin/jc.pl
===================================================================
--- trunk/bin/jc.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/jc.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -629,7 +629,7 @@
       if (!$form->{locked}) {
 	for ('Update', 'Print', 'Save', 'Save as new') { $a{$_} = 1 }
 	
-	if ($latex) {
+	if (${LedgerSMB::Sysconfig::latex}) {
 	  for ('Print and Save', 'Print and Save as new') { $a{$_} = 1 }
 	}
 
@@ -645,7 +645,7 @@
 	
 	for ('Update', 'Print', 'Save') { $a{$_} = 1 }
 
-	if ($latex) {
+	if (${LedgerSMB::Sysconfig::latex}) {
 	  $a{'Print and Save'} = 1;
 	}
 
@@ -842,7 +842,7 @@
       
       if (!$form->{locked}) {
 	for ('Update', 'Print', 'Save', 'Save as new') { $a{$_} = 1 }
-	if ($latex) {
+	if (${LedgerSMB::Sysconfig::latex}) {
 	  for ('Print and Save', 'Print and Save as new') { $a{$_} = 1 }
 	}
 	if ($form->{orphaned}) {
@@ -855,7 +855,7 @@
       if ($transdate > $closedto) {
 	for ('Update', 'Print', 'Save') { $a{$_} = 1 }
 
-	if ($latex) {
+	if (${LedgerSMB::Sysconfig::latex}) {
 	  $a{'Print and Save'} = 1;
 	}
       }
@@ -1761,12 +1761,12 @@
 
   $form->{selectformat} = qq|<option value="html">html\n|;
   
-  if (%printer && $latex) {
+  if (%printer && ${LedgerSMB::Sysconfig::latex}) {
     for (sort keys %printer) { $media .= qq| 
           <option value="$_">$_| }
   }
 
-  if ($latex) {
+  if (${LedgerSMB::Sysconfig::latex}) {
     $media .= qq|
           <option value="queue">|.$locale->text('Queue');
 	  
@@ -1886,7 +1886,7 @@
 
     if ($filename = $queued{$form->{formname}}) {
       $form->{queued} =~ s/$form->{formname} $filename//;
-      unlink "$spool/$filename";
+      unlink "${LedgerSMB::Sysconfig::spool}/$filename";
       $filename =~ s/\..*$//g;
     } else {
       $filename = time;
@@ -1894,7 +1894,7 @@
     }
 
     $filename .= ($form->{format} eq 'postscript') ? '.ps' : '.pdf';
-    $form->{OUT} = ">$spool/$filename";
+    $form->{OUT} = ">${LedgerSMB::Sysconfig::spool}/$filename";
     
     $form->{queued} = "$form->{formname} $filename";
     $form->update_status(\%myconfig);
@@ -1911,7 +1911,7 @@
     $status{audittrail} .= $form->audittrail("", \%myconfig, \%audittrail);
   }
 
-  $form->parse_template(\%myconfig, $userspath);
+  $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath});
 
   if (defined %$old_form) {
 

Modified: trunk/bin/login.pl
===================================================================
--- trunk/bin/login.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/login.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -47,7 +47,7 @@
 
 $form = new Form;
 
-$locale = LedgerSMB::Locale->get_handle($language);
+$locale = LedgerSMB::Locale->get_handle(${LedgerSMB::Sysconfig::language});
 $locale->encoding('UTF-8');
 $form->{charset} = 'UTF-8';
 #$form->{charset} = $locale->encoding;
@@ -235,7 +235,7 @@
 	$form->error($locale->text('You did not enter a name!')) unless ($form->{login});
 
 	if (! $form->{beenthere}) {
-		open(FH, "$memberfile") or $form->error("$memberfile : $!");
+		open(FH, "${LedgerSMB::Sysconfig::memberfile}") or $form->error("$memberfile : $!");
 		@a = <FH>;
 		close(FH);
 
@@ -262,10 +262,10 @@
 	}
 
 
-	$user = new User $memberfile, $form->{login};
+	$user = new User ${LedgerSMB::Sysconfig::memberfile}, $form->{login};
 
 	# if we get an error back, bale out
-	if (($errno = $user->login(\%$form, $userspath)) <= -1) {
+	if (($errno = $user->login(\%$form, ${LedgerSMB::Sysconfig::userspath})) <= -1) {
 
 		$errno *= -1;
 		$err[1] = $locale->text('Access Denied!');
@@ -274,7 +274,7 @@
 
 		if ($errno == 4) {
 			# upgrade dataset and log in again
-			open FH, ">$userspath/nologin" or $form->error($!);
+			open FH, ">${LedgerSMB::Sysconfig::userspath}/nologin" or $form->error($!);
 
 			for (qw(dbname dbhost dbport dbdriver dbuser dbpasswd)) { $form->{$_} = $user->{$_} }
 
@@ -293,7 +293,7 @@
 			$user->dbupdate(\%$form);
 
 			# remove lock file
-			unlink "$userspath/nologin";
+			unlink "${LedgerSMB::Sysconfig::userspath}/nologin";
 
 			print $locale->text('done');
 

Modified: trunk/bin/oe.pl
===================================================================
--- trunk/bin/oe.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/oe.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -723,13 +723,13 @@
 
     %a = ();
     for ("Update", "Ship to", "Print", "E-mail", "Save") { $a{$_} = 1 }
-    $a{'Print and Save'} = 1 if $latex;
+    $a{'Print and Save'} = 1 if ${LedgerSMB::Sysconfig::latex};
     
     if ($form->{id}) {
       
       $a{'Delete'} = 1;
       $a{'Save as new'} = 1;
-      $a{'Print and Save as new'} = 1 if $latex;
+      $a{'Print and Save as new'} = 1 if ${LedgerSMB::Sysconfig::latex};
 
       if ($form->{type} =~ /sales_/) {
 	if ($myconfig{acs} !~ /AR--Sales Invoice/) {
@@ -1861,7 +1861,7 @@
     $err = $locale->text('Cannot delete quotation!');
   }
   
-  if (OE->delete(\%myconfig, \%$form, $spool)) {
+  if (OE->delete(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::spool})) {
     $form->redirect($msg);
   } else {
     $form->error($err);

Modified: trunk/bin/pe.pl
===================================================================
--- trunk/bin/pe.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/pe.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -2552,7 +2552,7 @@
 
     if (OE->save(\%myconfig, \%$order)) {
       if (! PE->allocate_projectitems(\%myconfig, \%$order)) {
-	OE->delete(\%myconfig, \%$order, $spool);
+	OE->delete(\%myconfig, \%$order, ${LedgerSMB::Sysconfig::spool});
       }
     } else {
       $order->error($locale->text('Failed to save order!'));

Modified: trunk/bin/pos.pl
===================================================================
--- trunk/bin/pos.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/pos.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -550,7 +550,7 @@
 	delete $button{'Delete'};
       }
 
-      delete $button{'Print and Post'} unless $latex;
+      delete $button{'Print and Post'} unless ${LedgerSMB::Sysconfig::latex};
     } else {
       for ('Print', 'Post', 'Print and Post', 'Delete') { delete $button{$_} }
     }
@@ -850,7 +850,7 @@
   delete $form->{stylesheet};
   $form->{cd_open} = $pos_config{rp_cash_drawer_open};
   
-  $form->parse_template(\%myconfig, $userspath);
+  $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath});
 
   if ($form->{printed} !~ /$form->{formname}/) {
     $form->{printed} .= " $form->{formname}";

Modified: trunk/bin/rp.pl
===================================================================
--- trunk/bin/rp.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/bin/rp.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -1751,7 +1751,7 @@
     $media = qq|
             <td><select name=media>
 	    <option value=screen>|.$locale->text('Screen');
-    if (%printer && $latex) {
+    if (%printer && ${LedgerSMB::Sysconfig::latex}) {
       for (sort keys %printer) { $media .= qq|
             <option value="$_">$_| }
     }
@@ -1760,7 +1760,7 @@
   $media =~ s/(<option value="\Q$form->{media}\E")/$1 selected/;
   $media .= qq|</select></td>|;
 
-  if ($latex) {
+  if (${LedgerSMB::Sysconfig::latex}) {
     $format .= qq|
             <option value=postscript $form->{DF}{postscript}>|.$locale->text('Postscript').qq|
 	    <option value=pdf $form->{DF}{pdf}>|.$locale->text('PDF');
@@ -1774,7 +1774,7 @@
     $media
 |;
 
-  if (%printer && $latex && $form->{media} ne 'email') {
+  if (%printer && ${LedgerSMB::Sysconfig::latex} && $form->{media} ne 'email') {
     print qq|
       <td>|.$locale->text('Copies').qq|
       <input name=copies size=2 value=$form->{copies}></td>
@@ -1891,7 +1891,7 @@
 
 sub send_email {
 
-  $form->{OUT} = "$sendmail";
+  $form->{OUT} = "${LedgerSMB::Sysconfig::sendmail}";
 
   $form->{subject} = $locale->text('Statement').qq| - $form->{todate}| unless $form->{subject};
   $form->isblank("email", $locale->text('E-mail address missing!'));
@@ -2020,7 +2020,7 @@
 	
 	for ("c0", "c30", "c60", "c90", "") { $form->{"${_}total"} = $form->format_amount(\%myconfig, $form->{"${_}total"}, 2) }
 
-	$form->parse_template(\%myconfig, $userspath);
+	$form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath});
 	
       }
     }

Modified: trunk/ledger-smb.conf
===================================================================
--- trunk/ledger-smb.conf	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/ledger-smb.conf	2006-10-24 00:01:16 UTC (rev 268)
@@ -1,49 +1,10 @@
 use vars qw($userspath $spool $memberfile $templates $sendmail $language $sid $latex %printer $gzip $GLOBALDBH);
 
-#################################
-# Global database parameters
-#################################
-# These parameters *must* be set correctly
-# for LedgerSMB >= 1.2 to work
-my $globalDBConnect = 'dbi:Pg:dbname=ledgersmb;host=localhost;port=5432';
-my $globalUserName = "ledgersmb";
-my $globalPassword = "set me to correct password";
-
-#$GLOBALDBH = DBI->connect($globalDBConnect, $globalDBUserName, $globalDBPassword); 
-
-# path to user configuration files
-$userspath = "users";
-
-# spool directory for batch printing
-$spool = "spool";
-
-# templates base directory
-$templates = "templates";
-
-# member file
-$memberfile = "users/members";
-
-# location of sendmail
-$sendmail = "| /usr/sbin/sendmail -t";
-
-# set language for login and admin
-$language = "";
-
-# Maximum number of invoices that can be printed on a check
-$check_max_invoices = 5;
-
-
-# if you have latex installed set to 1
-$latex = 1;
-
 # available printers
 %printer = ( Laser	=> 'lpr -Plaser',
              Epson	=> 'lpr -PEpson',
 	     );
 
-# program to use for file compression
-$gzip = "gzip -S .gz";
-
 # if the server can't find gzip, latex, dvips or pdflatex, add the path
 $ENV{PATH} .= ":/usr/local/bin:/usr/local/pgsql/bin";
 

Modified: trunk/login.pl
===================================================================
--- trunk/login.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/login.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -53,7 +53,7 @@
 # setup defaults, DO NOT CHANGE
 $userspath = "users";
 $spool = "spool";
-$templates = "templates";
+${LedgerSMB::Sysconfig::templates} = "templates";
 $memberfile = "users/members";
 $sendmail = "| /usr/sbin/sendmail -t";
 %printer = ( Printer => 'lpr' );

Modified: trunk/menu.pl
===================================================================
--- trunk/menu.pl	2006-10-23 23:24:57 UTC (rev 267)
+++ trunk/menu.pl	2006-10-24 00:01:16 UTC (rev 268)
@@ -49,7 +49,7 @@
 # setup defaults, DO NOT CHANGE
 $userspath = "users";
 $spool = "spool";
-$templates = "templates";
+${LedgerSMB::Sysconfig::templates} = "templates";
 $memberfile = "users/members";
 $sendmail = "| /usr/sbin/sendmail -t";
 $latex = 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.