[vhffs-dev] [519] Removed all calls to fetch, all base code now uses new fetching methods.

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


Revision: 519
Author:   beuss
Date:     2007-03-20 22:57:50 +0000 (Tue, 20 Mar 2007)

Log Message:
-----------
Removed all calls to fetch, all base code now uses new fetching methods.

Modified Paths:
--------------
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Acl.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Constants.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Avatar.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/DNS.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mail.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mailinglist.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mysql.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Pgsql.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Web.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots/Group.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots/Svn.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Cvs.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/DNS.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Httpd.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Mail.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Mysql.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Postgres.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Repository.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Svn.pm
    branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm
    branches/vhffs_4.1/vhffs-panel/acl/view.pl
    branches/vhffs_4.1/vhffs-panel/admin/mail/edit.pl
    branches/vhffs_4.1/vhffs-panel/admin/mail/show.pl
    branches/vhffs_4.1/vhffs-panel/admin/pgsql/edit.pl
    branches/vhffs_4.1/vhffs-panel/admin/pgsql/edit_submit.pl
    branches/vhffs_4.1/vhffs-panel/admin/pgsql/show.pl
    branches/vhffs_4.1/vhffs-panel/admin/repository/edit.pl
    branches/vhffs_4.1/vhffs-panel/admin/repository/show.pl
    branches/vhffs_4.1/vhffs-panel/group/join_group.pl
    branches/vhffs_4.1/vhffs-panel/group/prefs_save.pl
    branches/vhffs_4.1/vhffs-panel/group/remove_user_from_group.pl
    branches/vhffs_4.1/vhffs-panel/mail/add_account.pl
    branches/vhffs_4.1/vhffs-panel/mail/add_forward.pl
    branches/vhffs_4.1/vhffs-panel/mail/save_catchall.pl
    branches/vhffs_4.1/vhffs-panel/pgsql/prefs.pl
    branches/vhffs_4.1/vhffs-panel/repository/prefs.pl
    branches/vhffs_4.1/vhffs-robots/src/cvs_fixperms.pl
    branches/vhffs_4.1/vhffs-robots/src/refused_cvs.pl
    branches/vhffs_4.1/vhffs-robots/src/refused_groups.pl
    branches/vhffs_4.1/vhffs-robots/src/refused_web.pl


Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Acl.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Acl.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Acl.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -42,7 +42,7 @@
 
 sub what_perm_for_user
 {
-	my $entity;
+	my $user;
 	my $object;
 	my $main;
 	my $perm;
@@ -51,17 +51,17 @@
 	my $request;
 	my $rows;
 
-	$entity 	= 	shift;
+	$user 	= 	shift;
 	$object 	= 	shift;
 	$main		=	shift;
 
-	return -1 if( ( $entity->fetch < 0 ) || ( $object->fetch < 0 ) );
+	return -1 unless( defined $user && defined $object );
 
 	$perm = Vhffs::Constants::ACL_DENIED;
 	
     $query = 'SELECT perm FROM vhffs_acl WHERE oid_src=? AND oid_dst=?';
 	$request = $main->{'db'}->prepare( $query );
-	$rows = $request->execute($entity->{'object_id'}, $object->{'object_id'});
+	$rows = $request->execute($user->{'object_id'}, $object->{'object_id'});
 
 	if( $rows != 0 )
 	{
@@ -74,7 +74,7 @@
             INNER JOIN vhffs_user_group ug ON ug.gid = g.gid
             WHERE acl.oid_dst = ? AND ug.uid = ?';
 		$request = $main->{'db'}->prepare( $query );
-		$rows = $request->execute( $object->{'object_id'}, $entity->get_uid );
+		$rows = $request->execute( $object->{'object_id'}, $user->get_uid );
 
 		if( $rows != 0 )
 		{
@@ -89,7 +89,7 @@
 
 sub what_perm_for_group
 {
-	my $entity;
+	my $group;
 	my $object;
 	my $main;
 	my $query;
@@ -97,16 +97,16 @@
 	my $result;
 	my $rows;
 
-	$entity		=	shift;
+	$group		=	shift;
 	$object		=	shift;
 	$main		=	shift;
 
-	return -1 if( ( $entity->fetch < 0 ) || ( $object->fetch < 0 ) );
+	return -1 unless(defined $group && defined $object);
 	
 	$query = 'SELECT perm FROM vhffs_acl WHERE oid_src = ? AND oid_dst = ?';
 
 	$request = $main->{'db'}->prepare( $query );
-	$rows = $request->execute( $entity->{'object_id'}, $object->{'object_id'} );
+	$rows = $request->execute( $group->{'object_id'}, $object->{'object_id'} );
 
 	if ( $rows != 0 )
 	{
@@ -125,7 +125,7 @@
 {
 	my ( $entity , $object , $perm , $main ) = @_;
 
-	return -1 if( ( $entity->fetch < 0 ) || ( $object->fetch < 0 ) );
+	return -1 unless(defined $entity && defined $object );
 
     my $query = 'UPDATE vhffs_acl SET perm = ? WHERE oid_src = ? AND oid_dst = ?';
     my $request = $main->{'db'}->prepare( $query );
@@ -149,7 +149,7 @@
 {
 	my ( $entity , $object , $main ) = @_;
 
-	return -1 if( ( $entity->fetch < 0 ) || ( $object->fetch < 0 ) );
+	return -1 unless(defined $entity && defined $object );
 
 	my $query;
 	my $request;
@@ -174,7 +174,7 @@
 sub getall_acl_for_user_per_object
 {
 	my ( $obj , $main ) = @_;
-	return -1 if( $obj->fetch < 0 );
+	return -1 unless( defined $obj );
 
     my $query = 'SELECT u.username, acl.perm FROM vhffs_acl acl INNER JOIN vhffs_users u ON u.object_id = acl.oid_src WHERE oid_dst=?';
 	my $request = $main->{'db'}->prepare( $query );
@@ -193,7 +193,7 @@
 	$obj		=	shift;
 	$main		=	shift;
 
-	return -1 if( $obj->fetch < 0 );
+	return -1 unless( defined $obj );
 
     $query = 'SELECT g.groupname, perm FROM vhffs_acl acl INNER JOIN vhffs_groups g ON acl.oid_src = g.object_id WHERE acl.oid_dst = ?';
 	$request = $main->{'db'}->prepare( $query );

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Constants.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Constants.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Constants.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -7,7 +7,7 @@
 
 use constant
 {
-    VHFFS_VERSION => '4.1-alpha (Revision: 496)',
+    VHFFS_VERSION => '4.1-alpha (Revision: 518)',
     VHFFS_RELEASE_NAME => "hippocampus",
     
     WAITING_FOR_VALIDATION => 1,

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Avatar.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Avatar.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Avatar.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -87,7 +87,7 @@
     my $config = $vhffs->get_config;
     my $datadir = $config->get_datadir . "/avatar";
 	
-	return undef if( $object->fetch < 0 );
+	return undef unless( defined $object );
 
 	$digest = md5_hex( $object->get_oid );
 	$dir = $datadir . "/" . substr( $digest , 0 , 2 ) . "/" . substr( $digest , 2 , 2 ) . "/" .substr( $digest , 4 , 2 );

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/DNS.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/DNS.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/DNS.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -125,7 +125,7 @@
 {
 	my ( $group , $main ) =@_ ;
 
-	return undef if ( $group->fetch < 0 );
+	return undef unless( defined $group );
 
 	my $query = "SELECT ns.domain, ns.object_id , o.object_id, o.state  FROM vhffs_dns ns , vhffs_object o WHERE o.object_id=ns.object_id AND ns.owner_gid='".$group->get_gid."'";
 	my $request = $main->{'db'}->prepare( $query ) or return -1;

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mail.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mail.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mail.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -91,7 +91,7 @@
 	my $main  = shift ;
 	my $state = shift;
        
-	return undef if ( $group->fetch < 0 );
+	return undef unless( defined $group );
 
 	my $query;
 	  
@@ -118,7 +118,7 @@
         my( $main , $domain , $description, $user , $group ) = @_;
         
         return -1 if( ! defined $user );
-        return -2 if( $group->fetch < 0 );
+        return -2 if( ! defined $group );
         
         my $mail = Vhffs::Services::Mail::create($main, $domain, $description, $user, $group);
 

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mailinglist.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mailinglist.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mailinglist.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -92,7 +92,7 @@
     my $main  = shift ;
     my $state = shift;
 
-    return undef if ( $group->fetch < 0 );
+    return undef unless( defined $group );
 
     my $query;
 

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mysql.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mysql.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Mysql.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -112,7 +112,7 @@
 {
         my ( $group , $main ) = @_;
 
-        return undef if ( $group->fetch < 0 );
+        return undef unless( defined $group );
 
         my $query = "SELECT m.dbname , m.object_id , o.state FROM vhffs_mysql m, vhffs_object o WHERE m.object_id=o.object_id AND m.owner_gid='".$group->get_gid."'";
 

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Pgsql.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Pgsql.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Pgsql.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -91,7 +91,7 @@
 {       
         my ( $group , $main ) = @_;
         
-        return undef if ( $group->fetch < 0 );
+        return undef unless( defined $group );
         
         my $query = "SELECT p.dbname , p.object_id , o.state  FROM vhffs_pgsql p, vhffs_object o WHERE p.object_id=o.object_id AND p.owner_gid='".$group->get_gid."'";
 

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Web.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Web.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Web.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -63,7 +63,7 @@
 {
         my ( $group , $main ) =@_ ;
 
-        return undef if ( $group->fetch < 0 );
+        return undef unless( defined $group );
 
         my $query = "SELECT w.servername, w.object_id, o.state  FROM vhffs_httpd w, vhffs_object o WHERE o.object_id=w.object_id AND w.owner_gid='".$group->get_gid."'";
         my $request = $main->{'db'}->prepare( $query ) or return -1;

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots/Group.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots/Group.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots/Group.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -124,7 +124,7 @@
 	my $main = shift;
 
 	return -1 if( ! defined $user );
-	return -2 if( $group->fetch < 0);
+	return -2 if( ! defined $group );
 
 	my $path = $user->get_home . "/" . $group->get_groupname;
 	unlink( $path );
@@ -145,7 +145,7 @@
 	my $main = shift;
 	
 	return -1 if( ! defined $user );
-	return -1 if( $group->fetch < 0);
+	return -1 if( ! defined $group );
 
 	my $path = $user->get_home . "/" . $group->get_groupname;
 

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots/Svn.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots/Svn.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots/Svn.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -139,14 +139,11 @@
 	my $dir;
 	my $dir2;
 
-	if( $svn->fetch > 0 )
-	{
+	if( defined $svn ) {
 	    $dir = $svn->get_dir;
 	    system("rm -rf $dir 2>/dev/null");
 	    $svn->delete;
-	}
-	else
-	{
+    } else {
 	    return -1;
 	}
 	

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Robots.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -120,7 +120,7 @@
 	my $linkname = shift;
 	my $main = shift;
 
-	return -1 if( $group->fetch < 0 );
+	return -1 unless( defined $group );
 
 	my $path = Vhffs::Functions::hash_groupname( $group->get_groupname , $main )."/".$linkname;
 
@@ -136,7 +136,7 @@
 	my $linkname = shift;
 	my $main = shift;
 
-	return -1 if( $group->fetch < 0 );
+	return -1 unless( defined $group );
 
 	my $path = Vhffs::Functions::hash_groupname( $group->get_groupname , $main )."/".$linkname;
 

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Cvs.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Cvs.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Cvs.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -285,7 +285,8 @@
     my($main, $cvsroot) = @_;
     my $sql = 'SELECT c.cvs_id, c.cvsroot, c.owner_uid, c.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 @params = $dbh->selectrow_array($sql, undef, $cvsroot);
+    my @params;
+    return undef unless(@params = $dbh->selectrow_array($sql, undef, $cvsroot));
 
     return _new Vhffs::Services::Cvs($main, @params);
 }

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/DNS.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/DNS.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/DNS.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -299,7 +299,8 @@
     my $sql = 'SELECT d.dns_id, d.domain, d.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 @params = $dbh->selectrow_array($sql, undef, $name);
+    my @params;
+    return undef unless(@params = $dbh->selectrow_array($sql, undef, $name));
     my $dns_id = $params[0];
 
     # Fetches A records

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Httpd.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Httpd.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Httpd.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -417,7 +417,8 @@
     my $sql = 'SELECT h.httpd_id, h.servername, h.crawl, h.owner_http, h.owner_rev, h.owner_uid, h.owner_gid, h.trafic, h.alert_state, h.alert_limit, 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 @params = $dbh->selectrow_array($sql, undef, $servername);
+    my @params;
+    return undef unless(@params = $dbh->selectrow_array($sql, undef, $servername));
 
     return _new Vhffs::Services::Httpd($main, @params);
 }

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Mail.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Mail.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Mail.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -607,7 +607,8 @@
 
     my $sql = 'SELECT m.mxdomain_id, m.owner_gid, m.domain, m.unix_user, m.boxes_path, m.max_popbox, 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 @params = $dbh->selectrow_array($sql, undef, $domain);
+    my @params;
+    return undef unless(@params = $dbh->selectrow_array($sql, undef, $domain));
 
     # We now need the boxes and forwards
     $sql = 'SELECT domain, local_part, domain_hash, password_hash, mbox_name, password_hash AS password, nospam::integer, novirus::integer FROM vhffs_boxes WHERE domain = ?';

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Mysql.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Mysql.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Mysql.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -293,7 +293,8 @@
 
     my $sql = q{SELECT m.mysql_id, m.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 @params = $dbh->selectrow_array($sql, undef, $dbname);
+    my @params;
+    return undef unless(@params = $dbh->selectrow_array($sql, undef, $dbname));
 
     return _new Vhffs::Services::Mysql($vhffs, @params);
 }

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Postgres.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Postgres.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Postgres.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -305,7 +305,8 @@
 
     my $sql = q{SELECT m.pgsql_id, m.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 @params = $dbh->selectrow_array($sql, undef, $dbname);
+    my @params;
+    return undef unless(@params = $dbh->selectrow_array($sql, undef, $dbname));
 
     return _new Vhffs::Services::Postgres($vhffs, @params);
 

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Repository.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Repository.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Repository.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -210,7 +210,7 @@
     my $sql = 'SELECT r.repository_id, r.name, r.owner_uid, r.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();
-    @params = $dbh->selectrow_array($sql, undef, $name);
+    return undef unless(@params = $dbh->selectrow_array($sql, undef, $name));
 
     return _new Vhffs::Services::Repository($main, @params);
 }

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Svn.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Svn.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/Svn.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -208,7 +208,7 @@
 
     my $dbh = $main->get_db_object();
 
-    @params = $dbh->selectrow_array($sql, undef, $reponame);
+    return undef unless(@params = $dbh->selectrow_array($sql, undef, $reponame));
 
     return _new Vhffs::Services::Svn($main, @params);
 

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm	2007-03-20 22:57:50 UTC (rev 519)
@@ -887,7 +887,6 @@
 {
 	my $self = shift;
 
-	return undef if( $self->fetch < 0 );
 	my @groups;
 	my $uid = $self->get_uid;
 	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';

Modified: branches/vhffs_4.1/vhffs-panel/acl/view.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/acl/view.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/acl/view.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -80,7 +80,7 @@
 }
 elsif( $type eq "dns" )
 {
-	$object = new Vhffs::Services::DNS( $vhffs , $name , $user , $group );
+	$object = Vhffs::Services::DNS::get_by_domainname( $vhffs , $name );
 }
 elsif( $type eq "mysql" )
 {
@@ -88,7 +88,7 @@
 }
 elsif( $type eq "pgsql" )
 {
-	$object = new Vhffs::Services::Postgres( $vhffs , $name , $user , $group );
+	$object = Vhffs::Services::Postgres::get_by_dbname( $vhffs , $name );
 }
 elsif( $type eq "cvs" )
 {
@@ -96,11 +96,12 @@
 }
 elsif( $type eq "svn" )
 {
-	$object = new Vhffs::Services::Svn( $vhffs , $name , $user , $group );
+	$object = Vhffs::Services::Svn::get_by_reponame( $vhffs , $name );
 }
 elsif( $type eq "ns" )
 {
-	$object = new Vhffs::Services::DNS( $vhffs , $name  );
+    #?????
+	$object = Vhffs::Services::DNS::get_by_domainname( $vhffs , $name  );
 }
 elsif( $type eq "mail" )
 {
@@ -109,11 +110,11 @@
 elsif( $type eq "ml" )
 {
 	my( $lpart , $domain ) = split( /\@/ , $name );
-	$object = new Vhffs::Services::Mailing( $vhffs , $lpart , $domain );
+	$object = Vhffs::Services::Mailing::get_by_mladdress( $vhffs , $lpart , $domain );
 }
 elsif( $type eq "repository" )
 {
-	$object = new Vhffs::Services::Repository( $vhffs , $name , $user , $group );
+	$object = Vhffs::Services::Repository::get_by_reponame( $vhffs , $name );
 }
 else
 {
@@ -127,7 +128,7 @@
 # $ok = 1 , so, ths object is instanciate
 if( $ok == 1 )
 {
-	if( ( ! defined $object ) || ( $object->fetch < 0 ) )
+	if( ! defined $object )
 	{
 		$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 		$message = sprintf( gettext("Cannot get informations on this object %s %s"), $type, $name);

Modified: branches/vhffs_4.1/vhffs-panel/admin/mail/edit.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/mail/edit.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/admin/mail/edit.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -81,7 +81,7 @@
 	my $message = gettext( "CGI ERROR !");
 	$template->param( MESSAGE => $message );
 }
-elsif( ( ! defined ( $object = new Vhffs::Services::Mail( $vhffs , $domain_name ) ) ) || ( $object->fetch < 0 ) )
+elsif( ! defined ( $object = Vhffs::Services::Mail::get_by_mxdomain( $vhffs , $domain_name ) ) )
 {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	my $message = gettext( "Cannot fetch object");

Modified: branches/vhffs_4.1/vhffs-panel/admin/mail/show.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/mail/show.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/admin/mail/show.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -81,7 +81,7 @@
 	my $message = gettext( "CGI ERROR !");
 	$template->param( MESSAGE => $message );
 }
-elsif( ( ! defined ( $object = new Vhffs::Services::Mail( $vhffs , $domain_name ) ) ) || ( $object->fetch < 0 ) )
+elsif( ! defined ( $object = Vhffs::Services::Mail::get_by_mxdomain( $vhffs , $domain_name ) ) )
 {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	my $message = gettext( "Cannot fetch object");

Modified: branches/vhffs_4.1/vhffs-panel/admin/pgsql/edit.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/pgsql/edit.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/admin/pgsql/edit.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -79,7 +79,7 @@
 	my $message = gettext( "CGI ERROR !");
 	$template->param( MESSAGE => $message );
 }
-elsif( ( ! defined ( $object = new Vhffs::Services::Postgres( $vhffs , $name ) ) ) || ( $object->fetch < 0 ) )
+elsif( ! defined ( $object = Vhffs::Services::Postgres::get_by_dbname( $vhffs , $name ) ) )
 {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	my $message = gettext( "Cannot fetch object");

Modified: branches/vhffs_4.1/vhffs-panel/admin/pgsql/edit_submit.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/pgsql/edit_submit.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/admin/pgsql/edit_submit.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -79,7 +79,7 @@
 	my $message = gettext( "CGI ERROR !");
 	$template->param( MESSAGE => $message );
 }
-elsif( ( ! defined ( $object = new Vhffs::Services::Postgres( $vhffs , $name ) ) ) || ( $object->fetch < 0 ) )
+elsif( ! defined ( $object = Vhffs::Services::Postgres::get_by_dbname( $vhffs , $name ) ) )
 {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	my $message = sprintf( gettext("Cannot fetch object %s"), $name );

Modified: branches/vhffs_4.1/vhffs-panel/admin/pgsql/show.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/pgsql/show.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/admin/pgsql/show.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -79,7 +79,7 @@
 	my $message = gettext( "CGI ERROR !");
 	$template->param( MESSAGE => $message );
 }
-elsif( ( ! defined ( $object = new Vhffs::Services::Postgres( $vhffs , $name ) ) ) || ( $object->fetch < 0 ) )
+elsif( ! defined ( $object = Vhffs::Services::Postgres::get_by_dbname( $vhffs , $name ) ) )
 {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	my $message = gettext( "Cannot fetch object");

Modified: branches/vhffs_4.1/vhffs-panel/admin/repository/edit.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/repository/edit.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/admin/repository/edit.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -79,7 +79,7 @@
 	my $message = gettext( "CGI ERROR !");
 	$template->param( MESSAGE => $message );
 }
-elsif( ( ! defined ( $object = new Vhffs::Services::Repository( $vhffs , $name  ) ) ) || ( $object->fetch < 0 ) )
+elsif( ! defined ( $object = Vhffs::Services::Repository::get_by_reponame( $vhffs , $name ) ) )
 {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	my $message = gettext( "Cannot fetch object");

Modified: branches/vhffs_4.1/vhffs-panel/admin/repository/show.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/repository/show.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/admin/repository/show.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -79,7 +79,7 @@
 	my $message = gettext( "CGI ERROR !");
 	$template->param( MESSAGE => $message );
 }
-elsif( ( ! defined ( $object = new Vhffs::Services::Repository( $vhffs , $name  ) ) ) || ( $object->fetch < 0 ) )
+elsif( ! defined ( $object = Vhffs::Services::Repository::get_by_reponame( $vhffs , $name  ) ) )
 {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	my $message = gettext( "Cannot fetch object");

Modified: branches/vhffs_4.1/vhffs-panel/group/join_group.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/group/join_group.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/group/join_group.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -69,17 +69,13 @@
 {
 	$message = gettext("CGI Error");
 }
-elsif( ! defined( $user2 ) )
-{
-	$message = gettext( "No such user on Vhffs");
-}
 elsif( ( Vhffs::Acl::what_perm_for_user( $user , $group, $vhffs ) < Vhffs::Constants::ACL_MODIFY ) && ( $user->is_admin != 1 ))
 {
 	$message = gettext( "You're not allowed to do this (ACL rights)" );
 }
 else{
 
-	if( $user2->fetch > 0 )
+	if( defined $user2 )
 	{
 		if( $group->add_user( $user2 ) < 0 )
 		{
@@ -97,19 +93,19 @@
 		my $subtemplate;
 		my $output = "";
 
-		my $users = Vhffs::Panel::User::getall_users( $vhffs , $username );
+		my $users = Vhffs::Panel::User::search( $vhffs , $username );
 
 		if( defined $users )
 		{
 			$template = new HTML::Template( filename => $templatedir."/group/add_user.tmpl" );
 			$template->param( TEXT_TITLE => gettext("Many users matched your query. Please choose between them") );
 
-			foreach( sort ( keys %{$users} ) )
+			foreach( @{$users} )
 			{
 				$subtemplate = new HTML::Template( filename => $templatedir."/group/list_user.tmpl" );
-				$subtemplate->param( VALUE_FIRSTNAME => $users->{$_}{'firstname'} );
-				$subtemplate->param( VALUE_LASTNAME => $users->{$_}{'lastname'} );
-				$subtemplate->param( VALUE_USERNAME => $users->{$_}{'username'} );
+				$subtemplate->param( VALUE_FIRSTNAME => $_->{'firstname'} );
+				$subtemplate->param( VALUE_LASTNAME => $_->{'lastname'} );
+				$subtemplate->param( VALUE_USERNAME => $_->{'username'} );
 				$subtemplate->param( VALUE_GROUPNAME => $group->get_groupname );
 				$subtemplate->param( TEXT_SEND => gettext("Add this user to this group"));
 

Modified: branches/vhffs_4.1/vhffs-panel/group/prefs_save.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/group/prefs_save.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/group/prefs_save.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -69,11 +69,6 @@
 #We test if the owner exist
 
 my $retour;
-#$retour = $userowner->fetch;
-#if( $retour < 0  )
-#{
-#	$message = gettext("This user doesn't exist in VHFFS database");
-#}
 if( ! defined ( $description ) )
 {
 	$message = gettext("CGI Error !");

Modified: branches/vhffs_4.1/vhffs-panel/group/remove_user_from_group.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/group/remove_user_from_group.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/group/remove_user_from_group.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -66,7 +66,7 @@
 
 #We test if the owner exist
 
-if( ( ! defined $username ) || ( ! defined $user2 ) )
+if( ! defined $username )
 {
 	$message = gettext("CGI Error");
 }
@@ -74,7 +74,7 @@
 {
 	$message = gettext( "You're not allowed to do this (ACL rights)" );
 }
-elsif( $user2->fetch < 0 )
+elsif( !defined $user2 )
 {
 	$message = gettext( "This user does not exists ");
 }

Modified: branches/vhffs_4.1/vhffs-panel/mail/add_account.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/mail/add_account.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/mail/add_account.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -64,11 +64,11 @@
 my $password = $cgi->param("PASSWORD");
 my $template;
 my $message;
-my $mail = new Vhffs::Services::Mail( $vhffs , $domain , $user , $group );
+my $mail = Vhffs::Services::Mail::get_by_mxdomain( $vhffs , $domain );
 
 my $templatedir = $vhffs->get_config->get_templatedir;
 
-if( $mail->fetch < 0 )
+if( !defined $mail )
 {
 
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
@@ -105,14 +105,7 @@
 	}
 	else
 	{
-		if( $mail->commit < 0 )
-		{
-			$message = gettext( "Unable to record changes on this domain");
-		}
-		else
-		{
-			$message = gettext( "This box has been successfully added to this domain" );
-		}
+		$message = gettext( "This box has been successfully added to this domain" );
 	}
 	$template->param( MESSAGE => $message );
 }

Modified: branches/vhffs_4.1/vhffs-panel/mail/add_forward.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/mail/add_forward.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/mail/add_forward.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -64,13 +64,12 @@
 my $fmail = $cgi->param("FMAIL");
 my $template;
 my $message;
-my $mail = new Vhffs::Services::Mail( $vhffs , $domain , $user , $group );
+my $mail = Vhffs::Services::Mail::get_by_mxdomain( $vhffs , $domain );
 
 my $templatedir = $vhffs->get_config->get_templatedir;
 $template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 
-if( $mail->fetch < 0 )
-{
+if( ! defined $mail ) {
 	$message = gettext( "Cannot get informations on this object");
 	$template->param( MESSAGE => $message );
 }
@@ -97,14 +96,7 @@
 	}
 	else
 	{
-		if( $mail->commit < 0 )
-		{
-			$message = gettext("Unable to record changes on this domain");
-		}
-		else
-		{
-			$message = gettext("This forward has been successfully added to this domain");
-		}
+		$message = gettext("Unable to record changes on this domain");
 	}
 	$template->param( MESSAGE => $message );
 }

Modified: branches/vhffs_4.1/vhffs-panel/mail/save_catchall.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/mail/save_catchall.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/mail/save_catchall.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -66,10 +66,10 @@
 
 my $templatedir = $vhffs->get_config->get_templatedir;
 my $message;
-my $mail = new Vhffs::Services::Mail( $vhffs , $domain , $user , $group );
+my $mail = Vhffs::Services::Mail::get_by_mxdomain( $vhffs , $domain );
 $template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 
-if( $mail->fetch < 0 )
+if( !defined $mail )
 {
 	$message = gettext( "Cannot get informations on this object");
 	$template->param( MESSAGE => $message );

Modified: branches/vhffs_4.1/vhffs-panel/pgsql/prefs.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/pgsql/prefs.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/pgsql/prefs.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -60,11 +60,11 @@
 my $dbname = $cgi->param("name");
 my $template;
 my $message;
-my $pgsql = new Vhffs::Services::Postgres( $vhffs , $dbname , $user , $group );
+my $pgsql = Vhffs::Services::Postgres::get_by_dbname( $vhffs , $dbname );
 
 my $templatedir = $vhffs->get_config->get_templatedir;
 
-if( $pgsql->fetch < 0 )
+if( ! defined $pgsql)
 {
 
 	my $template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );

Modified: branches/vhffs_4.1/vhffs-panel/repository/prefs.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/repository/prefs.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-panel/repository/prefs.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -61,20 +61,17 @@
 my $repo_name = $cgi->param("name");
 my $template;
 
-my $repo = new Vhffs::Services::Repository( $vhffs , $repo_name , $user );
+my $repo = Vhffs::Services::Repository::get_by_reponame( $vhffs , $repo_name );
 
 my $message;
 
 my $templatedir = $vhffs->get_config->get_templatedir;
 
-if( ( ! defined $repo_name ) || ( ! defined $repo ) )
-{
+if( ! defined $repo_name ) {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	$message = gettext( "CGI Error !");
 	$template->param( MESSAGE => $message );
-}
-elsif( $repo->fetch < 0 )
-{
+} elsif( ! defined $repo ) {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	$message = gettext( "Cannot get informations on this object");
 	$template->param( MESSAGE => $message );

Modified: branches/vhffs_4.1/vhffs-robots/src/cvs_fixperms.pl
===================================================================
--- branches/vhffs_4.1/vhffs-robots/src/cvs_fixperms.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-robots/src/cvs_fixperms.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -67,7 +67,7 @@
 	$user = $cvs->get_user;
 	$group = $cvs->get_group;
 	#First, update uid and gid informations on files
-	if( ( defined $user ) && ( $group->fetch > 0 ) )
+	if( ( defined $user ) && ( defined $group ) )
         {
 	            Vhffs::Functions::change_owner_recur( $cvs->get_dir , $user->get_uid , $group->get_gid );
 	}

Modified: branches/vhffs_4.1/vhffs-robots/src/refused_cvs.pl
===================================================================
--- branches/vhffs_4.1/vhffs-robots/src/refused_cvs.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-robots/src/refused_cvs.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -61,31 +61,26 @@
 
 foreach $object ( @{$objects} )
 {
-	if( ( defined $object ) && ( $object->fetch > 0 ) )
-	{
-		$user = $object->get_user;
-		$lang = Vhffs::Panel::User::get_lang( $user );
-		setlocale( LC_ALL , $lang ) if( defined $lang );
-		if( defined $user )
-		{
-			$message  = sprintf( gettext("Your CVS request : %s ") , $object->get_cvsroot);
-			$message .= gettext("has been refused by the Moderators team")."\n";
-			$message .= gettext("In hope to keep you in our hosting service")."\n\n";
-			if( length( $object->get_description ) > 1 )
-			{
-			    $message .= gettext("Reason given : ");
-			    $message .= $object->get_description . "\n";
-			}
-			$message .= sprintf( gettext("If you encounters problem, please mail: %s\n") , $vhffs->get_config->get_moderator_mail ) if( defined $vhffs->get_config->get_moderator_mail );
-			$message .= gettext("Cheers,")."\n";
-			$message .= gettext("The Moderator and Admin team");
-
-			$subject = gettext("Your CVS repository request");
-			Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $subject , $message );
+	$user = $object->get_user;
+	$lang = Vhffs::Panel::User::get_lang( $user );
+	setlocale( LC_ALL , $lang ) if( defined $lang );
+	if( defined $user ) {
+		$message  = sprintf( gettext("Your CVS request : %s ") , $object->get_cvsroot);
+		$message .= gettext("has been refused by the Moderators team")."\n";
+		$message .= gettext("In hope to keep you in our hosting service")."\n\n";
+		if( length( $object->get_description ) > 1 ) {
+		    $message .= gettext("Reason given : ");
+		    $message .= $object->get_description . "\n";
 		}
-		
-		$object->delete;
+		$message .= sprintf( gettext("If you encounters problem, please mail: %s\n") , $vhffs->get_config->get_moderator_mail ) if( defined $vhffs->get_config->get_moderator_mail );
+		$message .= gettext("Cheers,")."\n";
+		$message .= gettext("The Moderator and Admin team");
+
+		$subject = gettext("Your CVS repository request");
+		Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $subject , $message );
 	}
+	
+	$object->delete;
 }
 
 Vhffs::Robots::unlock( $vhffs );

Modified: branches/vhffs_4.1/vhffs-robots/src/refused_groups.pl
===================================================================
--- branches/vhffs_4.1/vhffs-robots/src/refused_groups.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-robots/src/refused_groups.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -60,31 +60,26 @@
 
 foreach $object ( @{$objects} )
 {
-	if( ( defined $object ) && ( $object->fetch > 0 ) )
-	{
-		$user = $object->get_user;
-		$lang = Vhffs::Panel::User::get_lang( $user );
-		setlocale( LC_ALL , $lang ) if( defined $lang );
-		if( defined $user )
-		{
-			$message  = sprintf( gettext("Your Group request : %s ") , $object->get_groupname);
-			$message .= gettext("has been refused by the Moderators team")."\n";
-			$message .= gettext("In hope to keep you in our hosting service")."\n\n";
-			if( length( $object->get_description ) > 1 )
-			{
-			    $message .= gettext("Reason given : ");
-			    $message .= $object->get_description . "\n";
-			}
-			$message .= sprintf( gettext("If you encounters problem, please mail: %s\n") , $vhffs->get_config->get_moderator_mail ) if( defined $vhffs->get_config->get_moderator_mail );
-			$message .= gettext("Cheers,")."\n";
-			$message .= gettext("The Moderator and Admin team");
-
-			$subject = gettext("Your Group request");
-			Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $subject , $message );
+	$user = $object->get_user;
+	$lang = Vhffs::Panel::User::get_lang( $user );
+	setlocale( LC_ALL , $lang ) if( defined $lang );
+	if( defined $user ) {
+		$message  = sprintf( gettext("Your Group request : %s ") , $object->get_groupname);
+		$message .= gettext("has been refused by the Moderators team")."\n";
+		$message .= gettext("In hope to keep you in our hosting service")."\n\n";
+		if( length( $object->get_description ) > 1 ) {
+		    $message .= gettext("Reason given : ");
+		    $message .= $object->get_description . "\n";
 		}
-		
-		$object->delete;
+		$message .= sprintf( gettext("If you encounters problem, please mail: %s\n") , $vhffs->get_config->get_moderator_mail ) if( defined $vhffs->get_config->get_moderator_mail );
+		$message .= gettext("Cheers,")."\n";
+		$message .= gettext("The Moderator and Admin team");
+
+        $subject = gettext("Your Group request");
+		Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $subject , $message );
 	}
+		
+	$object->delete;
 }
 
 

Modified: branches/vhffs_4.1/vhffs-robots/src/refused_web.pl
===================================================================
--- branches/vhffs_4.1/vhffs-robots/src/refused_web.pl	2007-03-20 21:57:41 UTC (rev 518)
+++ branches/vhffs_4.1/vhffs-robots/src/refused_web.pl	2007-03-20 22:57:50 UTC (rev 519)
@@ -60,31 +60,26 @@
 
 foreach $object ( @{$objects} )
 {
-	if( ( defined $object ) && ( $object->fetch > 0 ) )
-	{
-		$user = $object->get_user;
-		$lang = Vhffs::Panel::User::get_lang( $user );
-		setlocale( LC_ALL , $lang ) if( defined $lang );
-		if( defined $user )
-		{
-			$message  = sprintf( gettext("Your web hosting request for the servername : %s ") , $object->get_servername);
-			$message .= gettext("has been refused by the Moderators team")."\n";
-			$message .= gettext("In hope to keep you in our hosting service")."\n\n";
-			if( length( $object->get_description ) > 1 )
-			{
-			    $message .= gettext("Reason given : ");
-			    $message .= $object->get_description . "\n";
-			}
-			$message .= sprintf( gettext("If you encounters problem, please mail: %s\n") , $vhffs->get_config->get_moderator_mail ) if( defined $vhffs->get_config->get_moderator_mail );
-			$message .= gettext("Cheers,")."\n";
-			$message .= gettext("The Moderator and Admin team");
-
-			$subject = gettext("Your hosting request");
-			Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $subject , $message );
+	$user = $object->get_user;
+	$lang = Vhffs::Panel::User::get_lang( $user );
+	setlocale( LC_ALL , $lang ) if( defined $lang );
+	if( defined $user ) {
+		$message  = sprintf( gettext("Your web hosting request for the servername : %s ") , $object->get_servername);
+		$message .= gettext("has been refused by the Moderators team")."\n";
+		$message .= gettext("In hope to keep you in our hosting service")."\n\n";
+		if( length( $object->get_description ) > 1 ) {
+		    $message .= gettext("Reason given : ");
+		    $message .= $object->get_description . "\n";
 		}
-		
-		$object->delete;
+		$message .= sprintf( gettext("If you encounters problem, please mail: %s\n") , $vhffs->get_config->get_moderator_mail ) if( defined $vhffs->get_config->get_moderator_mail );
+		$message .= gettext("Cheers,")."\n";
+		$message .= gettext("The Moderator and Admin team");
+
+		$subject = gettext("Your hosting request");
+		Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $subject , $message );
 	}
+		
+	$object->delete;
 }
 
 


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