[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [117] trunk
- Subject: SF.net SVN: ledger-smb: [117] trunk
- From: ..hidden..
- Date: Mon, 18 Sep 2006 22:42:45 -0700
Revision: 117
http://svn.sourceforge.net/ledger-smb/?rev=117&view=rev
Author: einhverfr
Date: 2006-09-18 22:42:37 -0700 (Mon, 18 Sep 2006)
Log Message:
-----------
Added superuser login for admin.pl and User.pm
Modified Paths:
--------------
trunk/LedgerSMB/User.pm
trunk/bin/mozilla/admin.pl
Removed Paths:
-------------
trunk/ledger-smb.conf
Modified: trunk/LedgerSMB/User.pm
===================================================================
--- trunk/LedgerSMB/User.pm 2006-09-19 05:00:52 UTC (rev 116)
+++ trunk/LedgerSMB/User.pm 2006-09-19 05:42:37 UTC (rev 117)
@@ -308,23 +308,36 @@
&dbconnect_vars($form, $form->{dbdefault});
# The below line connects to Template1 or another template file in order
# to create the db. One must disconnect and reconnect later.
- my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+ my $superdbh = DBI->connect(
+ $form->{dbconnect},
+ $form->{dbsuperuser},
+ $form->{dbsuperpasswd}
+ ) or $form->dberror;
my $query = qq|$dbcreate{$form->{dbdriver}}|;
- $dbh->do($query) || $form->dberror($query);
+ $superdbh->do($query) || $form->dberror($query);
- $dbh->disconnect;
+ $superdbh->disconnect;
#Reassign for the work below
&dbconnect_vars($form, $form->{db});
- my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+ my $dbh = DBI->connect(
+ $form->{dbconnect},
+ $form->{dbuser},
+ $form->{dbpasswd}
+ ) or $form->dberror;
+ my $superdbh = DBI->connect(
+ $form->{dbconnect},
+ $form->{dbsuperuser},
+ $form->{dbsuperpasswd}
+ ) or $form->dberror;
# JD: We need to check for plpgsql, if it isn't there create it, if we can't error
# Good chance I will have to do this twice as I get used to the way the code is
# structured
my %langcreate = ( 'Pg' => qq|CREATE LANGUAGE plpgsql|);
my $query = qq|$langcreate{$form->{dbdriver}}|;
- $dbh->do($query) || $form->dberror($query);
+ $superdbh->do($query);
# create the tables
my $dbdriver = ($form->{dbdriver} =~ /Pg/) ? 'Pg' : $form->{dbdriver};
Modified: trunk/bin/mozilla/admin.pl
===================================================================
--- trunk/bin/mozilla/admin.pl 2006-09-19 05:00:52 UTC (rev 116)
+++ trunk/bin/mozilla/admin.pl 2006-09-19 05:42:37 UTC (rev 117)
@@ -1165,13 +1165,18 @@
<tr>
<th align="right">|.$locale->text('User').qq|</th>
<td><input name="dbuser" size="10" value="$form->{dbuser}" /></td>
- <th align="right">|.$locale->text('Password').qq|</th>
- <td><input type="password" name="dbpasswd" size="10" /></td>
+<th align="right">|.$locale->text('Password').qq|</th>
+<td><input type="password" name="dbpasswd" size="10" /></td>
</tr>
<tr>
<th align="right">$form->{connectstring}</th>
<td colspan="3"><input name="dbdefault" size="10" value="$form->{dbdefault}" /></td>
</tr>
+<th align="right">|.$locale->text("Superuser").qq|</th>
+ <td><input name="dbsuperuser" size="10" value="$form->{dbsuperuser}" /></td>
+<th align="right">|.$locale->text('Password').qq|</th>
+<td><input type="password" name="dbsuperpasswd" size="10" /></td>
+
</table>
</td>
</tr>
@@ -1317,7 +1322,7 @@
</table>
|;
- $form->hide_form(qw(dbdriver dbuser dbhost dbport dbpasswd dbdefault path sessionid));
+ $form->hide_form(qw(dbdriver dbsuperuser dbsuperpasswd dbuser dbhost dbport dbpasswd dbdefault path sessionid));
print qq|
<input name="callback" type="hidden" value="$form->{script}?action=list_users&path=$form->{path}&sessionid=$form->{sessionid}" />
Deleted: trunk/ledger-smb.conf
===================================================================
--- trunk/ledger-smb.conf 2006-09-19 05:00:52 UTC (rev 116)
+++ trunk/ledger-smb.conf 2006-09-19 05:42:37 UTC (rev 117)
@@ -1,44 +0,0 @@
-use vars qw($userspath $spool $memberfile $templates $sendmail $language $sid $latex %printer $gzip);
-
-# 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";
-
-# on mac os X using Fink's Perl libs, add the path
-#$ENV{PERL5LIB} .= ":/sw/lib/perl5";
-
-
-1;
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.