[vhffs-dev] [2089] Renamed get_db_object to get_db, normalised "db" field, all modules using db field now use get_db, removed "db" field from Vhffs:: Object

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 2089
Author:   gradator
Date:     2012-03-02 20:31:09 +0100 (Fri, 02 Mar 2012)
Log Message:
-----------
Renamed get_db_object to get_db, normalised "db" field, all modules using db field now use get_db, removed "db" field from Vhffs::Object

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Acl.pm
    trunk/vhffs-api/src/Vhffs/Broadcast.pm
    trunk/vhffs-api/src/Vhffs/Group.pm
    trunk/vhffs-api/src/Vhffs/Main.pm
    trunk/vhffs-api/src/Vhffs/Object.pm
    trunk/vhffs-api/src/Vhffs/Panel/Bazaar.pm
    trunk/vhffs-api/src/Vhffs/Panel/Broadcast.pm
    trunk/vhffs-api/src/Vhffs/Panel/Commons.pm
    trunk/vhffs-api/src/Vhffs/Panel/Cron.pm
    trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm
    trunk/vhffs-api/src/Vhffs/Panel/DNS.pm
    trunk/vhffs-api/src/Vhffs/Panel/Git.pm
    trunk/vhffs-api/src/Vhffs/Panel/Group.pm
    trunk/vhffs-api/src/Vhffs/Panel/Mail.pm
    trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm
    trunk/vhffs-api/src/Vhffs/Panel/Mercurial.pm
    trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm
    trunk/vhffs-api/src/Vhffs/Panel/Object.pm
    trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm
    trunk/vhffs-api/src/Vhffs/Panel/Repository.pm
    trunk/vhffs-api/src/Vhffs/Panel/Svn.pm
    trunk/vhffs-api/src/Vhffs/Panel/Tag.pm
    trunk/vhffs-api/src/Vhffs/Panel/User.pm
    trunk/vhffs-api/src/Vhffs/Panel/Web.pm
    trunk/vhffs-api/src/Vhffs/Robots/Cron.pm
    trunk/vhffs-api/src/Vhffs/Robots/Mail.pm
    trunk/vhffs-api/src/Vhffs/Services/Bazaar.pm
    trunk/vhffs-api/src/Vhffs/Services/Cron.pm
    trunk/vhffs-api/src/Vhffs/Services/Cvs.pm
    trunk/vhffs-api/src/Vhffs/Services/DNS.pm
    trunk/vhffs-api/src/Vhffs/Services/Git.pm
    trunk/vhffs-api/src/Vhffs/Services/Mail.pm
    trunk/vhffs-api/src/Vhffs/Services/MailingList.pm
    trunk/vhffs-api/src/Vhffs/Services/Mercurial.pm
    trunk/vhffs-api/src/Vhffs/Services/Mysql.pm
    trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm
    trunk/vhffs-api/src/Vhffs/Services/Repository.pm
    trunk/vhffs-api/src/Vhffs/Services/Svn.pm
    trunk/vhffs-api/src/Vhffs/Services/Web.pm
    trunk/vhffs-api/src/Vhffs/Stats.pm
    trunk/vhffs-api/src/Vhffs/Tag/Category.pm
    trunk/vhffs-api/src/Vhffs/Tag/Request.pm
    trunk/vhffs-api/src/Vhffs/Tag.pm
    trunk/vhffs-api/src/Vhffs/User.pm
    trunk/vhffs-api/src/Vhffs/UserGroup.pm
    trunk/vhffs-contrib/autoreply/patch

Modified: trunk/vhffs-api/src/Vhffs/Acl.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Acl.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Acl.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -75,7 +75,7 @@
 	# Refuse to create an ACL if the granted user is the owner of the target
 	return undef if $object->get_type == Vhffs::Constants::TYPE_USER and $object->get_owner_uid == $self->get_owner_uid;
 
-	my $dbh = $self->get_main->get_db_object;
+	my $dbh = $self->get_db;
 
 	my $sql = 'INSERT INTO vhffs_acl(granted_oid, perm, target_oid) VALUES(?, ?, ?)';
 	return undef unless( $dbh->do($sql, undef, $object->get_oid, $perm, $self->get_oid) );
@@ -100,7 +100,7 @@
 
 	return undef unless defined $object and defined $perm;
 
-	my $dbh = $self->get_main->get_db_object;
+	my $dbh = $self->get_db;
 
 	# If no line was updated, ACL doesn't exists => error
 	return undef unless $dbh->do( 'UPDATE vhffs_acl SET perm = ? WHERE target_oid=? AND granted_oid=?', undef, $perm, $self->get_oid, $object->get_oid) > 0;
@@ -124,7 +124,7 @@
 
 	return undef unless defined $object;
 
-	my $dbh = $self->get_main->get_db_object();
+	my $dbh = $self->get_db;
 
 	return undef unless $dbh->do( 'DELETE FROM vhffs_acl WHERE granted_oid=? AND target_oid=?', undef, $object->get_oid, $self->get_oid) > 0;
 	return 1;
@@ -184,7 +184,7 @@
 sub get_acl {
 	my $self = shift; # -target- a C<Vhffs::User>, C<Vhffs::Group>, or a C<Vhffs::Services>
 
-	my $dbh = $self->get_main->get_db_object;
+	my $dbh = $self->get_db;
 
 	my $sth = $dbh->prepare('SELECT u.object_id AS granted_oid, u.username AS name, u.uid AS uid, aclu.perm FROM vhffs_users u INNER JOIN vhffs_user_group ug ON ug.uid=u.uid INNER JOIN vhffs_object o ON o.owner_gid=ug.gid LEFT OUTER JOIN (SELECT acl.granted_oid, acl.perm FROM vhffs_acl acl WHERE acl.target_oid=?) AS aclu ON aclu.granted_oid=u.object_id WHERE o.object_id=? UNION SELECT g.object_id AS granted_oid, NULL AS name, NULL AS uid, aclu.perm FROM vhffs_groups g INNER JOIN vhffs_object o ON o.owner_gid=g.gid LEFT OUTER JOIN (SELECT acl.granted_oid, acl.perm FROM vhffs_acl acl WHERE acl.target_oid=?) AS aclu ON aclu.granted_oid=g.object_id WHERE o.object_id=? ORDER BY name ASC');
 	return undef unless $sth->execute( $self->get_oid, $self->get_oid, $self->get_oid, $self->get_oid );
@@ -240,7 +240,7 @@
 	# Users have full access to their objets (where object owner_uid equals user uid)
 	return Vhffs::Constants::ACL_DELETE if ($self->is_admin or $object->get_owner_uid == $self->get_owner_uid);
 
-	my $dbh = $self->get_main->get_db_object;
+	my $dbh = $self->get_db;
 
 	# Fetch user ACL (if any)
 	my $perm = $dbh->selectrow_array('SELECT acl.perm FROM vhffs_acl acl WHERE acl.granted_oid=? AND acl.target_oid=?', undef, $self->get_oid, $object->get_oid);

Modified: trunk/vhffs-api/src/Vhffs/Broadcast.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Broadcast.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Broadcast.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -101,7 +101,7 @@
 	$message =~ s/\r\n/\n/g;
 
 	my $query = 'INSERT INTO vhffs_mailings (mailing_id, subject, message, date, state) VALUES(DEFAULT, ?, ?, ?, ? ) RETURNING mailing_id';
-	my $dbh = $vhffs->get_db_object;
+	my $dbh = $vhffs->get_db;
 	my $request = $dbh->prepare( $query );
 	$request->execute($subject, $message, time(), Vhffs::Constants::BROADCAST_WAITING_TO_BE_SENT) or return undef;
 
@@ -125,7 +125,7 @@
 	return undef unless defined $id;
 
 	my $query = 'SELECT mailing_id, subject, message, date, state FROM vhffs_mailings WHERE mailing_id=?';
-	my $dbh = $vhffs->get_db_object;
+	my $dbh = $vhffs->get_db;
 	my @params = $dbh->selectrow_array($query, undef, $id);
 	return undef unless(@params);
 	my $mailing = _new Vhffs::Broadcast($vhffs, @params);
@@ -155,7 +155,7 @@
 		push @params, $state;
 	}
 
-	my $dbh = $vhffs->get_db_object;
+	my $dbh = $vhffs->get_db;
 
 	my $sth = $dbh->prepare($query);
 	$sth->execute(@params) or return undef;
@@ -217,7 +217,7 @@
 	my $self = shift;
 
 	my $query = 'UPDATE vhffs_mailings SET state=? WHERE mailing_id=?';
-	my $dbh = $self->get_vhffs->get_db_object;
+	my $dbh = $self->get_vhffs->get_db;
 	my $result = $dbh->prepare($query);
 	$result->execute( $self->{'state'}, $self->{'mailing_id'} ) or return undef;
 	return 1;
@@ -238,7 +238,7 @@
 	my $self = shift;
 
 	my $query = 'DELETE FROM vhffs_mailings WHERE mailing_id=?';
-	my $dbh = $self->get_vhffs->get_db_object;
+	my $dbh = $self->get_vhffs->get_db;
 	my $request = $dbh->prepare( $query );
 	$request->execute( $self->{'mailing_id'} ) or return undef;
 	return 1;

Modified: trunk/vhffs-api/src/Vhffs/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Group.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Group.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -131,7 +131,7 @@
 
 	$realname = $groupname unless defined $realname;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 
@@ -217,7 +217,7 @@
 	}
 	$sql .= ' ORDER BY g.groupname';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params);
 	while(my @d = $sth->fetchrow_array) {
@@ -244,7 +244,7 @@
 	return getall($vhffs, $state) if(! defined $letter );
 	$letter .= '%';
 
-	my $db = $vhffs->get_db_object;
+	my $db = $vhffs->get_db;
 	my @result;
 	my $query = 'SELECT groupname FROM vhffs_groups g INNER JOIN vhffs_object o ON g.object_id=o.object_id LEFT OUTER JOIN vhffs_users u ON u.username = g.groupname WHERE u.username IS NULL AND g.groupname LIKE ?';
 	$query .= "AND o.state=$state " if( defined $state );
@@ -282,7 +282,7 @@
 		FROM vhffs_groups g INNER JOIN vhffs_object o ON o.object_id = g.object_id
 		WHERE (g.quota_used / g.quota) >= 0.9 ORDER BY g.quota_used DESC LIMIT ?};
 
-	my $dbh = $vhffs->get_db_object;
+	my $dbh = $vhffs->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($limit) or return undef;
 	my $groups = [];
@@ -306,7 +306,7 @@
 	my ($vhffs, $gid) = @_;
 	my $query = 'SELECT g.gid, o.object_id, o.owner_uid, g.groupname, g.realname, g.passwd, g.quota, g.quota_used, o.date_creation, o.description, o.state FROM vhffs_groups g INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE g.gid = ?';
 
-	my $dbh = $vhffs->get_db_object;
+	my $dbh = $vhffs->get_db;
 	my @params = $dbh->selectrow_array($query, undef, $gid);
 	return undef unless(@params);
 	my $group = _new Vhffs::Group($vhffs, @params);
@@ -327,7 +327,7 @@
 	my ($vhffs, $groupname) = @_;
 	my $query = 'SELECT g.gid, o.object_id, o.owner_uid, g.groupname, g.realname, g.passwd, g.quota, g.quota_used, o.date_creation, o.description, o.state FROM vhffs_groups g INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE g.groupname = ?';
 
-	my $dbh = $vhffs->get_db_object;
+	my $dbh = $vhffs->get_db;
 	my @params = $dbh->selectrow_array($query, undef, $groupname);
 	return undef unless(@params);
 	my $group = _new Vhffs::Group($vhffs, @params);
@@ -353,7 +353,7 @@
 	return -1 if $self->SUPER::commit < 0;
 
 	my $sql = 'UPDATE vhffs_groups SET realname = ?, quota = ?, quota_used = ? WHERE gid = ?';
-	my $sth = $self->{db}->prepare($sql);
+	my $sth = $self->get_db->prepare($sql);
 	$sth->execute( $self->{'realname'}, $self->{'quota'}, $self->{'quota_used'}, $self->{'gid'}) or return -1;
 
 	return 1;
@@ -370,7 +370,7 @@
 	my( $self , $uid ) = @_;
 
 	my $sql = 'INSERT INTO vhffs_user_group(uid, gid, state) VALUES(?, ?, ?)';
-	my $res = $self->{db}->do( $sql, {}, $uid, $self->{gid}, Vhffs::Constants::WAITING_FOR_CREATION );
+	my $res = $self->get_db->do( $sql, {}, $uid, $self->{gid}, Vhffs::Constants::WAITING_FOR_CREATION );
 	return ( defined $res and $res > 0 );
 }
 
@@ -389,7 +389,7 @@
 	my $uid = shift;
 
 	my $sql = 'UPDATE vhffs_user_group SET state=? WHERE gid=? AND uid=?';
-	return $self->{db}->do( $sql, {}, Vhffs::Constants::WAITING_FOR_DELETION, $self->{gid}, $uid ) > 0;
+	return $self->get_db->do( $sql, {}, Vhffs::Constants::WAITING_FOR_DELETION, $self->{gid}, $uid ) > 0;
 }
 
 =pod
@@ -406,7 +406,7 @@
 	return 0 unless defined $self;
 
 	my $query = 'SELECT COUNT(*) FROM vhffs_object WHERE owner_gid=? AND object_id!=?';
