[vhffs-dev] [1981] users and groups are now archived upon deletion ( this archive_targz helper is very cool)

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


Revision: 1981
Author:   gradator
Date:     2012-01-31 00:56:07 +0100 (Tue, 31 Jan 2012)
Log Message:
-----------
users and groups are now archived upon deletion (this archive_targz helper is very cool)

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Robots/Group.pm
    trunk/vhffs-api/src/Vhffs/Robots/User.pm

Modified: trunk/vhffs-api/src/Vhffs/Robots/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Group.pm	2012-01-30 23:44:49 UTC (rev 1980)
+++ trunk/vhffs-api/src/Vhffs/Robots/Group.pm	2012-01-30 23:56:07 UTC (rev 1981)
@@ -67,6 +67,9 @@
 
 	return undef unless ( defined $main && defined $group );
 
+	my $dir = $group->get_dir;
+	Vhffs::Robots::archive_targz( $group, $dir );
+
 	my $user = Vhffs::User::get_by_uid( $main , $group->get_owner_uid );
 	my $hash = Vhffs::Functions::hash_groupname( $group->get_groupname , $main );	
 	if( -d $hash )

Modified: trunk/vhffs-api/src/Vhffs/Robots/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/User.pm	2012-01-30 23:44:49 UTC (rev 1980)
+++ trunk/vhffs-api/src/Vhffs/Robots/User.pm	2012-01-30 23:56:07 UTC (rev 1981)
@@ -63,10 +63,12 @@
 	if( defined $user )
 	{
 		$user->add_history( "Ok, robots takes now the destruction of this user" );
-		$homedir = $user->get_home;
+		$homedir = $user->get_home;	
 
 		if( $homedir && -d $homedir )
 		{
+			Vhffs::Robots::archive_targz( $user, $homedir );
+
 			$cmd = "rm -rf $homedir";
 			system( $cmd );
 		}


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