[vhffs-dev] [svn] commit: r104 - in /trunk: vhffs-api/src/Vhffs/Robots.pm vhffs-robots/src/create_ml.pl vhffs-robots/src/create_web.pl vhffs-robots/src/user_group.pl

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


Author: soda
Date: Fri Dec  9 18:34:16 2005
New Revision: 104

Log:
fix bugs


Modified:
    trunk/vhffs-api/src/Vhffs/Robots.pm
    trunk/vhffs-robots/src/create_ml.pl
    trunk/vhffs-robots/src/create_web.pl
    trunk/vhffs-robots/src/user_group.pl

Modified: trunk/vhffs-api/src/Vhffs/Robots.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/Robots.pm (original)
+++ trunk/vhffs-api/src/Vhffs/Robots.pm Fri Dec  9 18:34:16 2005
@@ -25,11 +25,11 @@
 sub vhffs_log
 {
 	my $sent = shift;
-	if( open( FILE , ">>".LOGFILE ) )
-	{
-		print FILE $sent."\n";
-		close FILE ;
-	}
+	open( FILE , ">>/var/log/vhffslog" ) or return -1
+	
+	print FILE $sent."\n";
+	close FILE ;
+
 }
 
 sub link_to_group

Modified: trunk/vhffs-robots/src/create_ml.pl
==============================================================================
--- trunk/vhffs-robots/src/create_ml.pl (original)
+++ trunk/vhffs-robots/src/create_ml.pl Fri Dec  9 18:34:16 2005
@@ -5,9 +5,12 @@
 use Vhffs::Constants;
 use Vhffs::Services::Mailing;
 
+Vhffs::Robots::lock;
+
 my $main = init Vhffs::Main;
 my $mls  = Vhffs::Services::Mailing::getall( $main , Vhffs::Constants::WAITING_FOR_CREATION );
 my $ml;
+
 
 foreach $ml ( @{$mls} )
 {
@@ -22,5 +25,7 @@
 	}
 }
 
+Vhffs::Robots::unlock;
+
 exit 0;
 

Modified: trunk/vhffs-robots/src/create_web.pl
==============================================================================
--- trunk/vhffs-robots/src/create_web.pl (original)
+++ trunk/vhffs-robots/src/create_web.pl Fri Dec  9 18:34:16 2005
@@ -26,3 +26,5 @@
 
 Vhffs::Robots::unlock();
 
+Vhffs::Robots::unlock();
+

Modified: trunk/vhffs-robots/src/user_group.pl
==============================================================================
--- trunk/vhffs-robots/src/user_group.pl (original)
+++ trunk/vhffs-robots/src/user_group.pl Fri Dec  9 18:34:16 2005
@@ -30,22 +30,22 @@
 		{
 			if( Vhffs::Robots::Group::add_user( $user , $group , $vhffs ) < 0 )
 			{
-				vhffs_log( "Error adding user %s to group %s" , $user->get_username , $group->get_groupname ));
+				vhffs_log( sprintf( "Error adding user %s to group %s" , $user->get_username , $group->get_groupname ));
 			}
 			else
 			{
-				vhffs_log( "Add user %s to group %s" , $user->get_username , $group->get_groupname ));
+				vhffs_log( sprintf( "Add user %s to group %s" , $user->get_username , $group->get_groupname ));
 			}
 			
 		}
 		else
 		{
-			vhffs_log( "Cannot get user %s" , $_ ));
+			vhffs_log( sprintf( "Cannot get user %s" , $_ ));
 		}
 	}
 	else
 	{
-		vhffs_log( "Cannot get user %s" , $_ ));
+		vhffs_log( sprintf( "Cannot get user %s" , $_ ));
 	}
 }
 }
@@ -56,6 +56,7 @@
 
 if( ! defined $joins )
 {
+	Vhffs::Robots::unlock;
 	exit( 1 );
 }
 
@@ -70,18 +71,18 @@
 
 		if( ( defined $user ) && ( $user->fetch > 0 ) )
 		{
-			vhffs_log( "Remove user %s from group %s" , $user->get_username , $group->get_groupname ));
+			vhffs_log( sprintf( "Remove user %s from group %s" , $user->get_username , $group->get_groupname ));
 			Vhffs::Robots::Group::del_user( $user , $group , $vhffs );
 			
 		}
 		else
 		{
-			vhffs_log( "Cannot get user %s" , $name ));
+			vhffs_log( sprintf( "Cannot get user %s" , $name ));
 		}
 	}
 	else
 	{
-		vhffs_log( "Cannot get group %s" , $_ ));
+		vhffs_log( sprintf( "Cannot get group %s" , $_ ));
 	}
 }
 




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