-	my $request = $self->{'db'}->prepare( $query );
+	my $request = $self->get_db->prepare( $query );
 	$request->execute( $self->get_gid, $self->get_oid );
 	my ( $rows ) = $request->fetchrow();
 
@@ -573,7 +573,7 @@
 	my @users;
 	my $gid = $self->get_gid;
 	my $query = 'SELECT ug.uid FROM vhffs_user_group ug WHERE ug.gid = ?';
-	my $request = $self->{'db'}->prepare( $query );
+	my $request = $self->get_db->prepare( $query );
 	$request->execute($gid);
 	while( my ($uid) = $request->fetchrow_array ) {
 		my $user = Vhffs::User::get_by_uid( $self->{'main'} , $uid );
@@ -594,7 +594,7 @@
 	my $self = shift;
 
 	my $sql = 'SELECT o.object_id,o.type,h.history_id,h.date,h.message,source.username as source FROM vhffs_history h INNER JOIN vhffs_object o ON o.object_id=h.object_id LEFT JOIN vhffs_users source ON source.uid = h.source_uid WHERE o.owner_gid=? ORDER BY date DESC';
-	my $dbh = $self->get_db_object;
+	my $dbh = $self->get_db;
 	return $dbh->selectall_arrayref($sql, {Slice => {}}, $self->{gid});
 }
 
@@ -612,7 +612,7 @@
 
 	# TODO should be in Vhffs::Object
 	my $query = 'SELECT object_id FROM vhffs_object WHERE owner_gid=?';
-	my $request = $self->get_main->get_db_object->prepare( $query ) or return -1;
+	my $request = $self->get_db->prepare( $query ) or return -1;
 	return undef unless $request->execute( $self->get_gid );
 
 	my @objects;

Modified: trunk/vhffs-api/src/Vhffs/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Main.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Main.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -89,14 +89,14 @@
 
 =pod
 
-=head1 get_db_object
+=head1 get_db
 
-my $dbh = $vhffs->get_db_object;
+my $dbh = $vhffs->get_db;
 
 Returns a C<DBI> object if backend was connected, otherwise returns undef.
 
 =cut
-sub get_db_object {
+sub get_db {
 	my $self = shift;
 	return $self->{'db'};
 }

Modified: trunk/vhffs-api/src/Vhffs/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Object.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Object.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -80,7 +80,6 @@
 	return undef unless(defined $main);
 
 	$self->{main} = $main;
-	$self->{db} = $main->get_db_object;
 	$self->{object_id} = $oid;
 	$self->{owner_uid} = $owner_uid;
 	$self->{owner_gid} = $owner_gid;
@@ -121,9 +120,9 @@
 	$description = '' unless defined $description;
 	$description =~ s/\r\n/\n/g;
 	$state = ($vhffs->get_config->get_moderation ? Vhffs::Constants::WAITING_FOR_VALIDATION : Vhffs::Constants::WAITING_FOR_CREATION) unless defined $state;
-	my $sth = $vhffs->get_db_object->prepare('INSERT INTO vhffs_object(owner_uid, owner_gid, date_creation, state, description, type) VALUES ( ?, ?, ?, ?, ?, ?)');
+	my $sth = $vhffs->get_db->prepare('INSERT INTO vhffs_object(owner_uid, owner_gid, date_creation, state, description, type) VALUES ( ?, ?, ?, ?, ?, ?)');
 	$sth->execute($owner_uid, $owner_gid, time(), $state, $description, $type) or return undef;
-	my $oid = $vhffs->get_db_object->last_insert_id(undef, undef, 'vhffs_object', undef);
+	my $oid = $vhffs->get_db->last_insert_id(undef, undef, 'vhffs_object', undef);
 
 	my $object = get_by_oid($vhffs, $oid);
 	$object->get_status == Vhffs::Constants::WAITING_FOR_VALIDATION ? $object->add_history('Object created, waiting for validation') : $object->add_history('Object created');
@@ -145,7 +144,7 @@
 	return undef unless ( defined $oid && $oid =~ /^\d+$/ );
 
 	my $query = 'SELECT owner_uid, owner_gid, date_creation, description, refuse_reason, state, type FROM vhffs_object WHERE object_id =?';
-	my $sth = $vhffs->get_db_object->prepare( $query );
+	my $sth = $vhffs->get_db->prepare( $query );
 	my $rows = $sth->execute( $oid );
 
 	return undef unless $rows == 1;
@@ -208,7 +207,7 @@
 
 	$query .= ' ORDER BY object_id';
 
-	my $request = $vhffs->get_db_object->prepare( $query ) or return -1;
+	my $request = $vhffs->get_db->prepare( $query ) or return -1;
 	return undef unless $request->execute(@params);
 
 	my $result;
@@ -253,7 +252,7 @@
 =cut
 sub _fill_object {
 	my ($class, $obj, $sql) = @_;
-	my $dbh = $obj->get_db_object();
+	my $dbh = $obj->get_db();
 	my $res = $dbh->selectrow_hashref($sql, undef, $obj->get_oid);
 	return $obj unless(defined $res);
 	foreach(keys %$res) {
@@ -277,7 +276,7 @@
 	my $self = shift;
 
 	my $request = 'UPDATE vhffs_object SET state=?, description=?, refuse_reason=?, owner_uid=?, owner_gid=? WHERE object_id=?';
-	my $result = $self->{'db'}->prepare($request);
+	my $result = $self->get_db->prepare($request);
 	$result->execute( $self->{'state'} , $self->{'description'} , $self->{'refuse_reason'}, $self->{'owner_uid'} , $self->{'owner_gid'} , $self->{'object_id'} ) or return undef;
 	return 1;
 }
@@ -297,14 +296,14 @@
 
 =pod
 
-=head2 get_db_object
+=head2 get_db
 
 Return DBH object to backend.
 
 =cut
-sub get_db_object {
+sub get_db {
 	my $self = shift;
-	return $self->{main}->get_db_object;
+	return $self->{main}->get_db;
 }
 
 =pod
@@ -325,7 +324,7 @@
 	# Foreign key constraints are in 'ON DELETE CASCADE' mode
 	# we don't have to bother with foreign tables deletion.
 	my $query = 'DELETE FROM vhffs_object WHERE object_id=?';
-	my $request = $self->{'db'}->prepare($query);
+	my $request = $self->get_db->prepare($query);
 	$request->execute( $self->{'object_id'} ) or return undef;
 
 	return 1;
@@ -523,10 +522,10 @@
 	my $user = $self->{main}->get_current_user->get_uid if defined $self->{main}->get_current_user;
 
 	my $query = 'INSERT INTO vhffs_history(object_id, date, message, source_uid) VALUES(?, ?, ?, ?)';
-	my $request = $self->{'db'}->prepare( $query );
+	my $request = $self->get_db->prepare( $query );
 	$request->execute( $self->{'object_id'}, time(), $message, $user ) or return -2;
 
-	return $self->{'db'}->last_insert_id(undef, undef, 'vhffs_history', undef);;
+	return $self->get_db->last_insert_id(undef, undef, 'vhffs_history', undef);;
 }
 
 =pod
@@ -548,7 +547,7 @@
 sub get_history {
 	my $self = shift;
 
-	my $dbh = $self->get_db_object;
+	my $dbh = $self->get_db;
 	my $sql = 'SELECT history_id, message, date, source.username as source FROM vhffs_history h LEFT JOIN vhffs_users source ON source.uid = h.source_uid WHERE h.object_id = ? ORDER BY date DESC';
 	return $dbh->selectall_arrayref($sql, {Slice => {}}, $self->{object_id});
 }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Bazaar.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Bazaar.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Bazaar.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -57,7 +57,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT s.object_id AS oid, s.reponame AS displayname, o.state FROM vhffs_bazaar s INNER JOIN vhffs_object o ON s.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY s.reponame';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;
@@ -75,7 +75,7 @@
 	my ($main, $gid, $public_only) = @_;
 	$public_only = 1 unless(defined $public_only);
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT g.reponame, o.description FROM vhffs_bazaar g INNER JOIN vhffs_object o ON o.object_id = g.object_id '.
 	  'WHERE '.($public_only ? 'public = 1 AND ' : '').'o.owner_gid = ? AND o.state = ?';
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, $gid, Vhffs::Constants::ACTIVATED);
@@ -98,7 +98,7 @@
 
 	$sql .= 'ORDER BY bazaar.reponame';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Broadcast.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Broadcast.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Broadcast.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -48,7 +48,7 @@
 	  'FROM vhffs_mailings m '.
 	  'ORDER BY m.date DESC';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} });
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Commons.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Commons.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Commons.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -154,7 +154,7 @@
 sub fetch_slice_and_count($$$$$$$;$) {
 	my ($main, $select, $conditions, $order, $start, $count, $params, $select_callback) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $result = {};
 	my $sql = $select.$conditions.$order.' LIMIT '.$count.' OFFSET '.$start;
 	if(defined $select_callback) {

Modified: trunk/vhffs-api/src/Vhffs/Panel/Cron.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Cron.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Cron.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -54,7 +54,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT c.object_id AS oid, c.cronpath AS displayname, o.state FROM vhffs_cron c INNER JOIN vhffs_object o ON c.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY c.cronpath';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;
@@ -85,7 +85,7 @@
 
 	$sql .= 'ORDER BY cron.cronpath';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -57,7 +57,7 @@
 
 	$sql .= 'ORDER BY cvs.cvsroot';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 
@@ -89,7 +89,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT c.object_id AS oid, c.cvsroot AS displayname, o.state FROM vhffs_cvs c INNER JOIN vhffs_object o ON c.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY c.cvsroot';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;
@@ -107,7 +107,7 @@
 	my ($main, $gid, $public_only) = @_;
 	$public_only = 1 unless(defined $public_only);
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT c.cvsroot, o.description FROM vhffs_cvs c INNER JOIN vhffs_object o ON o.object_id = c.object_id '.
 	  'WHERE '.($public_only ? 'c.public = true AND ' : '').'o.owner_gid = ? AND o.state = ?';
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, $gid, Vhffs::Constants::ACTIVATED);

Modified: trunk/vhffs-api/src/Vhffs/Panel/DNS.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/DNS.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/DNS.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -57,7 +57,7 @@
 
 	$sql .= 'ORDER BY ns.domain';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 
@@ -82,7 +82,7 @@
 
 	my $query = "SELECT ns.domain, ns.object_id FROM vhffs_dns ns, vhffs_acl acl ,vhffs_users WHERE vhffs_users.object_id=acl.oid_src AND acl.oid_dst=ns.object_id AND vhffs_users.username='".$user->{'username'}."'";
 
-	my $request = $main->{'db'}->prepare( $query ) or return -1;
+	my $request = $main->get_db->prepare( $query ) or return -1;
 
 	return undef if ( $request->execute() <= 0);
 
@@ -102,7 +102,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT ns.object_id AS oid, ns.domain AS displayname, o.state FROM vhffs_dns ns INNER JOIN vhffs_object o ON ns.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY ns.domain';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;

Modified: trunk/vhffs-api/src/Vhffs/Panel/Git.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Git.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Git.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -58,7 +58,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT s.object_id AS oid, s.reponame AS displayname, o.state FROM vhffs_git s INNER JOIN vhffs_object o ON s.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY s.reponame';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;
@@ -76,7 +76,7 @@
 	my ($main, $gid, $public_only) = @_;
 	$public_only = 1 unless(defined $public_only);
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT g.reponame, o.description FROM vhffs_git g INNER JOIN vhffs_object o ON o.object_id = g.object_id '.
 	  'WHERE '.($public_only ? 'public = 1 AND ' : '').'o.owner_gid = ? AND o.state = ?';
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, $gid, Vhffs::Constants::ACTIVATED);
@@ -99,7 +99,7 @@
 
 	$sql .= 'ORDER BY git.reponame';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Group.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Group.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -64,7 +64,7 @@
 sub getall_users {
 	my ($main, $gid) = @_;
 	my $sql = 'SELECT u.uid, u.username, u.firstname, u.lastname, u.mail, ug.state FROM vhffs_users u INNER JOIN vhffs_user_group ug ON ug.uid = u.uid WHERE ug.gid = ?';
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;
 	my $users = [];
@@ -103,7 +103,7 @@
 
 	$sql .= 'ORDER BY g.groupname';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 
@@ -150,7 +150,7 @@
 	my $select = 'SELECT g.gid, g.groupname, g.realname, o.description, owner.username AS owner_name, o.object_id'.$sql.' ORDER BY groupname '.$limit;
 	my $groups = fetch_groups_and_users($main, $select, @params);
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sth = $dbh->prepare('SELECT COUNT(*)'.$sql);
 	return undef unless ( $sth->execute(@params) );
@@ -167,7 +167,7 @@
 
 	my $query = "SELECT g.groupname , g.object_id, o.state  FROM vhffs_groups g, vhffs_user_group ug , vhffs_object o WHERE o.object_id=g.object_id AND ug.gid=g.gid AND ug.uid='".$user->{'uid'}."'";
 
-	my $request = $main->{'db'}->prepare( $query ) or return -1;
+	my $request = $main->get_db->prepare( $query ) or return -1;
 	my @retour;
 
 	return undef if ( $request->execute() <= 0);
@@ -233,7 +233,7 @@
 	my @groups;
 
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sql = 'SELECT u.username FROM vhffs_users u INNER JOIN vhffs_user_group ug ON ug.uid = u.uid WHERE ug.gid = ?';
 	my $usth = $dbh->prepare($sql);
@@ -258,7 +258,7 @@
 
 sub get_used_letters {
 	my $main = shift;
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT substr(g.groupname, 1, 1) AS letter, COUNT(*) AS count FROM vhffs_groups g LEFT OUTER JOIN vhffs_users u ON u.username = g.groupname INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE u.username IS NULL AND o.state = ? GROUP BY substr(g.groupname, 1, 1) ORDER BY substr(g.groupname, 1, 1)';
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, Vhffs::Constants::ACTIVATED);
 }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mail.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mail.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -56,7 +56,7 @@
 
 	$sql .= 'ORDER BY label';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 
