[vhffs-dev] [svn] commit: r172 - /trunk/vhffs-robots/src/fix_quota.pl

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


Author: jd
Date: Fri Mar 17 16:23:45 2006
New Revision: 172

Log:
add limited quota for groups waiting for moderation

Modified:
    trunk/vhffs-robots/src/fix_quota.pl

Modified: trunk/vhffs-robots/src/fix_quota.pl
==============================================================================
--- trunk/vhffs-robots/src/fix_quota.pl (original)
+++ trunk/vhffs-robots/src/fix_quota.pl Fri Mar 17 16:23:45 2006
@@ -35,6 +35,24 @@
 	}
 }
 
+$groups = Vhffs::Group::getall( $vhffs , Vhffs::Constants::WAITING_FOR_VALIDATION );
+
+foreach $group ( @{$groups} )
+{
+	if( $group->fetch > 0 )
+	{
+		$blocks = 1024;
+		$inodes = 1126400 / 100;
+		if( -x "/usr/sbin/setquota" )
+		{
+			$cmd = "/usr/sbin/setquota -g ".$group->get_gid ." ".$blocks." ".$blocks." ".$inodes." ".$inodes." -a ".$vhffs->get_config->get_datadir;
+			system( $cmd );
+			Vhffs::Robots::vhffs_log( sprintf( "Update quota for user group %s set %s" , $group->get_groupname , $group->get_quota ) );
+		}
+	}
+}
+
+
 Vhffs::Robots::unlock( $vhffs );
 
 exit 0;




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