[vhffs-dev] [svn] commit: r278 - /trunk/vhffs-irc/modobot.pl

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


Author: gradator
Date: Thu Nov  2 01:27:44 2006
New Revision: 278

Log:
Add moderation for download repositories

Modified:
    trunk/vhffs-irc/modobot.pl

Modified: trunk/vhffs-irc/modobot.pl
==============================================================================
--- trunk/vhffs-irc/modobot.pl (original)
+++ trunk/vhffs-irc/modobot.pl Thu Nov  2 01:27:44 2006
@@ -49,6 +49,7 @@
 my @oldmail = ();
 my @oldmysql = ();
 my @oldpostgres = ();
+my @oldrepository = ();
 
 my $irc=new Net::IRC;
 
@@ -323,6 +324,34 @@
         else
         {
             @oldpostgres = ();
+        }
+    }
+
+    if( $vhffs->get_config->use_repository == 1 )
+    {
+        #Treat Repository to moderate
+        use Vhffs::Services::Repository;
+        my $repos = Vhffs::Services::Repository::getall( $vhffs , Vhffs::Constants::WAITING_FOR_VALIDATION );
+
+        if( defined $repos )
+        {
+RP:         foreach $temp ( @{$repos} )
+            {
+	        map { last RP if (($_->get_oid eq $temp->get_oid) && ($_->get_name eq $temp->get_name)); } @oldrepository;
+                if( $vhffs->get_config->use_notation == 1 )
+                {
+                    irc_msg ("REPOSITORY :         " . $temp->get_oid . "    " . $temp->get_user->get_username . "(" .  Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ")    " . $temp->get_group->get_groupname . "    " . $temp->get_name . "    " . Vhffs::Functions::stripslashes($temp->get_description));
+                }
+                else
+                {
+                    irc_msg ("REPOSITORY :          " . $temp->get_oid . "    " . $temp->get_user->get_username . "    " . $temp->get_group->get_groupname . "    " . $temp->get_name . "    " . Vhffs::Functions::stripslashes($temp->get_description));
+                }
+            }
+            @oldrepository = @{$repos};
+        }
+        else
+        {
+            @oldrepository = ();
         }
     }
 
@@ -533,6 +562,7 @@
         @oldmail = ();
         @oldmysql = ();
         @oldpostgres = ();
+	@oldrepository = ();
 		list_moderation();
     }
     elsif ($texte =~ m/^${mynick}: desc [a-z0-9]+$/)




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