@@ -73,7 +73,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT m.object_id AS oid, m.domain AS displayname, o.state FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON m.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY m.domain';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;
@@ -101,7 +101,7 @@
 sub is_owned_by_group($$$) {
 	my ($main, $domain, $gid) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT COUNT(*) FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON o.object_id = m.object_id WHERE m.domain = ? AND o.owner_gid = ?';
 	my $sth = $dbh->prepare( $sql );
 	$sth->execute( $domain, $gid );

Modified: trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -58,7 +58,7 @@
 
 	$sql .= 'ORDER BY m.domain, m.local_part';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 
@@ -75,7 +75,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT l.object_id AS oid, l.local_part || \'@\' || l.domain AS displayname, o.state FROM vhffs_ml l INNER JOIN vhffs_object o ON l.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY l.local_part, l.domain';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;
@@ -92,7 +92,7 @@
 sub get_lists_per_group {
 	my ($main, $gid) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT l.local_part || \'@\' || l.domain AS listname, l.local_part, l.domain, l.open_archive, o.description FROM vhffs_ml l INNER JOIN vhffs_object o ON l.object_id = o.object_id WHERE o.owner_gid = ? AND o.state = ?';
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, $gid, Vhffs::Constants::ACTIVATED);
 }
@@ -111,7 +111,7 @@
 sub getall_mdomains_per_group($$) {
 	my ($main, $gid) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = q{ SELECT m.domain FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON o.object_id = m.object_id WHERE o.owner_gid = ? AND o.state = ? ORDER BY m.domain };
 	return ($dbh->selectall_arrayref($sql, { Slice => {} }, $gid, Vhffs::Constants::ACTIVATED) );
 }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Mercurial.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mercurial.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mercurial.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -56,7 +56,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT s.object_id AS oid, s.reponame AS displayname, o.state FROM vhffs_mercurial s INNER JOIN vhffs_object o ON s.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY s.reponame';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;
@@ -74,7 +74,7 @@
 	my ($main, $gid, $public_only) = @_;
 	$public_only = 1 unless(defined $public_only);
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT g.reponame, o.description FROM vhffs_mercurial g INNER JOIN vhffs_object o ON o.object_id = g.object_id '.
 	  'WHERE '.($public_only ? 'public = 1 AND ' : '').'o.owner_gid = ? AND o.state = ?';
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, $gid, Vhffs::Constants::ACTIVATED);
@@ -98,7 +98,7 @@
 
 	$sql .= 'ORDER BY m.reponame';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -68,7 +68,7 @@
 
 	$sql .= 'ORDER BY label';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 
@@ -98,7 +98,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT m.object_id AS oid, m.dbname AS displayname, o.state FROM vhffs_mysql m INNER JOIN vhffs_object o ON m.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY m.dbname';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;

Modified: trunk/vhffs-api/src/Vhffs/Panel/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Object.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Object.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -54,7 +54,7 @@
 
 	$sql .= 'ORDER BY o.object_id';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -58,7 +58,7 @@
 
 	$sql .= 'ORDER BY label';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref( $sql, { Slice => {} }, @params);
 }
 
@@ -78,7 +78,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT p.object_id AS oid, p.dbname AS displayname, o.state FROM vhffs_pgsql p INNER JOIN vhffs_object o ON p.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY p.dbname';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;

Modified: trunk/vhffs-api/src/Vhffs/Panel/Repository.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Repository.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Repository.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -54,7 +54,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT r.object_id AS oid, r.name AS displayname, o.state FROM vhffs_repository r INNER JOIN vhffs_object o ON r.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY r.name';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;
@@ -85,7 +85,7 @@
 
 	$sql .= 'ORDER BY label';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Svn.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Svn.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -56,7 +56,7 @@
 sub getall_per_group {
 	my ( $main, $gid ) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT s.object_id AS oid, s.reponame AS displayname, o.state FROM vhffs_svn s INNER JOIN vhffs_object o ON s.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY s.reponame';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;
@@ -74,7 +74,7 @@
 	my ($main, $gid, $public_only) = @_;
 	$public_only = 1 unless(defined $public_only);
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT s.reponame, o.description FROM vhffs_svn s INNER JOIN vhffs_object o ON o.object_id = s.object_id '.
 	  'WHERE '.($public_only ? 's.public = 1 AND ' : '').'o.owner_gid = ? AND o.state = ?';
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, $gid, Vhffs::Constants::ACTIVATED);
@@ -98,7 +98,7 @@
 
 	$sql .= 'ORDER BY label';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Tag.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Tag.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Tag.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -83,7 +83,7 @@
 
 	my $groups = Vhffs::Panel::Group::fetch_groups_and_users($main, $select.$restriction.' ORDER BY g.groupname '.$limit, @params);
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sth = $dbh->prepare('SELECT COUNT(*) '.$restriction);
 	return undef unless ( $sth->execute(@params) );
@@ -133,7 +133,7 @@
 		$sql .= ')';
 	}
 	$sql .= ' ORDER BY c.label, t.label';
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @ids);
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/User.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/User.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -95,7 +95,7 @@
 	  'INNER JOIN vhffs_object o ON o.object_id=u.object_id '.
 	  'WHERE o.state=? ORDER BY o.date_creation DESC LIMIT 10';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $users = $dbh->selectall_hashref($sql, 'uid', undef, Vhffs::Constants::ACTIVATED);
 
@@ -121,7 +121,7 @@
 
 	$sql .= 'ORDER BY u.username';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 
@@ -154,7 +154,7 @@
 	my $limit = ' LIMIT 10';
 	$limit .= ' OFFSET '.($start * 10) if(defined $start);
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $users = $dbh->selectall_hashref($select_clause.$sql.' ORDER BY u.username '.$limit, 'uid', undef, @params);
 
@@ -183,7 +183,7 @@
 sub fill_groups {
 	my ($main, $users) =@_;
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	my @uids = ();
 
 	foreach my $uid(keys(%$users)) {
@@ -210,7 +210,7 @@
 	my ($main, $sql, @params) = @_;
 	my @users;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute( @params );
 	$sql = 'SELECT g.groupname FROM vhffs_groups g INNER JOIN vhffs_user_group ug ON ug.gid = g.gid WHERE ug.uid = ? AND g.groupname != ?';
@@ -231,7 +231,7 @@
 	return -1 unless defined $user and defined $lang;
 
 	my $sql = 'UPDATE vhffs_users SET language = ? WHERE uid = ?';
-	my $sth = $user->{db}->prepare($sql);
+	my $sth = $user->get_db->prepare($sql);
 	$sth->execute($lang, $user->get_uid) or return -1;
 	$user->{'language'} = $lang;
 	setlocale(LC_ALL, $lang);
@@ -245,7 +245,7 @@
 	return -1 unless defined $user and defined $theme;
 
 	my $sql = 'UPDATE vhffs_users SET theme = ? WHERE uid = ?';
-	my $dbh = $user->{db};
+	my $dbh = $user->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($theme, $user->get_uid) or return -1;
 	$user->{'theme'} = $theme;
@@ -326,7 +326,7 @@
 	} else {
 		$sql = 'SELECT g.groupname, o.state , o.object_id AS oid FROM vhffs_groups g INNER JOIN vhffs_user_group ug ON g.gid=ug.gid INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE ug.uid=? ORDER BY g.groupname';
 	}
-	my $sth = $user->get_db_object->prepare( $sql );
+	my $sth = $user->get_db->prepare( $sql );
 	return undef unless $sth->execute(@params);
 	while(my $g = $sth->fetchrow_hashref) {
 		$g->{active} = ($g->{state} == Vhffs::Constants::ACTIVATED);

Modified: trunk/vhffs-api/src/Vhffs/Panel/Web.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Web.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Panel/Web.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -62,7 +62,7 @@
 sub getall_per_group {
 	my ($main, $gid) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT w.servername AS displayname, w.object_id AS oid, o.state FROM vhffs_httpd w INNER JOIN vhffs_object o ON o.object_id = w.object_id WHERE o.owner_gid = ? ORDER BY w.servername';
 	my $sth = $dbh->prepare($sql) or return -1;
 	$sth->execute($gid) or return -2;
@@ -86,7 +86,7 @@
 sub get_websites_per_group {
 	my ($main, $gid) = @_;
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my $sql = 'SELECT w.servername, o.description FROM vhffs_httpd w INNER JOIN vhffs_object o ON o.object_id = w.object_id WHERE o.owner_gid = ? AND o.state = ?';
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, $gid, Vhffs::Constants::ACTIVATED);
 }
@@ -109,7 +109,7 @@
 
 	$sql .= 'ORDER BY label';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 
@@ -158,7 +158,7 @@
 		$from .= ' AND substr(w.servername, 1, 1) = ?';
 		push @params, $letter;
 	}
-	my $dbh = $vhffs->get_db_object;
+	my $dbh = $vhffs->get_db;
 	return Vhffs::Panel::Commons::fetch_slice_and_count($vhffs, $select, $from, ' ORDER BY w.servername', $start, $count, \@params);
 }
 
@@ -173,7 +173,7 @@
 sub get_used_letters {
 	my $main = shift;
 	my $sql = 'SELECT substr(servername, 1, 1) as letter, COUNT(*) as count FROM vhffs_httpd h INNER JOIN vhffs_object o ON o.object_id = h.object_id WHERE state = ? GROUP BY substr(servername, 1, 1) ORDER BY substr(servername, 1, 1)';
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, Vhffs::Constants::ACTIVATED);
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Robots/Cron.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Cron.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Robots/Cron.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -43,7 +43,7 @@
 	my $main = shift;
 
 	my $sql = 'SELECT c.cron_id, c.cronpath, c.interval, c.reportmail, c.lastrundate, c.lastrunreturncode, c.nextrundate, c.running, o.owner_uid, o.owner_gid, o.object_id, o.date_creation, o.description, o.state FROM vhffs_cron c INNER JOIN vhffs_object o ON c.object_id=o.object_id WHERE o.state=? AND c.running=0 AND ( c.nextrundate IS NULL OR c.nextrundate<? )';
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	my $sth = $dbh->prepare($sql);
 	$sth->execute( Vhffs::Constants::ACTIVATED , time() ) or return undef;
 
@@ -59,7 +59,7 @@
 	my $maxexectime = shift;
 
 	my $sql = 'SELECT c.cron_id, c.cronpath, c.interval, c.reportmail, c.lastrundate, c.lastrunreturncode, c.nextrundate, c.running, o.owner_uid, o.owner_gid, o.object_id, o.date_creation, o.description, o.state FROM vhffs_cron c INNER JOIN vhffs_object o ON c.object_id=o.object_id WHERE o.state=? AND c.running!=0 AND ( c.nextrundate IS NULL OR c.nextrundate<? )';
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	my $sth = $dbh->prepare($sql);
 	$sth->execute( Vhffs::Constants::ACTIVATED , time() - $maxexectime ) or return undef;
 

Modified: trunk/vhffs-api/src/Vhffs/Robots/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Mail.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Robots/Mail.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -52,7 +52,7 @@
 		push(@params, $state);
 	}
 
-	my $request = $vhffs->{'db'}->prepare( $sql );
+	my $request = $vhffs->get_db->prepare( $sql );
 	return undef unless $request->execute( @params );
 	return $request->fetchall_arrayref({});
 }

Modified: trunk/vhffs-api/src/Vhffs/Services/Bazaar.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Bazaar.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/Bazaar.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -72,7 +72,7 @@
 
 	my $bazaar;
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -132,7 +132,7 @@
 	}
 	$sql .= ' ORDER BY b.reponame';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
@@ -150,7 +150,7 @@
 	my $sql = 'SELECT b.bazaar_id, b.reponame, o.owner_uid, o.owner_gid, b.public, b.ml_name, o.object_id, o.date_creation, o.description, o.state
 		FROM vhffs_bazaar b INNER JOIN vhffs_object o ON o.object_id = b.object_id WHERE b.reponame = ?';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $reponame));
 
@@ -160,7 +160,7 @@
 sub commit {
 	my $self = shift;
 
-	my $dbh = $self->get_db_object;
+	my $dbh = $self->get_db;
 	my $sql = 'UPDATE vhffs_bazaar SET public = ?, ml_name = ? WHERE bazaar_id = ?';
 	$dbh->do($sql, undef, $self->{public}, $self->{ml_name}, $self->{bazaar_id});
 

Modified: trunk/vhffs-api/src/Vhffs/Services/Cron.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Cron.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/Cron.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -100,7 +100,7 @@
 	$interval = $mininterval if( $interval < $mininterval );
 
 	my $cron;
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -159,7 +159,7 @@
 	}
 	$sql .= ' ORDER BY c.cronpath';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
 
