From a51eb1d9032a2ef36cd185eabe0e3403241dbdad Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sat, 23 Jun 2007 15:05:53 +0000 Subject: Correcting POD on LedgerSMB.pm, changing db_init to _db_init and calling it from the constructor. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1313 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'LedgerSMB.pm') diff --git a/LedgerSMB.pm b/LedgerSMB.pm index 9c082693..3dc39447 100755 --- a/LedgerSMB.pm +++ b/LedgerSMB.pm @@ -14,8 +14,9 @@ in database objects (LedgerSMB::DBObject) =item new () -This method creates a new base request instance. In any mode but CLI, it also -validates the session/user credentials. +This method creates a new base request instance. It also validates the +session/user credentials, as appropriate for the run mode. Finally, it sets up +the database connections for the user. =item date_to_number (user => $LedgerSMB::User, date => $string); @@ -205,6 +206,7 @@ sub new { exit; } } + $self->_db_init; $self; @@ -604,7 +606,6 @@ sub error { $self->{msg} = $msg; $self->{format} = "html"; - $self->format_string('msg'); delete $self->{pre}; @@ -628,10 +629,10 @@ sub error { } # Database routines used throughout -sub db_init { +sub _db_init { my $self = shift @_; my %args = @_; - my $myconfig = $args{user}; + my $myconfig = $self->{_user}; my $dbh = DBI->connect( $myconfig->{dbconnect}, $myconfig->{dbuser}, -- cgit v1.2.3