summaryrefslogtreecommitdiff
path: root/LedgerSMB.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-07 20:03:07 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-07 20:03:07 +0000
commitab00ae90ccd370de4ca0c3f73c6d732f45fd569b (patch)
treea34cb59130fcdbc400f41bdc5ba32fea5775b92a /LedgerSMB.pm
parent3c8bf664ba66bfcf8345cdc6c0eee7b5b6eae40d (diff)
A few authentication fixes
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1715 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB.pm')
-rwxr-xr-xLedgerSMB.pm24
1 files changed, 13 insertions, 11 deletions
diff --git a/LedgerSMB.pm b/LedgerSMB.pm
index 7980d0b4..2be20f6d 100755
--- a/LedgerSMB.pm
+++ b/LedgerSMB.pm
@@ -646,6 +646,7 @@ sub _db_init {
$auth =~ s/Basic //i; # strip out basic authentication preface
$auth = MIME::Base64::decode($auth);
my ($login, $password) = split(/:/, $auth);
+ print STDERR "$auth\n";
$self->{login} = $login;
$self->{company} ||= 'lsmb13';
my $dbname = $self->{company};
@@ -659,16 +660,6 @@ sub _db_init {
);
my $dbh = $self->{dbh};
- # This is the general version check
- my $sth = $dbh->prepare("
- SELECT value FROM defaults
- WHERE setting_key = 'version'");
- $sth->execute;
-
- my ($dbversion) = $sth->fetchrow_array;
- if ($dbversion ne $self->{dbversion}){
- $self->error("Database is not the expected version.");
- }
if (($self->{script} eq 'login.pl') && ($self->{action} eq
@@ -679,10 +670,21 @@ sub _db_init {
elsif (!$dbh){
$self->_get_password;
}
-
$dbh->{pg_server_prepare} = 0;
$dbh->{pg_enable_utf8} = 1;
+ # This is the general version check
+ my $sth = $dbh->prepare("
+ SELECT value FROM defaults
+ WHERE setting_key = 'version'");
+ $sth->execute;
+ my ($dbversion) = $sth->fetchrow_array;
+ if ($dbversion ne $self->{dbversion}){
+ $self->error("Database is not the expected version.");
+ }
+
+
+
# TODO: Add date handling settings and the like.