@@ -187,7 +187,7 @@
 	my $sql = 'SELECT c.cron_id, c.cronpath, c.interval, c.reportmail, c.lastrundate, c.lastrunreturncode, c.nextrundate, c.running, o.owner_uid, o.owner_gid, o.object_id, o.date_creation, o.description, o.state FROM vhffs_cron c
 		INNER JOIN vhffs_object o ON o.object_id = c.object_id WHERE c.cronpath = ?';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $path));
 
 	return _new Vhffs::Services::Cron($main, @params);
@@ -198,7 +198,7 @@
 
 	my $query = 'UPDATE vhffs_cron SET interval=?, reportmail=?, lastrundate=?, lastrunreturncode=?, nextrundate=?, running=? WHERE cron_id=?';
 
-	my $request = $self->{'db'}->prepare($query);
+	my $request = $self->get_db->prepare($query);
 	$request->execute( $self->{'interval'} , $self->{'reportmail'} , $self->{'lastrundate'} , $self->{'lastrunreturncode'} , $self->{'nextrundate'} , $self->{'running'} , $self->{'cron_id'} ) or return -1;
 
 	return -2 if( $self->SUPER::commit < 0 );
@@ -312,28 +312,28 @@
 	my ($self, $value) = @_;
 	return undef unless $value =~ /^\d+$/;
 	my $query = 'UPDATE vhffs_cron SET running=? WHERE cron_id=?';
-	my $request = $self->{'db'}->prepare($query);
+	my $request = $self->get_db->prepare($query);
 	return $request->execute( $value , $self->{'cron_id'} );
 }
 
 sub quick_inc_running {
 	my $self = shift;
 	my $query = 'UPDATE vhffs_cron SET running=running+1 WHERE cron_id=?';
-	my $request = $self->{'db'}->prepare($query);
+	my $request = $self->get_db->prepare($query);
 	return $request->execute( $self->{'cron_id'} );
 }
 
 sub quick_dec_running {
 	my $self = shift;
 	my $query = 'UPDATE vhffs_cron SET running=running-1 WHERE cron_id=?';
-	my $request = $self->{'db'}->prepare($query);
+	my $request = $self->get_db->prepare($query);
 	return $request->execute( $self->{'cron_id'} );
 }
 
 sub quick_get_running {
 	my $self = shift;
 	my $query = 'SELECT running FROM vhffs_cron WHERE cron_id=?';
-	my $request = $self->{'db'}->prepare($query);
+	my $request = $self->get_db->prepare($query);
 	$request->execute( $self->{'cron_id'} ) or return undef;
 	my @r = $request->fetchrow_array();
 	return $r[0];
@@ -343,7 +343,7 @@
 	my ($self , $value) = @_;
 	return undef unless $value =~ /^\d+$/;
 	my $query = 'UPDATE vhffs_cron SET nextrundate=? WHERE cron_id=?';
-	my $request = $self->{'db'}->prepare($query);
+	my $request = $self->get_db->prepare($query);
 	return $request->execute( $value , $self->{'cron_id'} );
 }
 
@@ -351,14 +351,14 @@
 	my ($self , $date, $returncode) = @_;
 	return undef unless $date =~ /^\d+$/ and $returncode =~ /^\d+$/;
 	my $query = 'UPDATE vhffs_cron SET lastrundate=?, lastrunreturncode=? WHERE cron_id=?';
-	my $request = $self->{'db'}->prepare($query);
+	my $request = $self->get_db->prepare($query);
 	return $request->execute( $date , $returncode , $self->{'cron_id'} );
 }
 
 sub quick_reset {
 	my ($self) = @_;
 	my $query = 'UPDATE vhffs_cron SET running=0, lastrundate=NULL, lastrunreturncode=NULL WHERE cron_id=?';
-	my $request = $self->{'db'}->prepare($query);
+	my $request = $self->get_db->prepare($query);
 	return $request->execute( $self->{'cron_id'} );
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Services/Cvs.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Cvs.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/Cvs.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -98,7 +98,7 @@
 	return undef unless(check_name($cvsroot));
 
 	my $cvs;
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -158,7 +158,7 @@
 	}
 	$sql .= ' ORDER BY c.cvsroot';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 
 	my $sth = $dbh->prepare( $sql );
 	$sth->execute(@params) or return undef;
@@ -173,7 +173,7 @@
 	my($main, $cvsroot) = @_;
 	my $sql = 'SELECT c.cvs_id, c.cvsroot, o.owner_uid, o.owner_gid, c.public, c.object_id, o.date_creation, o.description, o.state FROM vhffs_cvs c
 		INNER JOIN vhffs_object o ON c.object_id = o.object_id WHERE c.cvsroot = ?';
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	my @params;
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $cvsroot));
 
@@ -184,7 +184,7 @@
 	my $self = shift;
 
 	my $sql = 'UPDATE vhffs_cvs SET cvsroot = ?, public = ? WHERE cvs_id = ?';
-	$self->get_db_object()->do($sql, undef, $self->{'cvsroot'},
+	$self->get_db()->do($sql, undef, $self->{'cvsroot'},
 		                                $self->{'public'}, $self->{'cvs_id'})
 		                                    or return -1;
 

Modified: trunk/vhffs-api/src/Vhffs/Services/DNS.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/DNS.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/DNS.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -103,7 +103,7 @@
 	return undef unless(defined($user) && defined($group));
 	return undef unless(Vhffs::Functions::check_domain_name($domain));
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -191,7 +191,7 @@
 	}
 	$sql .= ' ORDER BY d.domain';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params);
 	while(my @d = $sth->fetchrow_array) {
@@ -213,7 +213,7 @@
 	$obj = $class->SUPER::_fill_object($obj, $sql);
 
 	if($obj->isa('Vhffs::Services::DNS')) {
-		my @records = fetch_records($obj->get_db_object, $obj->{dns_id});
+		my @records = fetch_records($obj->get_db, $obj->{dns_id});
 		$obj->{A} = $records[0];
 		$obj->{NS} = $records[1];
 		$obj->{CNAME} = $records[2];
@@ -314,7 +314,7 @@
 
 	my $sql = 'SELECT d.dns_id, d.domain, o.owner_gid, d.ns, d.mbox, d.serial, d.refresh, d.retry, d.expire, d.minimum, d.ttl, o.object_id, o.owner_uid, o.date_creation, o.state, o.description FROM vhffs_dns d INNER JOIN vhffs_object o ON o.object_id = d.object_id WHERE d.domain = ?';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	my @params;
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $name));
 	my $dns_id = $params[0];
@@ -338,7 +338,7 @@
 	my $self = shift;
 	my $name = shift;
 	my @types = @_;
-	my $dbh = $self->get_main->get_db_object();
+	my $dbh = $self->get_db;
 	my $in = '?'.(', ?' x (scalar(@types) - 1));
 	my $sql = 'SELECT id FROM vhffs_dns_rr WHERE name = ? AND zone = ? AND type IN('.$in.') LIMIT 1';
 	return ($dbh->do($sql, undef, $name, $self->{dns_id}, @types) != 0);
@@ -361,7 +361,7 @@
 	my $rr = $self->{$type}{$id};
 	return -3 unless(defined $rr);
 
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 	my $sql = 'DELETE FROM vhffs_dns_rr WHERE id = ? AND type = ? AND zone = ?';
 	$dbh->do($sql, undef, $id, $type, $self->{dns_id}) or return -3;
 
@@ -382,7 +382,7 @@
 	return -3 unless( Vhffs::Functions::check_ip($ip) );
 	$ttl = $rr->{ttl} unless(defined $ttl and $ttl =~ /^\d+$/);
 
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 	my $sql = 'UPDATE vhffs_dns_rr SET data = ?, ttl = ? WHERE id = ? AND zone = ? AND type = \'A\'';
 	$dbh->do($sql, undef, $ip, $ttl, $id, $self->{dns_id}) or return -4;
 
@@ -404,7 +404,7 @@
 	return -1 unless( Vhffs::Functions::check_domain_name($host) || ( $host =~ /[a-z0-9\-]{1,63}/ ) );
 
 	my $sql = 'SELECT * FROM vhffs_dns_rr WHERE zone=? AND type=\'NS\' AND name=? AND data=?';
-	my $dbh = $self->get_main->get_db_object();
+	my $dbh = $self->get_db;
 	return -2 if($dbh->do($sql, undef, $self->{dns_id}, $name, $host) != 0);
 
 	$sql = 'INSERT INTO vhffs_dns_rr(zone, name, type, data, aux, ttl) VALUES(?, ?, \'NS\', ?, 0, ?)';
@@ -447,7 +447,7 @@
 
 	return -4 unless( Vhffs::Functions::check_ip($ip) );
 
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 	my $sql = 'INSERT INTO vhffs_dns_rr (zone, name, type, data, aux, ttl) VALUES(?, ?, \'A\', ?, 0, ?)';
 	$dbh->do($sql, undef, $self->{dns_id}, $name, $ip, $ttl) or return -5;
 
@@ -489,7 +489,7 @@
 	return -3 unless( Vhffs::Functions::check_domain_name($host, 1) || check_rr_name($host) );
 
 	my $sql = 'UPDATE vhffs_dns_rr SET data = ?, aux = ?, ttl = ? WHERE id = ? AND zone = ? AND type=\'MX\'';
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 
 	$dbh->do($sql, undef, $host, $priority, $ttl, $id, $self->{dns_id}) or return -4;
 
@@ -512,7 +512,7 @@
 	return -2 unless( $priority =~ /^\d+$/ );
 
 	my $sql = 'SELECT id FROM vhffs_dns_rr WHERE zone=? AND type=\'MX\' AND name=? AND data=?';
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 	return -3 if($dbh->do($sql, undef, $self->{dns_id}, $name, $host) != 0);
 
 	$sql = 'INSERT INTO vhffs_dns_rr(zone, name, type, data, aux, ttl) VALUES(?, ?, \'MX\', ?, ?, ?)';
@@ -568,7 +568,7 @@
 	# Looks if this host is already registered for the same service
 	# and the same protocol.
 	my $sql = 'SELECT id FROM vhffs_dns_rr WHERE type=\'SRV\' AND name=? AND data LIKE ? AND zone=?';
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 	return -8 if($dbh->do($sql, undef, $name, '%'.$host, $self->{dns_id}) != 0);
 
 	$sql = 'INSERT INTO vhffs_dns_rr(zone, name, type, data, aux, ttl) VALUES(?, ?, \'SRV\', ?, ?, 900)';
@@ -616,7 +616,7 @@
 	my $data = $weight.' '.$port.' '.$host;
 
 	my $sql = 'UPDATE vhffs_dns_rr SET data = ?, aux = ? WHERE id = ? AND zone = ? AND type = \'SRV\'';
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 	$dbh->do($sql, undef, $data, $priority, $id, $self->{dns_id}) or return -7;
 
 	$rr->{aux} = $priority;
@@ -659,7 +659,7 @@
 
 	return -4 unless( Vhffs::Functions::check_ipv6($ip) );
 
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 	my $sql = 'INSERT INTO vhffs_dns_rr (zone, name, type, data, aux, ttl) VALUES(?, ?, \'AAAA\', ?, 0, ?)';
 	$dbh->do($sql, undef, $self->{dns_id}, $name, $ip, $ttl) or return -5;
 
@@ -699,7 +699,7 @@
 	return -3 unless( Vhffs::Functions::check_ipv6($ip) );
 	$ttl = $rr->{ttl} unless(defined $ttl);
 
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 	my $sql = 'UPDATE vhffs_dns_rr SET data = ?, ttl = ? WHERE id = ? AND zone = ? AND type = \'AAAA\'';
 	$dbh->do($sql, undef, $ip, $ttl, $id, $self->{dns_id}) or return -4;
 
@@ -729,7 +729,7 @@
 	return -2 if($data =~ /^\s*$/);
 	return -3 if ( $self->name_exists( $name, 'TXT', 'CNAME' ) != 0 );
 
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 	my $sql = 'INSERT INTO vhffs_dns_rr (zone, name, type, data, aux, ttl) VALUES(?, ?, \'TXT\', ?, 0, ?)';
 	$dbh->do($sql, undef, $self->{dns_id}, $name, $data, $ttl) or return -4;
 
@@ -772,7 +772,7 @@
 	$ttl = $rr->{ttl} unless(defined $ttl and $ttl =~ /^\d+$/);
 
 	my $sql = 'UPDATE vhffs_dns_rr SET data = ?, ttl = ? WHERE id = ? AND zone = ? AND type=\'TXT\'';
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 
 	$dbh->do($sql, undef, $data, $ttl, $id, $self->{dns_id}) or return -4;
 
@@ -792,7 +792,7 @@
 	return -3 unless( Vhffs::Functions::check_domain_name($dest, 1) || check_rr_name($dest) );
 	$ttl = $rr->{ttl} unless(defined $ttl and $ttl =~ /^\d+$/);
 
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 	my $sql = 'UPDATE vhffs_dns_rr SET data = ?, ttl = ? WHERE id = ? AND type = \'CNAME\' AND zone = ?';
 	$dbh->do($sql, undef, $dest, $ttl, $id, $self->{dns_id})or return -4;
 
@@ -811,7 +811,7 @@
 	$name = '' if( $name eq '@' );
 	return -3 if ( $self->name_exists( $name, 'A', 'AAAA', 'CNAME' ) != 0 );
 
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 
 	my $sql = 'INSERT INTO vhffs_dns_rr(zone, name, type, data, aux, ttl) VALUES(?, ?, \'CNAME\', ?, 0, ?)';
 	$dbh->do($sql, undef, $self->{dns_id}, $name, $dest, $ttl) or return -4;
