From 84b3533f6d54cf37e1bf6b616da4d02523a45fb3 Mon Sep 17 00:00:00 2001 From: aurynn_cmd Date: Wed, 3 Oct 2007 01:32:37 +0000 Subject: Disabled login checking in LedgerSMB.pm, temporarily. Whitespace cleanup in DB.pm Modifications to remove user_conf from User.pm git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1692 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB.pm | 89 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 44 insertions(+), 45 deletions(-) (limited to 'LedgerSMB.pm') diff --git a/LedgerSMB.pm b/LedgerSMB.pm index 3d5454a5..6c08715d 100755 --- a/LedgerSMB.pm +++ b/LedgerSMB.pm @@ -178,50 +178,49 @@ sub new { } $self->{_locale} = $locale; - $self->{stylesheet} = $self->{_user}->{stylesheet}; - if ( $self->{password} ) { - if ( - !Session::password_check( - $self, $self->{login}, $self->{password} - ) - ) - { - if ($self->is_run_mode('cgi', 'mod_perl')) { - $self->_get_password(); - } - else { - $self->error( __FILE__ . ':' . __LINE__ . ': ' - . $locale->text('Access Denied!') ); - } - exit; - } - else { - Session::session_create($self); - } - - } - else { - if ($self->is_run_mode('cgi', 'mod_perl')) { - my %cookie; - $ENV{HTTP_COOKIE} =~ s/;\s*/;/g; - my @cookies = split /;/, $ENV{HTTP_COOKIE}; - foreach (@cookies) { - my ( $name, $value ) = split /=/, $_, 2; - $cookie{$name} = $value; - } +# if ( $self->{password} ) { +# if ( +# !Session::password_check( +# $self, $self->{ login }, $self->{ password } +# ) +# ) +# { +# if ($self->is_run_mode('cgi', 'mod_perl')) { +# $self->_get_password(); +# } +# else { +# $self->error( __FILE__ . ':' . __LINE__ . ': ' +# . $locale->text('Access Denied!') ); +# } +# exit; +# } +# else { +# Session::session_create($self); +# } + +# } +# else { +# if ($self->is_run_mode('cgi', 'mod_perl')) { +# my %cookie; +# $ENV{HTTP_COOKIE} =~ s/;\s*/;/g; +# my @cookies = split /;/, $ENV{HTTP_COOKIE}; +# foreach (@cookies) { +# my ( $name, $value ) = split /=/, $_, 2; +# $cookie{$name} = $value; +# } #check for valid session - if ( !Session::session_check( $cookie{"LedgerSMB"}, $self) ) { - $self->_get_password(1); - exit; - } - } - else { - exit; - } - } - - $self->{stylesheet} = $self->{_user}->{stylesheet}; +# if ( !Session::session_check( $cookie{"LedgerSMB"}, $self) ) { +# $self->_get_password(1); +# exit; +# } +# } +# else { +# exit; +# } +# } + +# $self->{stylesheet} = $self->{_user}->{stylesheet}; $self->_db_init; @@ -668,8 +667,8 @@ sub _db_init { my $myconfig = $self->{_user}; my $dbh = DBI->connect( - $myconfig->{dbconnect}, $myconfig->{dbuser}, - $myconfig->{dbpasswd}, { AutoCommit => 0 } + $myconfig->{ dbconnect }, $myconfig->{ username }, + $self->{ password }, { AutoCommit => 0 } ) or $self->dberror; $dbh->{pg_server_prepare} = 0; @@ -750,7 +749,7 @@ sub type { my $self = shift @_; if (!$ENV{REQUEST_METHOD} or - ( $ENV{REQUEST_METHOD} ne ("HEAD" or "GET" or "POST") ) ) { + ( !grep {$ENV{REQUEST_METHOD} eq $_} ("HEAD", "GET", "POST") ) ) { $self->error("Request method unset or set to unknown value"); } -- cgit v1.2.3