@@ -846,7 +846,7 @@
 	$self->{serial} = $self->get_next_serial();
 
 	#First, commit the SOA
-	my $request = $self->{'db'}->prepare( 'UPDATE vhffs_dns SET ns=? , mbox=? , serial=? , refresh=? , retry=? , expire=? , minimum=? , ttl=? WHERE dns_id=?' );
+	my $request = $self->get_db->prepare( 'UPDATE vhffs_dns SET ns=? , mbox=? , serial=? , refresh=? , retry=? , expire=? , minimum=? , ttl=? WHERE dns_id=?' );
 	$request->execute( $self->{'ns'} , $self->{'mbox'} , $self->{'serial'} , $self->{'refresh'} , $self->{'retry'} , $self->{'expire'} , $self->{'minimum'} , $self->{'ttl'} , $self->{'dns_id'} ) or return -2;
 
 	# Commit the object part
@@ -867,7 +867,7 @@
 
 sub update_serial {
 	my $self = shift;
-	my $dbh = $self->get_main()->get_db_object();
+	my $dbh = $self->get_db;
 	$self->{'serial'} = $self->get_next_serial();
 	$dbh->do( 'UPDATE vhffs_dns SET serial=? WHERE dns_id=?' , undef, $self->{'serial'}, $self->{'dns_id'} );
 }

Modified: trunk/vhffs-api/src/Vhffs/Services/Git.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Git.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/Git.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -73,7 +73,7 @@
 
 	my $git;
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -134,7 +134,7 @@
 	}
 	$sql .= ' ORDER BY g.reponame';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
@@ -152,7 +152,7 @@
 	my $sql = 'SELECT g.git_id, g.reponame, o.owner_uid, o.owner_gid, g.public, g.ml_name, o.object_id, o.date_creation, o.description, o.state FROM vhffs_git g
 		INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE g.reponame = ?';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $reponame));
 
@@ -162,7 +162,7 @@
 sub commit {
 	my $self = shift;
 
-	my $dbh = $self->get_db_object;
+	my $dbh = $self->get_db;
 	my $sql = 'UPDATE vhffs_git SET public = ?, ml_name = ? WHERE git_id = ?';
 	$dbh->do($sql, undef, $self->{public}, $self->{ml_name}, $self->{git_id});
 

Modified: trunk/vhffs-api/src/Vhffs/Services/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mail.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/Mail.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -81,7 +81,7 @@
 		)
 		AS counts';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 	my $res = $dbh->selectrow_array($sql, {}, $domain, $local_part, $domain, $local_part);
 	return (defined $res and $res > 0);
 }
@@ -116,7 +116,7 @@
 	return undef unless(Vhffs::Functions::check_domain_name($domain));
 
 	my $mail;
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -154,8 +154,8 @@
 	catchall FROM vhffs_mxdomain WHERE object_id = ?};
 	$obj = $class->SUPER::_fill_object($obj, $sql);
 	if($obj->isa('Vhffs::Services::Mail')) {
-		$obj->{boxes} = fetch_boxes($obj->get_db_object, $obj->{domain});
-		$obj->{forward} = fetch_forwards($obj->get_db_object, $obj->{domain});
+		$obj->{boxes} = fetch_boxes($obj->get_db, $obj->{domain});
+		$obj->{forward} = fetch_forwards($obj->get_db, $obj->{domain});
 	}
 	return $obj;
 }
@@ -182,7 +182,7 @@
 	}
 	$sql .= ' ORDER BY m.domain';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 
 	my $sth = $dbh->prepare( $sql );
 	$sth->execute(@params) or return undef;
@@ -207,7 +207,7 @@
 	my ($main, $domain) = @_;
 
 	my $sql = 'SELECT m.mxdomain_id, o.owner_gid, m.domain, m.boxes_path, m.catchall, o.object_id, o.owner_uid, o.date_creation, o.state, o.description FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON o.object_id = m.object_id WHERE domain = ?';
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	my @params;
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $domain));
 
@@ -262,7 +262,7 @@
 	$self->{'catchall'} = "" if( ! defined $self->{'catchall'} );
 
 	$query = "UPDATE vhffs_mxdomain SET catchall='".$self->{'catchall'}."' WHERE domain='".$self->{'domain'}."'";
-	$request = $self->{'db'}->prepare( $query );
+	$request = $self->get_db->prepare( $query );
 	$request->execute;
 
 	return -3 if( $self->SUPER::commit < 0 );
@@ -285,7 +285,7 @@
 	return -1 unless( defined($self->{forward}{$local_part}) && defined($local_part) && defined($destination) && Vhffs::Functions::valid_mail( $destination ) );
 
 	my $sql = 'UPDATE vhffs_forward SET remote_name = ? WHERE local_part = ? AND domain = ?';
-	my $dbh = $self->{db};
+	my $dbh = $self->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($destination, $local_part, $self->{domain}) or return -1;
 
@@ -306,7 +306,7 @@
 	$self->{'boxes'}{$local_part}{'password'} = $password;
 
 	my $sql = 'UPDATE vhffs_boxes SET password = ? WHERE local_part = ? AND domain = ?';
-	my $dbh = $self->{db};
+	my $dbh = $self->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($password, $local_part, $self->{domain}) or return -1;
 
@@ -331,7 +331,7 @@
 	$self->{boxes}{$local_part}{nospam} = $nospam;
 
 	my $sql = 'UPDATE vhffs_boxes SET nospam = ? WHERE domain = ? AND local_part = ?';
-	my $dbh = $self->{db};
+	my $dbh = $self->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($nospam, $self->{domain}, $local_part) or return -1;
 
@@ -352,7 +352,7 @@
 
 	$self->{boxes}{$boxname}{nospam} = $status;
 	my $sql = 'UPDATE vhffs_boxes SET nospam = ? WHERE domain = ? AND local_part = ?';
-	my $dbh = $self->get_db_object();
+	my $dbh = $self->get_db();
 	return -2 unless( $dbh->do($sql, undef, $status, $self->{domain}, $boxname) );
 	return 1;
 }
@@ -370,7 +370,7 @@
 
 	$self->{boxes}{$boxname}{novirus} = $status;
 	my $sql = 'UPDATE vhffs_boxes SET novirus = ? WHERE domain = ? AND local_part = ?';
-	my $dbh = $self->get_db_object();
+	my $dbh = $self->get_db();
 	return -2 unless( $dbh->do($sql, undef, $status, $self->{domain}, $boxname) );
 	return 1;
 }
@@ -391,7 +391,7 @@
 	$self->{'boxes'}{$local_part}{'novirus'} = $novirus;
 
 	my $sql = 'UPDATE vhffs_boxes SET novirus = ? WHERE domain = ? AND local_part = ?';
-	my $dbh = $self->{db};
+	my $dbh = $self->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($novirus, $self->{domain}, $local_part) or return -1;
 
@@ -407,7 +407,7 @@
 	$self->{'boxes'}{$local_part}{'allowpop'} = $allow;
 
 	my $sql = 'UPDATE vhffs_boxes SET allowpop=? WHERE domain=? AND local_part=?';
-	my $dbh = $self->{db};
+	my $dbh = $self->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($allow, $self->{domain}, $local_part) or return -1;
 
@@ -430,7 +430,7 @@
 	$self->{'boxes'}{$local_part}{'allowimap'} = $allow;
 
 	my $sql = 'UPDATE vhffs_boxes SET allowimap=? WHERE domain=? AND local_part=?';
-	my $dbh = $self->{db};
+	my $dbh = $self->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($allow, $self->{domain}, $local_part) or return -1;
 
@@ -453,7 +453,7 @@
 	$self->{'boxes'}{$local_part}{'state'} = $state;
 
 	my $sql = 'UPDATE vhffs_boxes SET state=? WHERE domain=? AND local_part=?';
-	my $dbh = $self->{db};
+	my $dbh = $self->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($state, $self->{domain}, $local_part) or return -1;
 
@@ -495,7 +495,7 @@
 		||  Vhffs::Services::MailingList::address_exists($self->get_main, $name, $self->{domain}) );
 
 	my $sql = 'INSERT INTO vhffs_forward(domain, local_part, remote_name, password) VALUES(?, ?, ?, \'x\')';
-	my $dbh = $self->{db};
+	my $dbh = $self->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($self->{domain}, $name, $remote) or return -3;
 
@@ -540,7 +540,7 @@
 	$self->{boxes}{$name}{state} = Vhffs::Constants::WAITING_FOR_CREATION;
 
 	my $sql = 'INSERT INTO vhffs_boxes(domain, local_part, domain_hash, password, mbox_name, nospam, novirus, allowpop, allowimap, state) VALUES(?, ?, ?, ?, ?, FALSE, FALSE, TRUE, TRUE,  ?)';
-	my $dbh = $self->{db};
+	my $dbh = $self->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($self->{domain}, $name, $domainhash, $password, $userhash, Vhffs::Constants::WAITING_FOR_CREATION) or return -3;
 
@@ -556,7 +556,7 @@
 
 	delete $self->{boxes}{$name};
 
-	my $dbh = $self->get_db_object;
+	my $dbh = $self->get_db;
 	my $sql = 'DELETE FROM vhffs_boxes WHERE local_part = ? AND domain = ?';
 	$dbh->do($sql, undef, $name, $self->{domain});
 	$sql = 'UPDATE vhffs_mxdomain SET catchall = \'\' WHERE catchall = ?';
@@ -572,7 +572,7 @@
 	return -1 unless( defined $name  && ( $name =~ /^[a-z0-9\_\-\.]+$/ ) );
 	delete $self->{forward}{$name};
 
-	my $dbh = $self->get_db_object;
+	my $dbh = $self->get_db;
 	my $sql = 'DELETE FROM vhffs_forward WHERE local_part = ? AND domain = ?';
 	$dbh->do($sql, undef, $name, $self->{domain});
 	$sql = 'UPDATE vhffs_mxdomain SET catchall = \'\' WHERE catchall = ?';
@@ -598,7 +598,7 @@
 	my $self = shift;
 	my $name = shift;
 	return undef unless $name =~ /^[a-z0-9\_\-\.]+$/;
-	my $request = $self->{'db'}->prepare('SELECT COUNT(*) FROM vhffs_forward where domain=? AND local_part=?') or return undef;
+	my $request = $self->get_db->prepare('SELECT COUNT(*) FROM vhffs_forward where domain=? AND local_part=?') or return undef;
 	$request->execute( $self->{'domain'}, $name ) or return undef;
 	my ( $rows ) = $request->fetchrow();
 	return $rows;
@@ -608,7 +608,7 @@
 	my $self = shift;
 	my $name = shift;
 	return undef unless $name =~ /^[a-z0-9\_\-\.]+$/;
-	my $request = $self->{'db'}->prepare('SELECT COUNT(*) FROM vhffs_boxes where domain=? AND local_part=?') or return undef;
+	my $request = $self->get_db->prepare('SELECT COUNT(*) FROM vhffs_boxes where domain=? AND local_part=?') or return undef;
 	$request->execute( $self->{'domain'}, $name ) or return undef;
 	my ( $rows ) = $request->fetchrow();
 	return $rows;

Modified: trunk/vhffs-api/src/Vhffs/Services/MailingList.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/MailingList.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/MailingList.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -97,7 +97,7 @@
 
 	my $ml;
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -139,7 +139,7 @@
 		WHERE object_id = ?};
 	$obj = $class->SUPER::_fill_object($obj, $sql);
 	if($obj->isa('Vhffs::Services::MailingList')) {
-		$obj->{subs} = fetch_subs($obj->get_db_object, $obj->{ml_id});
+		$obj->{subs} = fetch_subs($obj->get_db, $obj->{ml_id});
 	}
 	return $obj;
 }
@@ -170,7 +170,7 @@
 	}
 	$sql .= ' ORDER BY ml.local_part, ml.domain';
 
-	my $dbh = $vhffs->get_db_object;
+	my $dbh = $vhffs->get_db;
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
 
@@ -193,7 +193,7 @@
 sub get_by_mladdress {
 	my ($main, $local, $domain) = @_;
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	my $sql = 'SELECT ml.ml_id, ml.local_part, ml.domain, ml.prefix, o.owner_gid, ml.open_archive, ml.reply_to, ml.sub_ctrl, ml.post_ctrl, ml.signature, o.object_id, o.owner_uid, o.date_creation, o.state, o.description FROM vhffs_ml ml INNER JOIN vhffs_object o ON o.object_id = ml.object_id WHERE domain = ? and local_part = ?';
 	my $sth = $dbh->prepare($sql);
 	return undef unless ($sth->execute($domain, $local) > 0);
@@ -227,7 +227,7 @@
 	my $self = shift;
 
 	my $sql = 'UPDATE vhffs_ml SET prefix = ?, open_archive = ?, reply_to = ?, sub_ctrl = ?, post_ctrl = ?, signature = ? WHERE ml_id = ?';
-	my $dbh = $self->get_main->get_db_object();
+	my $dbh = $self->get_db;
 	$dbh->do($sql, undef, $self->{prefix}, $self->{open_archive}, $self->{reply_to}, $self->{sub_ctrl}, $self->{post_ctrl}, $self->{signature}, $self->{ml_id});
 
 	return $self->SUPER::commit;
@@ -237,7 +237,7 @@
 	my ($self, $subscriber, $right) = @_;
 
 	my $sql = 'UPDATE vhffs_ml_subscribers SET perm = ? WHERE ml_id = ? AND member = ?';
-	my $dbh = $self->get_main->get_db_object();
+	my $dbh = $self->get_db;
 	# FIXME compatibility hack, we should return a boolean
 	return -1 unless($dbh->do($sql, undef, $right, $self->{ml_id}, $subscriber) > 0);
 	$self->{subs}->{$subscriber}->{perm} = $right;
@@ -254,7 +254,7 @@
 	return -3 unless $right =~ /^[\d]+$/;
 
 	my $sql = 'INSERT INTO vhffs_ml_subscribers (member, perm, hash, ml_id, language) VALUES (?, ?, NULL, ?, NULL)';
-	my $dbh = $self->get_main->get_db_object();
+	my $dbh = $self->get_db;
 	$dbh->do($sql, undef, $subscriber, $right, $self->{ml_id}) or return -4;
 
 	my $id = $dbh->last_insert_id(undef, undef, 'vhffs_ml_subscribers', undef);
@@ -284,7 +284,7 @@
 	my $pass = Vhffs::Functions::generate_random_password();
 
 	my $sql = 'INSERT INTO vhffs_ml_subscribers(member, perm, hash, ml_id, language) VALUES(?, ?, ?, ?, NULL)';
-	my $dbh = $self->get_main->get_db_object();
+	my $dbh = $self->get_db;
 	$dbh->do($sql, undef, $subscriber, Vhffs::Constants::ML_RIGHT_SUB_WAITING_FOR_REPLY, $pass, $self->{ml_id}) or return undef;
 
 	my $id = $dbh->last_insert_id(undef, undef, 'vhffs_ml_subscribers', undef);
@@ -307,7 +307,7 @@
 
 	my $sql = 'DELETE FROM vhffs_ml_subscribers WHERE ml_id = ? AND member = ?';
 	# FIXME we should return a boolean
-	return -1 unless($self->get_main->get_db_object->do($sql, undef, $self->{ml_id}, $subscriber) > 0);
+	return -1 unless($self->get_db->do($sql, undef, $self->{ml_id}, $subscriber) > 0);
 
 	delete $self->{subs}->{$subscriber};
 	return 1;
@@ -319,7 +319,7 @@
 	my $pass = Vhffs::Functions::generate_random_password();
 
 	my $sql = 'UPDATE vhffs_ml_subscribers SET hash = ? WHERE ml_id = ? AND member = ?';
-	return undef unless($self->get_main->get_db_object->do($sql, undef, $pass, $self->{ml_id}, $subscriber) > 0);
+	return undef unless($self->get_db->do($sql, undef, $pass, $self->{ml_id}, $subscriber) > 0);
 
 	$self->{subs}->{$subscriber}->{hash} = $pass;
 	return $pass;
@@ -331,7 +331,7 @@
 
 	my $sql = 'UPDATE vhffs_ml_subscribers SET hash = NULL WHERE ml_id = ? AND member = ?';
 	# FIXME we should return a boolean
-	return -1 unless($self->get_main->get_db_object->do($sql, undef, $self->{ml_id}, $subscriber) > 0);
+	return -1 unless($self->get_db->do($sql, undef, $self->{ml_id}, $subscriber) > 0);
 
 	$self->{subs}->{$subscriber}->{hash} = undef;
 	return 1;
@@ -349,7 +349,7 @@
 	my ($vhffs, $local_part, $domain) = @_;
 
 	my $sql = 'SELECT COUNT(*) FROM vhffs_ml WHERE local_part = ? AND domain = ?';
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 	my $res = $dbh->selectrow_array($sql, {}, $local_part, $domain);
 	return (defined($res) && $res > 0);
 }
@@ -364,7 +364,7 @@
 
 	my $sql = 'UPDATE vhffs_ml_subscribers SET perm = ?, hash = ? WHERE ml_id = ? AND member = ? AND perm IN (?, ?)';
 	# FIXME we should return a boolean
-	return undef unless($self->get_main->get_db_object->do($sql, undef, Vhffs::Constants::ML_RIGHT_SUB_WAITING_FOR_DEL, $hash, $self->{ml_id}, $subscriber, Vhffs::Constants::ML_RIGHT_SUB, Vhffs::Constants::ML_RIGHT_ADMIN) > 0);
+	return undef unless($self->get_db->do($sql, undef, Vhffs::Constants::ML_RIGHT_SUB_WAITING_FOR_DEL, $hash, $self->{ml_id}, $subscriber, Vhffs::Constants::ML_RIGHT_SUB, Vhffs::Constants::ML_RIGHT_ADMIN) > 0);
 
 	$self->{subs}->{$subscriber}->{hash} = $hash;
 	$self->{subs}->{$subscriber}->{perm} = Vhffs::Constants::ML_RIGHT_SUB_WAITING_FOR_DEL;
@@ -375,7 +375,7 @@
 	my ($main, $sub) = @_;
 
 	my $sql = 'SELECT language FROM vhffs_ml_subscribers WHERE member = ?';
-	my $lang = $main->get_db_object->selectrow_array($sql, undef, $sub);
+	my $lang = $main->get_db->selectrow_array($sql, undef, $sub);
 	return $lang;
 }
 
@@ -384,7 +384,7 @@
 
 	$language = 'en_US' unless( $language =~ /^\w+$/ );
 	my $sql = 'UPDATE vhffs_ml_subscribers SET language = ? WHERE member = ?';
-	$main->get_db_object->do($sql, undef, $language, $sub) or return -1;
+	$main->get_db->do($sql, undef, $language, $sub) or return -1;
 }
 
 sub get_localpart {

Modified: trunk/vhffs-api/src/Vhffs/Services/Mercurial.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mercurial.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/Mercurial.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -72,7 +72,7 @@
 
 	my $mercurial;
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -133,7 +133,7 @@
 	}
 	$sql .= ' ORDER BY m.reponame';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
@@ -151,7 +151,7 @@
 	my $sql = 'SELECT m.mercurial_id, m.reponame, o.owner_uid, o.owner_gid, m.public, m.ml_name, o.object_id, o.date_creation, o.description, o.state FROM vhffs_mercurial m
 		INNER JOIN vhffs_object o ON o.object_id = m.object_id WHERE m.reponame = ?';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $reponame));
 
@@ -161,7 +161,7 @@
 sub commit {
 	my $self = shift;
 
-	my $dbh = $self->get_db_object;
+	my $dbh = $self->get_db;
 	my $sql = 'UPDATE vhffs_mercurial SET public = ?, ml_name = ? WHERE mercurial_id = ?';
 	$dbh->do($sql, undef, $self->{public}, $self->{ml_name}, $self->{mercurial_id});
 

Modified: trunk/vhffs-api/src/Vhffs/Services/Mysql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mysql.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/Mysql.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -122,7 +122,7 @@
 	return undef unless(check_dbname($dbname) && check_dbpass($dbpass) && check_dbuser($dbuser));
 
 	my $mysql;
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -182,7 +182,7 @@
 	}
 	$sql .= ' ORDER BY m.dbname';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
@@ -207,7 +207,7 @@
 	my ($vhffs, $dbname) = @_;
 
 	my $sql = q{SELECT m.mysql_id, o.owner_gid, m.dbname, m.dbuser, m.dbpass, o.object_id, o.owner_uid, o.date_creation, o.state, o.description FROM vhffs_mysql m INNER JOIN vhffs_object o ON o.object_id = m.object_id WHERE m.dbname = ?};
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 	my @params;
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $dbname));
 
@@ -218,7 +218,7 @@
 	my $self = shift;
 
 	my $sql = 'UPDATE vhffs_mysql SET dbuser = ?, dbpass = ? WHERE mysql_id = ?';
-	my $sth = $self->get_db_object()->prepare( $sql );
+	my $sth = $self->get_db()->prepare( $sql );
 	$sth->execute($self->{dbuser}, $self->{dbpass}, $self->{mysql_id});
 
 	return $self->SUPER::commit;
@@ -252,7 +252,7 @@
 sub blank_password {
 	my $self = shift;
 
-	my $request = $self->{'db'}->prepare('UPDATE vhffs_mysql SET dbpass=\'\' WHERE mysql_id=?') or return -1;
+	my $request = $self->get_db->prepare('UPDATE vhffs_mysql SET dbpass=\'\' WHERE mysql_id=?') or return -1;
 	$request->execute( $self->{mysql_id} );
 
 	$self->{'dbpass'} = '';

Modified: trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -125,7 +125,7 @@
 	return undef unless(check_dbname($dbname) && check_dbpass($dbpass) && check_dbuser($dbuser));
 
 	my $pg;
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -185,7 +185,7 @@
 	}
 	$sql .= ' ORDER BY p.dbname';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
@@ -211,7 +211,7 @@
 	my ($vhffs, $dbname) = @_;
 
 	my $sql = q{SELECT m.pgsql_id, o.owner_gid, m.dbname, m.dbuser, m.dbpass, o.object_id, o.owner_uid, o.date_creation, o.state, o.description FROM vhffs_pgsql m INNER JOIN vhffs_object o ON o.object_id = m.object_id WHERE m.dbname = ?};
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 	my @params;
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $dbname));
 
@@ -223,7 +223,7 @@
 	my $self = shift;
 
 	my $sql = 'UPDATE vhffs_pgsql SET dbuser = ?, dbpass = ? WHERE pgsql_id = ?';
-	my $sth = $self->get_db_object()->prepare( $sql );
+	my $sth = $self->get_db()->prepare( $sql );
 	$sth->execute($self->{dbuser}, $self->{dbpass}, $self->{pgsql_id});
 
 	return $self->SUPER::commit;
@@ -265,7 +265,7 @@
 sub blank_password {
 	my $self = shift;
 
-	my $request = $self->{'db'}->prepare('UPDATE vhffs_pgsql SET dbpass=\'\' WHERE pgsql_id=?') or return -1;
+	my $request = $self->get_db->prepare('UPDATE vhffs_pgsql SET dbpass=\'\' WHERE pgsql_id=?') or return -1;
 	$request->execute( $self->{pgsql_id} );
 
 	$self->{'dbpass'} = '';

Modified: trunk/vhffs-api/src/Vhffs/Services/Repository.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Repository.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/Repository.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -91,7 +91,7 @@
 	return undef unless check_name($rname);
 
 	my $repo;
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -156,7 +156,7 @@
 	}
 	$sql .= ' ORDER BY r.name';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
@@ -184,7 +184,7 @@
 
 	my $sql = 'SELECT r.repository_id, r.name, o.owner_uid, o.owner_gid, r.quota, r.quota_used, o.object_id, o.date_creation, o.description, o.state FROM vhffs_repository r INNER JOIN vhffs_object o ON o.object_id = r.object_id WHERE r.name = ?';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $name));
 
 	return _new Vhffs::Services::Repository($main, @params);
@@ -194,7 +194,7 @@
 	my $self = shift;
 
 	my $query = 'UPDATE vhffs_repository SET name=?, quota=?, quota_used=? WHERE repository_id=?';
-	my $request = $self->{'db'}->prepare($query);
+	my $request = $self->get_db->prepare($query);
 	$request->execute( $self->{'name'}, $self->{'quota'}, $self->{'quota_used'}, $self->{'repository_id'} ) or return -1;
 
 	return $self->SUPER::commit;

Modified: trunk/vhffs-api/src/Vhffs/Services/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Svn.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/Svn.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -74,7 +74,7 @@
 
 	my $svn;
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -135,7 +135,7 @@
 	}
 	$sql .= ' ORDER BY s.reponame';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
@@ -153,7 +153,7 @@
 	my $sql = 'SELECT s.svn_id, s.reponame, o.owner_uid, o.owner_gid, s.public, s.ml_name, o.object_id, o.date_creation, o.description, o.state FROM vhffs_svn s
 		INNER JOIN vhffs_object o ON o.object_id = s.object_id WHERE s.reponame = ?';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $reponame));
 
@@ -163,7 +163,7 @@
 sub commit {
 	my $self = shift;
 
-	my $dbh = $self->get_db_object;
+	my $dbh = $self->get_db;
 	my $sql = 'UPDATE vhffs_svn SET public = ?, ml_name = ? WHERE svn_id = ?';
 	$dbh->do($sql, undef, $self->{public}, $self->{ml_name}, $self->{svn_id});
 

Modified: trunk/vhffs-api/src/Vhffs/Services/Web.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Web.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Services/Web.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -85,7 +85,7 @@
 	return undef unless Vhffs::Functions::check_domain_name($servername);
 
 	my $web;
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	local $dbh->{RaiseError} = 1;
 	local $dbh->{PrintError} = 0;
 	$dbh->begin_work;
@@ -145,7 +145,7 @@
 	}
 	$sql .= ' ORDER BY h.servername';
 
-	my $dbh = $vhffs->get_db_object();
+	my $dbh = $vhffs->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
@@ -169,7 +169,7 @@
 	my $sql = 'SELECT h.httpd_id, h.servername, o.owner_uid, o.owner_gid, h.object_id, o.date_creation, o.description, o.state
 		FROM vhffs_httpd h INNER JOIN vhffs_object o ON o.object_id = h.object_id WHERE h.servername = ?';
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 	my @params;
 	return undef unless(@params = $dbh->selectrow_array($sql, undef, $servername));
 

Modified: trunk/vhffs-api/src/Vhffs/Stats.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Stats.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Stats.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -112,7 +112,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{lists}->{totalsubs}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_ml_subscribers';
-		($self->{stats}->{lists}->{totalsubs}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{lists}->{totalsubs}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{lists}->{totalsubs};
 }
@@ -130,7 +130,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{lists}->{awaiting_validation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_ml ml, vhffs_object o WHERE o.object_id=ml.object_id AND o.state='.Vhffs::Constants::WAITING_FOR_VALIDATION;
-		($self->{stats}->{lists}->{awaiting_validation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{lists}->{awaiting_validation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{lists}->{awaiting_validation};
 }
@@ -148,7 +148,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{lists}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_ml ml, vhffs_object o WHERE o.object_id=ml.object_id AND o.state = ?';
-		($self->{stats}->{lists}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
+		($self->{stats}->{lists}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
 	}
 	return $self->{stats}->{lists}->{activated};
 }
@@ -166,7 +166,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{lists}->{total}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_ml';
-		($self->{stats}->{lists}->{total}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{lists}->{total}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{lists}->{total};
 }
@@ -184,7 +184,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{web}->{awaiting_validation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_httpd w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{web}->{awaiting_validation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
+		($self->{stats}->{web}->{awaiting_validation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
 	}
 	return $self->{stats}->{web}->{awaiting_validation};
 }
@@ -202,7 +202,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{web}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_httpd w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{web}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
+		($self->{stats}->{web}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
 	}
 	return $self->{stats}->{web}->{activated};
 }
@@ -220,7 +220,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{users}->{total}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_users';
-		($self->{stats}->{users}->{total}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{users}->{total}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{users}->{total};
 }
@@ -238,7 +238,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{users}->{total_admin}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_users WHERE admin=?';
-		($self->{stats}->{users}->{total_admin}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::USER_ADMIN )};
+		($self->{stats}->{users}->{total_admin}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::USER_ADMIN )};
 	}
 	return $self->{stats}->{users}->{total_admin};
 }
@@ -256,7 +256,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{users}->{total_moderator}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_users WHERE admin=?';
-		($self->{stats}->{users}->{total_moderator}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::USER_MODERATOR )};
+		($self->{stats}->{users}->{total_moderator}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::USER_MODERATOR )};
 	}
 	return $self->{stats}->{users}->{total_moderator};
 }
@@ -275,7 +275,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{dns}->{awaiting_validation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_dns w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state=?';
-		($self->{stats}->{dns}->{awaiting_validation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
+		($self->{stats}->{dns}->{awaiting_validation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
 	}
 	return $self->{stats}->{dns}->{awaiting_validation};
 }
@@ -293,7 +293,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{dns}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_dns w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state=?';
-		($self->{stats}->{dns}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
+		($self->{stats}->{dns}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
 	}
 	return $self->{stats}->{dns}->{activated};
 }
@@ -311,7 +311,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{mail}->{awaiting_validation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_mxdomain w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{mail}->{awaiting_validation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
+		($self->{stats}->{mail}->{awaiting_validation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
 	}
 	return $self->{stats}->{mail}->{awaiting_validation};
 }
@@ -329,7 +329,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{mail}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_mxdomain w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{mail}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
+		($self->{stats}->{mail}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
 	}
 	return $self->{stats}->{mail}->{activated};
 }
@@ -347,7 +347,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{mail}->{total_boxes}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_boxes';
-		($self->{stats}->{mail}->{total_boxes}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{mail}->{total_boxes}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{mail}->{total_boxes};
 }
@@ -365,7 +365,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{mail}->{total_forwards}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_forward';
-		($self->{stats}->{mail}->{total_forwards}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{mail}->{total_forwards}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{mail}->{total_forwards};
 }
@@ -383,7 +383,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{cvs}->{awaiting_validation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_cvs w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state=?';
-		($self->{stats}->{cvs}->{awaiting_validation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
+		($self->{stats}->{cvs}->{awaiting_validation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
 	}
 	return $self->{stats}->{cvs}->{awaiting_validation};
 }
@@ -401,7 +401,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{cvs}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_cvs w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state=?';
-		($self->{stats}->{cvs}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
+		($self->{stats}->{cvs}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
 	}
 	return $self->{stats}->{cvs}->{activated};
 }
@@ -419,7 +419,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{svn}->{awaiting_validation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_svn w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{svn}->{awaiting_validation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
+		($self->{stats}->{svn}->{awaiting_validation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
 
 	}
 	return $self->{stats}->{svn}->{awaiting_validation};
@@ -438,7 +438,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{svn}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_svn w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state='.Vhffs::Constants::ACTIVATED;
-		($self->{stats}->{svn}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{svn}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{svn}->{activated};
 }
@@ -456,7 +456,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{git}->{awaiting_validation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_git w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{git}->{awaiting_validation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
+		($self->{stats}->{git}->{awaiting_validation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
 
 	}
 	return $self->{stats}->{git}->{awaiting_validation};
@@ -475,7 +475,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{git}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_git w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state='.Vhffs::Constants::ACTIVATED;
-		($self->{stats}->{git}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{git}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{git}->{activated};
 }
@@ -493,7 +493,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{mercurial}->{awaiting_validation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_mercurial w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{mercurial}->{awaiting_validation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
+		($self->{stats}->{mercurial}->{awaiting_validation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
 
 	}
 	return $self->{stats}->{mercurial}->{awaiting_validation};
@@ -512,7 +512,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{mercurial}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_mercurial w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state='.Vhffs::Constants::ACTIVATED;
-		($self->{stats}->{mercurial}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{mercurial}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{mercurial}->{activated};
 }
@@ -530,7 +530,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{bazaar}->{awaiting_validation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_bazaar w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{bazaar}->{awaiting_validation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
+		($self->{stats}->{bazaar}->{awaiting_validation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
 
 	}
 	return $self->{stats}->{bazaar}->{awaiting_validation};
@@ -549,7 +549,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{bazaar}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_bazaar w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state='.Vhffs::Constants::ACTIVATED;
-		($self->{stats}->{bazaar}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{bazaar}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{bazaar}->{activated};
 }
@@ -567,7 +567,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{mysql}->{awaiting_validation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_mysql w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{mysql}->{awaiting_validation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
+		($self->{stats}->{mysql}->{awaiting_validation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
 	}
 	return $self->{stats}->{mysql}->{awaiting_validation};
 }
@@ -585,7 +585,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{mysql}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_mysql w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{mysql}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
+		($self->{stats}->{mysql}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
 	}
 	return $self->{stats}->{mysql}->{activated};
 }
@@ -603,7 +603,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{pgsql}->{awaiting_validation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_pgsql w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{pgsql}->{awaiting_validation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
+		($self->{stats}->{pgsql}->{awaiting_validation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
 
 	}
 	return $self->{stats}->{pgsql}->{awaiting_validation};
@@ -622,7 +622,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{pgsql}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_pgsql w INNER JOIN vhffs_object o ON o.object_id=w.object_id WHERE o.state = ?';
-		($self->{stats}->{pgsql}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
+		($self->{stats}->{pgsql}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::ACTIVATED )};
 	}
 	return $self->{stats}->{pgsql}->{activated};
 }
@@ -640,7 +640,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{groups}->{awaiting_moderation}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_groups g INNER JOIN vhffs_object o ON o.object_id=g.object_id LEFT JOIN vhffs_users u ON u.username = g.groupname WHERE o.state = ? AND u.username IS NULL';
-		($self->{stats}->{groups}->{awaiting_moderation}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
+		($self->{stats}->{groups}->{awaiting_moderation}) = @{$self->{main}->get_db->selectrow_arrayref( $sql, undef, Vhffs::Constants::WAITING_FOR_VALIDATION )};
 	}
 	return $self->{stats}->{groups}->{awaiting_moderation};
 }
@@ -658,7 +658,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{groups}->{activated}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_groups g INNER JOIN vhffs_object o ON o.object_id=g.object_id LEFT JOIN vhffs_users u ON u.username = g.groupname WHERE o.state='.Vhffs::Constants::ACTIVATED.' AND u.username IS NULL';
-		($self->{stats}->{groups}->{activated}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{groups}->{activated}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{groups}->{activated};
 }
@@ -676,7 +676,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{groups}->{total}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_groups g LEFT JOIN vhffs_users u ON u.username = g.groupname WHERE u.username IS NULL';
-		($self->{stats}->{groups}->{total}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{groups}->{total}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{groups}->{total};
 }
@@ -694,7 +694,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{tags_categories}->{total}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_tag_category';
-		($self->{stats}->{tags_categories}->{total}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{tags_categories}->{total}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{tags_categories}->{total};
 }
@@ -712,7 +712,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{tags}->{total}) {
 		my $sql = 'SELECT COUNT(*) FROM vhffs_tag';
-		($self->{stats}->{tags}->{total}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{tags}->{total}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{tags}->{total};
 }
@@ -730,7 +730,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{tags_used}->{total}) {
 		my $sql = 'SELECT COUNT(distinct tag_id) FROM vhffs_object_tag';
-		($self->{stats}->{tags_used}->{total}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{tags_used}->{total}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{tags_used}->{total};
 }
@@ -748,7 +748,7 @@
 	my $self = shift;
 	unless(defined $self->{stats}->{tags_groups}->{total}) {
 		my $sql = 'SELECT COUNT(distinct object_id) FROM vhffs_object_tag';
-		($self->{stats}->{tags_groups}->{total}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{tags_groups}->{total}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{tags_groups}->{total};
 }
@@ -771,7 +771,7 @@
 	        WHERE vhffs_tag.category_id=vhffs_tag_category.tag_category_id
 	          AND vhffs_object_tag.tag_id=vhffs_tag.tag_id
 	        GROUP BY category,tag_label ORDER BY nb_groups DESC LIMIT 10';
-	my $sth = $self->{main}->get_db_object->prepare($sql);
+	my $sth = $self->{main}->get_db->prepare($sql);
 	$sth->execute() or return undef;
 	while( (my $t = $sth->fetchrow_hashref() )  ) {
 		push @$tags, $t;
@@ -793,7 +793,7 @@
 
 	unless(defined $self->{stats}->{tags_groups}->{max}) {
 		my $sql = 'SELECT MAX(count_tag_id) FROM (select COUNT(tag_id) as count_tag_id, object_id FROM vhffs_object_tag GROUP BY object_id) AS count_tags_groups';
-		($self->{stats}->{tags_groups}->{max}) = @{$self->{main}->get_db_object->selectrow_arrayref( $sql )};
+		($self->{stats}->{tags_groups}->{max}) = @{$self->{main}->get_db->selectrow_arrayref( $sql )};
 	}
 	return $self->{stats}->{tags_groups}->{max};
 }

Modified: trunk/vhffs-api/src/Vhffs/Tag/Category.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Tag/Category.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Tag/Category.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -52,7 +52,7 @@
 	my ($main, $label, $description, $visibility, $creator, $updated) = @_;
 	$updated = time() unless(defined $updated);
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sql = q{INSERT INTO vhffs_tag_category(label, description, visibility, updated, updater_id) VALUES (?, ?, ?, ?, ?)};
 	$dbh->do($sql, undef, $label, $description, $visibility, $updated, $creator->get_uid);
@@ -64,7 +64,7 @@
 sub get_by_category_id {
 	my ($main, $category_id) = @_;
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sql = q{SELECT tag_category_id, label, description, visibility, updated, updater_id
 		FROM vhffs_tag_category WHERE tag_category_id = ?};
@@ -82,7 +82,7 @@
 sub get_by_label {
 	my ($main, $label) = @_;
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sql = q{SELECT tag_category_id, label, description, visibility, updated, updater_id
 		FROM vhffs_tag_category WHERE label = ?};
@@ -111,7 +111,7 @@
 	}
 	$sql .= q{ ORDER BY label};
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
@@ -144,14 +144,14 @@
 sub save {
 	my ($self) = @_;
 	my $sql = q{UPDATE vhffs_tag_category SET label = ?, description = ?, visibility = ?, updated = ?, updater_id = ? WHERE tag_category_id = ?};
-	my $dbh = $self->{main}->get_db_object();
+	my $dbh = $self->{main}->get_db();
 	return $dbh->do($sql, undef, $self->{label}, $self->{description}, $self->{visibility}, $self->{updated}, $self->{updater_id}, $self->{category_id});
 }
 
 sub delete {
 	my ($self) = @_;
 	my $sql = q{DELETE FROM vhffs_tag_category WHERE tag_category_id = ?};
-	my $dbh = $self->{main}->get_db_object();
+	my $dbh = $self->{main}->get_db();
 	return $dbh->do($sql, undef, $self->{category_id});
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Tag/Request.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Tag/Request.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Tag/Request.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -45,7 +45,7 @@
 sub create {
 	my ($main, $category, $tag, $requester, $tagged) = @_;
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sql = q{INSERT INTO vhffs_tag_request(category_label, tag_label, created, requester_id, tagged_id) VALUES (?, ?, ?, ?, ?)};
 	$dbh->do($sql, undef, $category, $tag, time(), $requester->get_uid, $tagged->get_oid);
@@ -76,7 +76,7 @@
 sub get_by_request_id {
 	my ($main, $request_id) = @_;
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sql = q{SELECT tag_request_id, category_label, tag_label, created, requester_id, tagged_id
 		FROM vhffs_tag_request WHERE tag_request_id = ?};
@@ -99,7 +99,7 @@
 	my $sql = q{SELECT tag_request_id, category_label, tag_label, created, requester_id, tagged_id
 		FROM vhffs_tag_request ORDER BY created};
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute() or return undef;
@@ -133,7 +133,7 @@
 	my ($self) = @_;
 
 	my $sql = q{DELETE FROM vhffs_tag_request WHERE tag_request_id = ?};
-	my $dbh = $self->{main}->get_db_object();
+	my $dbh = $self->{main}->get_db();
 	return $dbh->do($sql, undef, $self->{request_id});
 }
 
@@ -144,7 +144,7 @@
 
 	my $requests = [];
 
-	my $dbh = $self->get_db_object();
+	my $dbh = $self->get_db();
 	my $sql = q{SELECT tag_request_id, category_label, tag_label, created, requester_id, tagged_id
 		FROM vhffs_tag_request WHERE tagged_id = ? ORDER BY created};
 

Modified: trunk/vhffs-api/src/Vhffs/Tag.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Tag.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/Tag.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -100,7 +100,7 @@
 	my ($main, $label, $description, $creator, $category, $created) = @_;
 	$created = time() unless(defined $created);
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sql = q{INSERT INTO vhffs_tag(label, description, updated, category_id, updater_id) VALUES(?, ?, ?, ?, ?)};
 	my $sth = $dbh->prepare($sql);
@@ -123,7 +123,7 @@
 	my($main, $tag_id) = @_;
 
 	my $sql = q{SELECT tag_id, label, description, updated, updater_id, category_id FROM vhffs_tag WHERE tag_id = ?};
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute($tag_id) or return undef;
@@ -191,7 +191,7 @@
 	$visibility = Vhffs::Constants::TAG_VISIBILITY_PUBLIC unless(defined $visibility);
 	my $tags = [];
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sql = q{SELECT MAX(c) AS max_count FROM
 		(SELECT COUNT(*) AS c
@@ -213,7 +213,7 @@
 		GROUP BY t.tag_id, t.label, t.description, c.tag_category_id, c.label, c.description
 		ORDER BY object_count DESC
 		LIMIT 10};
-	$sth = $main->get_db_object->prepare($sql);
+	$sth = $main->get_db->prepare($sql);
 	$sth->execute($visibility) or return undef;
 	while( (my $t = $sth->fetchrow_hashref() )  ) {
 		$t->{weight} = ceil($t->{object_count} * 10 / $max_count);
@@ -246,7 +246,7 @@
 	$visibility = Vhffs::Constants::TAG_VISIBILITY_PUBLIC unless(defined $visibility);
 	my $tags = [];
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sql = q{SELECT MAX(c) AS max_count FROM
 		(SELECT COUNT(*) AS c
@@ -268,7 +268,7 @@
 		GROUP BY t.tag_id, t.label, t.description, c.tag_category_id, c.label, c.description
 		ORDER BY RANDOM()
 		LIMIT 10};
-	$sth = $main->get_db_object->prepare($sql);
+	$sth = $main->get_db->prepare($sql);
 	$sth->execute($visibility) or return undef;
 	while( (my $t = $sth->fetchrow_hashref() )  ) {
 		$t->{weight} = ceil($t->{object_count} * 10 / $max_count);
@@ -292,7 +292,7 @@
 
 	my $tags = [];
 
-	my $dbh = $main->get_db_object();
+	my $dbh = $main->get_db();
 
 	my $sth = $dbh->prepare($sql);
 	$sth->execute(@params) or return undef;
@@ -358,7 +358,7 @@
 	my ($self) = @_;
 
 	my $sql = q{DELETE FROM vhffs_tag WHERE tag_id = ?};
-	my $dbh = $self->{main}->get_db_object();
+	my $dbh = $self->{main}->get_db();
 	return $dbh->do($sql, undef, $self->{tag_id});
 }
 
@@ -375,7 +375,7 @@
 	my ($self) = @_;
 
 	my $sql = q{UPDATE vhffs_tag SET category_id = ?,  label = ?, description = ?, updated = ?, updater_id = ? WHERE tag_id = ?};
-	my $dbh = $self->{main}->get_db_object();
+	my $dbh = $self->{main}->get_db();
 	return $dbh->do($sql, undef, $self->{category_id}, $self->{label}, $self->{description}, $self->{updated}, $self->{updater_id}, $self->{tag_id});
 }
 
@@ -397,7 +397,7 @@
 sub get_tags {
 	my ($o, $visibility) = @_;
 
-	my $dbh = $o->get_db_object();
+	my $dbh = $o->get_db();
 	my $tags = [];
 
 	my $sql = q{SELECT t.tag_id, t.label as tag_label, c.label as cat_label
@@ -448,7 +448,7 @@
 sub add_tag {
 	my ($o, $tag, $updater, $updated) = @_;
 
-	my $dbh = $o->get_db_object();
+	my $dbh = $o->get_db();
 	$updated = time() unless($updated);
 
 	# Don't fill error log with useless error messages.
@@ -474,7 +474,7 @@
 sub delete_tag {
 	my ($o, $tag) = @_;
 
-	my $dbh = $o->get_db_object();
+	my $dbh = $o->get_db();
 
 	return $dbh->do(q{DELETE FROM vhffs_object_tag WHERE object_id = ? AND tag_id = ?}, undef,
 		$o->get_oid(), $tag->{tag_id});

Modified: trunk/vhffs-api/src/Vhffs/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/User.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/User.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -144,7 +144,7 @@
 		close $badusers;
 	}
 
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	# Localize RaiseError so it get restored after we finish
 	# With this enabled, DBI automagically call die if a
 	# query goes wrong.
@@ -240,7 +240,7 @@
 
 	$query .= 'ORDER BY username';
 
-	my $request = $vhffs->{'db'}->prepare( $query );
+	my $request = $vhffs->get_db->prepare( $query );
 	$request->execute(@params);
 	while( my ($name) = $request->fetchrow_array ) {
 		my $user = Vhffs::User::get_by_username( $vhffs , $name );
@@ -271,7 +271,7 @@
 
 	my $query = 'SELECT u.uid FROM vhffs_users u INNER JOIN vhffs_object o ON o.object_id=u.object_id WHERE u.admin=? AND o.state=? AND o.date_creation<? AND ( u.lastloginpanel IS NULL OR u.lastloginpanel<? ) AND u.uid NOT IN (SELECT u.uid FROM vhffs_users u INNER JOIN vhffs_user_group ug ON u.uid=ug.uid)';
 
-	my $request = $vhffs->{'db'}->prepare( $query );
+	my $request = $vhffs->get_db->prepare( $query );
 	$request->execute( Vhffs::Constants::USER_NORMAL , Vhffs::Constants::ACTIVATED , $ts , $ts );
 	while( my $uid = $request->fetchrow_array ) {
 		my $user = Vhffs::User::get_by_uid( $vhffs , $uid );
@@ -294,7 +294,7 @@
 sub get_by_uid {
 	my ($main, $uid) = @_;
 	my $query = 'SELECT u.uid, u.gid, u.object_id, u.username, u.passwd, u.homedir, u.shell, u.admin, u.firstname, u.lastname, u.address, u.zipcode, u.city, u.country, u.mail, u.gpg_key, u.note, u.language, u.theme, u.lastloginpanel, u.ircnick, o.date_creation, o.description, o.state FROM vhffs_users u INNER JOIN vhffs_object o ON o.object_id = u.object_id WHERE u.uid = ?';
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my @params = $dbh->selectrow_array($query, undef, $uid);
 	return undef unless(@params);
 	return _new Vhffs::User($main, @params);
@@ -313,7 +313,7 @@
 sub get_by_username {
 	my ($main, $username) = @_;
 	my $query = 'SELECT u.uid, u.gid, u.object_id, u.username, u.passwd, u.homedir, u.shell, u.admin, u.firstname, u.lastname, u.address, u.zipcode, u.city, u.country, u.mail, u.gpg_key, u.note, u.language, u.theme, u.lastloginpanel, u.ircnick, o.date_creation, o.description, o.state FROM vhffs_users u INNER JOIN vhffs_object o ON o.object_id = u.object_id WHERE u.username = ?';
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my @params = $dbh->selectrow_array($query, undef, $username);
 	return undef unless(@params);
 	return _new Vhffs::User($main, @params);
@@ -330,7 +330,7 @@
 sub get_by_ircnick {
 	my ($main, $ircnick) = @_;
 	my $query = 'SELECT u.uid, u.gid, u.object_id, u.username, u.passwd, u.homedir, u.shell, u.admin, u.firstname, u.lastname, u.address, u.zipcode, u.city, u.country, u.mail, u.gpg_key, u.note, u.language, u.theme, u.lastloginpanel, u.ircnick, o.date_creation, o.description, o.state FROM vhffs_users u INNER JOIN vhffs_object o ON o.object_id = u.object_id WHERE u.ircnick = ?';
-	my $dbh = $main->get_db_object;
+	my $dbh = $main->get_db;
 	my @params = $dbh->selectrow_array($query, undef, $ircnick);
 	return undef unless(@params);
 	return _new Vhffs::User($main, @params);
@@ -359,7 +359,7 @@
 	return -2 if $self->SUPER::commit < 0;
 
 	my $sql = 'UPDATE vhffs_users SET shell = ?, passwd = ?, admin = ?, firstname = ?, lastname = ?, address = ?, zipcode = ?, country = ?, mail = ?, city = ?, gpg_key = ? , note = ? , lastloginpanel = ? , ircnick = ? WHERE uid = ?';
-	my $sth = $self->{db}->prepare($sql) or return -1;
+	my $sth = $self->get_db->prepare($sql) or return -1;
 	$sth->execute($self->{'shell'}, $self->{'passwd'}, $self->{'admin'},
 		$self->{'firstname'}, $self->{'lastname'}, $self->{'address'}, $self->{'zipcode'},
 		$self->{'country'}, $self->{'mail'}, $self->{'city'}, $self->{'gpg_key'}, $self->{'note'}, $self->{'lastloginpanel'},
@@ -1042,7 +1042,7 @@
 	my $uid = $self->get_uid;
 
 	my $query = 'SELECT COUNT(g.groupname) FROM vhffs_groups g, vhffs_user_group ug, vhffs_object o WHERE ug.uid=? AND g.gid=ug.gid AND o.object_id=g.object_id AND o.state=?';
-	my $request = $self->{'db'}->prepare( $query );
+	my $request = $self->get_db->prepare( $query );
 	return -1 unless $request->execute($uid, Vhffs::Constants::ACTIVATED);
 
 	my $row = $request->fetchrow_arrayref;
@@ -1062,7 +1062,7 @@
 
 	my $groups = [];
 	my $query = 'SELECT g.groupname FROM vhffs_groups g INNER JOIN vhffs_user_group ug ON g.gid=ug.gid WHERE ug.uid=? ORDER BY g.groupname';
-	my $request = $self->{'db'}->prepare( $query );
+	my $request = $self->get_db->prepare( $query );
 	return undef unless $request->execute($self->get_uid);
 	while( my ($groupname) = $request->fetchrow_array ) {
 		my $group = Vhffs::Group::get_by_groupname( $self->get_main, $groupname );

Modified: trunk/vhffs-api/src/Vhffs/UserGroup.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/UserGroup.pm	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-api/src/Vhffs/UserGroup.pm	2012-03-02 19:31:09 UTC (rev 2089)
@@ -108,7 +108,7 @@
 		push(@params, $state);
 	}
 
-	my $request = $vhffs->{'db'}->prepare( $query );
+	my $request = $vhffs->get_db->prepare( $query );
 	$request->execute(@params);
 	while( my ($uid, $gid, $state) = $request->fetchrow_array ) {
 		my $user = Vhffs::User::get_by_uid( $vhffs, $uid );
@@ -194,7 +194,7 @@
 	my $self = shift;
 
 	my $query = 'UPDATE vhffs_user_group SET state=? WHERE uid=? AND gid=?';
-	my $dbh = $self->get_vhffs->get_db_object;
+	my $dbh = $self->get_vhffs->get_db;
 	my $result = $dbh->prepare($query);
 	$result->execute( $self->{'state'}, $self->{'user'}->get_uid, $self->{'group'}->get_gid ) or return undef;
 	return 1;
@@ -213,7 +213,7 @@
 	# Foreign key constraints are in 'ON DELETE CASCADE' mode
 	# we don't have to bother with foreign tables deletion.
 	my $query = 'DELETE FROM vhffs_user_group WHERE uid=? AND gid=?';
-	my $dbh = $self->get_vhffs->get_db_object;
+	my $dbh = $self->get_vhffs->get_db;
 	my $request = $dbh->prepare($query);
 	$request->execute( $self->{'user'}->get_uid, $self->{'group'}->get_gid ) or return undef;
 

Modified: trunk/vhffs-contrib/autoreply/patch
===================================================================
--- trunk/vhffs-contrib/autoreply/patch	2012-03-02 09:41:53 UTC (rev 2088)
+++ trunk/vhffs-contrib/autoreply/patch	2012-03-02 19:31:09 UTC (rev 2089)
@@ -88,7 +88,7 @@
 +		|| (defined $self->{catchall} && $self->{catchall} =~ /\S+/) );
 +	
 +	my $sql = 'INSERT INTO vhffs_autoreply (domain, local_part, subject, message, start, "end") VALUES(?, ?, ?, ?, ?, ?)';
-+	my $dbh = $self->get_db_object();
++	my $dbh = $self->get_db;
 +	my $sth = $dbh->prepare($sql);
 +	$sth->execute($self->{domain}, $local_part, $subject, $message, $start->as_iso(), $end->as_iso) or return -3;
 +	$self->{autoreplies}{$local_part}{local_part} = $local_part;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/