[vhffs-dev] [914] I have a dream that one day vhffs' refuse robots will be deleted...

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


Revision: 914
Author:   gradator
Date:     2007-09-11 09:51:51 +0000 (Tue, 11 Sep 2007)

Log Message:
-----------
I have a dream that one day vhffs' refuse robots will be deleted... oh wait... this is now the case !

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Object.pm
    trunk/vhffs-robots/Makefile.am

Added Paths:
-----------
    trunk/vhffs-robots/src/object_cleanup.pl

Removed Paths:
-------------
    trunk/vhffs-robots/src/cvs_refused.pl
    trunk/vhffs-robots/src/dns_refused.pl
    trunk/vhffs-robots/src/group_refused.pl
    trunk/vhffs-robots/src/mail_refused.pl
    trunk/vhffs-robots/src/mailinglist_refused.pl
    trunk/vhffs-robots/src/mysql_refused.pl
    trunk/vhffs-robots/src/pgsql_refused.pl
    trunk/vhffs-robots/src/repository_refused.pl
    trunk/vhffs-robots/src/svn_refused.pl
    trunk/vhffs-robots/src/web_refused.pl


Modified: trunk/vhffs-api/src/Vhffs/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Object.pm	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-api/src/Vhffs/Object.pm	2007-09-11 09:51:51 UTC (rev 914)
@@ -489,6 +489,47 @@
 }
 
 
+# Delete this object with a notice mail
+sub delete_withmail
+{
+	my $self = shift;
+
+	my $vhffs = $self->{main};
+	my $user = $self->get_user;
+
+	# TODO: write a beautiful module for INTL
+	bindtextdomain('vhffs', $vhffs->get_config->get_intldir);
+	textdomain('vhffs');
+
+	my $prevlocale = setlocale( LC_ALL );
+	setlocale( LC_ALL , $user->get_lang );
+
+	my $mail = sprintf(
+		gettext( "Hello,\n\nYour %s (%s) on %s has been deleted.\n\nThis is because it have been refused a long time ago and you didn't\nsubmit an update since.\n\nFor reminder, the reason of refusal was:\n%s\n\nDon't be upset, submit it again if you forgot to update it in time.\nIf you need further information, just reply to this email !\n\nCheers,\nThe moderator team\n\n---------\n%s\n%s" ) ,
+
+		Vhffs::Functions::type_string_from_type_id( $self->get_type ),
+		$self->get_label,
+		$vhffs->get_config->get_host_name,
+		$self->get_refuse_reason,
+		$vhffs->get_config->get_host_name,
+		$vhffs->get_config->get_panel->{url}
+		);
+
+	my $subject = sprintf(
+		gettext('Your %s (%s) on %s has been deleted due to lack of updates'),
+		Vhffs::Functions::type_string_from_type_id( $self->get_type ),
+		$self->get_label,
+		$vhffs->get_config->get_host_name
+		);
+
+	Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $vhffs->get_config->get_mailtag , $subject , $mail );
+
+	setlocale( LC_ALL , $prevlocale );
+
+	$self->delete;
+}
+
+
 sub resubmit_for_moderation
 {
 	my $self = shift;
@@ -512,6 +553,7 @@
 	my $vhffs = shift;
 	my $name = shift;
 	my $state = shift;
+	my $age = shift; #arg for postgresql interval function
 
 	my $query = 'SELECT o.object_id, o.owner_uid, o.owner_gid, o.date_creation , o.description, o.refuse_reason, o.state, o.type FROM vhffs_object o';
 	my @params;
@@ -528,9 +570,24 @@
 	}
 	if( defined $state )
 	{
-		$query .= ' WHERE o.state = ?';
+		if( $query =~ /WHERE/ )  {
+			$query .= ' AND o.state = ?';
+		}
+		else {
+			$query .= ' WHERE o.state = ?';
+		}
 		push(@params, $state);
 	}
+	if( defined $age )
+	{
+		if( $query =~ /WHERE/ )  {
+			$query .= ' AND age(current_timestamp, date_creation) > CAST(? AS interval) ';
+		}
+		else {
+			$query .= ' WHERE age(current_timestamp, date_creation) > CAST(? AS interval) ';
+		}
+		push(@params, $age);
+	}
 
 	$query .= ' ORDER BY object_id';
 

Modified: trunk/vhffs-robots/Makefile.am
===================================================================
--- trunk/vhffs-robots/Makefile.am	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-robots/Makefile.am	2007-09-11 09:51:51 UTC (rev 914)
@@ -22,43 +22,35 @@
 	src/cvs_create.pl \
 	src/cvs_delete.pl \
 	src/cvs_fixperms.pl \
-	src/cvs_refused.pl \
 	src/dns_create.pl \
 	src/dns_delete.pl \
-	src/dns_refused.pl \
 	src/group_create.pl \
 	src/group_delete.pl \
 	src/group_getquota.pl \
-	src/group_refused.pl \
 	src/group_setquota.pl \
 	src/listengine_publicarchives.pl \
 	src/mail_create.pl \
 	src/mail_delete.pl \
 	src/mailinglist_create.pl \
 	src/mailinglist_delete.pl \
-	src/mailinglist_refused.pl \
 	src/mailing.pl \
-	src/mail_refused.pl \
 	src/mysql_create.pl \
 	src/mysql_delete.pl \
 	src/mysql_dump.pl \
 	src/mysql_modify.pl \
-	src/mysql_refused.pl \
+	src/object_cleanup.pl \
 	src/pgsql_create.pl \
 	src/pgsql_delete.pl \
 	src/pgsql_dump.pl \
 	src/pgsql_modify.pl \
-	src/pgsql_refused.pl \
 	src/repository_create.pl \
 	src/repository_delete.pl \
 	src/repository_getquota.pl \
-	src/repository_refused.pl \
 	src/repository_setquota.pl \
 	src/repository_stats.pl \
 	src/svn_create.pl \
 	src/svn_delete.pl \
 	src/svn_public.pl \
-	src/svn_refused.pl \
 	src/svn_viewvcconf.pl \
 	src/svn_websvn.pl \
 	src/user_create.pl \
@@ -68,7 +60,6 @@
 	src/user_getquota.pl \
 	src/web_create.pl \
 	src/web_delete.pl \
-	src/web_refused.pl \
 	src/web_stats.pl
 
 # Define the substitution we need to point perl script at correct location

Deleted: trunk/vhffs-robots/src/cvs_refused.pl
===================================================================
--- trunk/vhffs-robots/src/cvs_refused.pl	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-robots/src/cvs_refused.pl	2007-09-11 09:51:51 UTC (rev 914)
@@ -1,87 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use strict;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Services::Cvs;
-use Vhffs::Robots;
-use Vhffs::Robots::Cvs;
-use Vhffs::Panel::User;
-
-
-my $vhffs;
-my $user;
-my $message;
-my $subject;
-my $object;
-my $lang;
-my $objects;
-
-$vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "cvs" );
-
-$objects = Vhffs::Services::Cvs::getall( $vhffs , Vhffs::Constants::VALIDATION_REFUSED );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
-
-foreach $object ( @{$objects} )
-{
-	$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 , $vhffs->get_config->get_mailtag , $subject , $message );
-	}
-	
-	$object->delete;
-}
-
-Vhffs::Robots::unlock( $vhffs , "cvs" );
-exit 0;

Deleted: trunk/vhffs-robots/src/dns_refused.pl
===================================================================
--- trunk/vhffs-robots/src/dns_refused.pl	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-robots/src/dns_refused.pl	2007-09-11 09:51:51 UTC (rev 914)
@@ -1,92 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use strict;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::User;
-use Vhffs::Robots;
-use Vhffs::Group;
-use Vhffs::Services::DNS;
-use Vhffs::Panel::User;
-
-my $vhffs;
-my $user;
-my $message;
-my $subject;
-my $object;
-my $lang;
-my $objects;
-
-
-$vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "dns" );
-
-$objects = Vhffs::Services::DNS::getall( $vhffs , Vhffs::Constants::VALIDATION_REFUSED );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
-
-foreach $object ( @{$objects} )
-{
-	if( defined $object )
-	{
-		$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 DNS hosting request for the domain : %s ") , $object->get_domain );
-			$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 DNS hosting request");
-			Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $vhffs->get_config->get_mailtag , $subject , $message );
-		}
-		
-		$object->delete;
-	}
-}
-
-
-Vhffs::Robots::unlock( $vhffs , "dns" );
-exit 0;

Deleted: trunk/vhffs-robots/src/group_refused.pl
===================================================================
--- trunk/vhffs-robots/src/group_refused.pl	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-robots/src/group_refused.pl	2007-09-11 09:51:51 UTC (rev 914)
@@ -1,87 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use strict;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Robots;
-use Vhffs::Robots::Group;
-use Vhffs::Panel::User;
-
-
-my $vhffs;
-my $user;
-my $message;
-my $subject;
-my $object;
-my $lang;
-my $objects;
-
-$vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "usergroup" );
-
-$objects = Vhffs::Group::getall( $vhffs , Vhffs::Constants::VALIDATION_REFUSED );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
-
-foreach $object ( @{$objects} )
-{
-	$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 , $vhffs->get_config->get_mailtag , $subject , $message );
-	}
-		
-	$object->delete;
-}
-
-
-Vhffs::Robots::unlock( $vhffs , "usergroup" );
-exit 0;

Deleted: trunk/vhffs-robots/src/mail_refused.pl
===================================================================
--- trunk/vhffs-robots/src/mail_refused.pl	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-robots/src/mail_refused.pl	2007-09-11 09:51:51 UTC (rev 914)
@@ -1,92 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use strict;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Services::Mail;
-use Vhffs::Panel::User;
-use Vhffs::Robots;
-
-
-my $vhffs;
-my $user;
-my $message;
-my $subject;
-my $object;
-my $lang;
-my $objects;
-
-$vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "mail" );
-
-$objects = Vhffs::Services::Mail::getall( $vhffs , Vhffs::Constants::VALIDATION_REFUSED );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
-
-foreach $object ( @{$objects} )
-{
-	if( defined $object )
-	{
-		$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 Mail hosting request for the domain: %s ") , $object->get_domain);
-			$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 Mail hosting request");
-			Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $vhffs->get_config->get_mailtag , $subject , $message );
-		}
-		
-		$object->delete;
-	}
-}
-
-
-Vhffs::Robots::unlock( $vhffs , "mail" );
-exit 0;

Deleted: trunk/vhffs-robots/src/mailinglist_refused.pl
===================================================================
--- trunk/vhffs-robots/src/mailinglist_refused.pl	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-robots/src/mailinglist_refused.pl	2007-09-11 09:51:51 UTC (rev 914)
@@ -1,88 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use strict;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::Robots;
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Services::MailingList;
-use Vhffs::Panel::User;
-
-
-my $vhffs;
-my $user;
-my $message;
-my $subject;
-my $object;
-my $lang;
-my $objects;
-
-$vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "ml" );
-
-$objects = Vhffs::Services::MailingList::getall( $vhffs , Vhffs::Constants::VALIDATION_REFUSED );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
-
-foreach $object ( @{$objects} )
-{
-    $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 Mailing-list request : %s ") , $object->get_listname);
-        $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 Mailing-list request");
-        Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $vhffs->get_config->get_mailtag , $subject , $message );
-    }
-		
-	$object->delete;
-}
-
-
-Vhffs::Robots::unlock( $vhffs , "ml" );
-exit 0;

Deleted: trunk/vhffs-robots/src/mysql_refused.pl
===================================================================
--- trunk/vhffs-robots/src/mysql_refused.pl	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-robots/src/mysql_refused.pl	2007-09-11 09:51:51 UTC (rev 914)
@@ -1,64 +0,0 @@
-#!%PERL%
-
-use strict;
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Robots;
-use Vhffs::Services::Mysql;
-use Vhffs::Panel::User;
-
-
-my $vhffs;
-my $user;
-my $message;
-my $subject;
-my $object;
-my $lang;
-my $objects;
-
-$vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "mysql" );
-
-$objects = Vhffs::Services::Mysql::getall( $vhffs , Vhffs::Constants::VALIDATION_REFUSED );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
-
-foreach $object ( @{$objects} )
-{
-	if( defined $object )
-	{
-		$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 MySQL database request : %s ") , $object->get_dbname );
-			$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 MySQL database request");
-			Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $vhffs->get_config->get_mailtag , $subject , $message );
-		}
-		
-		$object->delete;
-	}
-}
-
-
-
-Vhffs::Robots::unlock( $vhffs , "mysql" );
-exit 0;

Added: trunk/vhffs-robots/src/object_cleanup.pl
===================================================================
--- trunk/vhffs-robots/src/object_cleanup.pl	                        (rev 0)
+++ trunk/vhffs-robots/src/object_cleanup.pl	2007-09-11 09:51:51 UTC (rev 914)
@@ -0,0 +1,55 @@
+#!%PERL%
+
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without 
+# modification, are permitted provided that the following conditions 
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright 
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in 
+#   the documentation and/or other materials provided with the 
+#   distribution.
+#3. Neither the name of vhffs nor the names of its contributors 
+#   may be used to endorse or promote products derived from this 
+#   software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+# POSSIBILITY OF SUCH DAMAGE.
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Main;
+use Vhffs::Robots;
+use Vhffs::Object;
+use Vhffs::ObjectFactory;
+use Vhffs::Constants;
+
+my $vhffs = init Vhffs::Main;
+exit 1 unless $vhffs;
+
+Vhffs::Robots::lock( $vhffs , 'object' );
+
+my $objects = Vhffs::Object::getall( $vhffs , undef, Vhffs::Constants::VALIDATION_REFUSED , '15 day' );
+foreach my $object ( @{$objects} )
+{
+	$object = Vhffs::ObjectFactory::fetch_object( $vhffs , $object->get_oid );
+	Vhffs::Robots::vhffs_log( sprintf( "deleted object %d because it waited too long in refused state" , $object->get_oid ) , $vhffs);
+	$object->delete_withmail;
+}
+
+Vhffs::Robots::unlock( $vhffs , 'object' );
+
+exit 0;


Property changes on: trunk/vhffs-robots/src/object_cleanup.pl
___________________________________________________________________
Name: svn:executable
   + *

Deleted: trunk/vhffs-robots/src/pgsql_refused.pl
===================================================================
--- trunk/vhffs-robots/src/pgsql_refused.pl	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-robots/src/pgsql_refused.pl	2007-09-11 09:51:51 UTC (rev 914)
@@ -1,94 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use strict;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Robots;
-use Vhffs::Services::Pgsql;
-use Vhffs::Panel::User;
-
-
-my $vhffs;
-my $user;
-my $message;
-my $subject;
-my $object;
-my $lang;
-my $objects;
-
-$vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "pgsql" );
-
-$objects = Vhffs::Services::Pgsql::getall( $vhffs , Vhffs::Constants::VALIDATION_REFUSED );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
-
-foreach $object ( @{$objects} )
-{
-    # useless !!! (?)
-	if( defined $object )
-	{
-		$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 PostgreSQL database request : %s ") , $object->get_dbname );
-			$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 PostgreSQL database request");
-			Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $vhffs->get_config->get_mailtag , $subject , $message );
-		}
-		
-		$object->delete;
-	}
-}
-
-
-Vhffs::Robots::unlock( $vhffs , "pgsql" );
-
-exit 0;

Deleted: trunk/vhffs-robots/src/repository_refused.pl
===================================================================
--- trunk/vhffs-robots/src/repository_refused.pl	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-robots/src/repository_refused.pl	2007-09-11 09:51:51 UTC (rev 914)
@@ -1,92 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use strict;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Services::Repository;
-use Vhffs::Robots;
-use Vhffs::Robots::Repository;
-use Vhffs::Panel::User;
-
-
-my $vhffs;
-my $user;
-my $message;
-my $subject;
-my $object;
-my $lang;
-my $objects;
-
-$vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "repository" );
-
-$objects = Vhffs::Services::Repository::getall( $vhffs , Vhffs::Constants::VALIDATION_REFUSED );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
-
-foreach $object ( @{$objects} )
-{
-	if( defined $object )
-	{
-		$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 Download repository request : %s ") , $object->get_name);
-			$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 Download repository request");
-			Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $vhffs->get_config->get_mailtag , $subject , $message );
-		}
-		
-		$object->delete;
-	}
-}
-
-Vhffs::Robots::unlock( $vhffs , "repository" );
-exit 0;

Deleted: trunk/vhffs-robots/src/svn_refused.pl
===================================================================
--- trunk/vhffs-robots/src/svn_refused.pl	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-robots/src/svn_refused.pl	2007-09-11 09:51:51 UTC (rev 914)
@@ -1,59 +0,0 @@
-#!%PERL%
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use strict;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Robots;
-use Vhffs::Services::Svn;
-use Vhffs::Panel::User;
-
-
-my $vhffs;
-my $user;
-my $message;
-my $subject;
-my $object;
-my $lang;
-my $objects;
-
-$vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "svn" );
-
-$objects = Vhffs::Services::Svn::getall( $vhffs , Vhffs::Constants::VALIDATION_REFUSED );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
-
-foreach $object ( @{$objects} )
-{
-	$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 Subversion repository request : %s") , $object->get_reponame);
-		$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 Subversion repository request");
-		Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $vhffs->get_config->get_mailtag , $subject , $message );
-	}
-	
-	$object->delete;
-}
-
-
-Vhffs::Robots::unlock( $vhffs , "svn" );
-
-exit 0;

Deleted: trunk/vhffs-robots/src/web_refused.pl
===================================================================
--- trunk/vhffs-robots/src/web_refused.pl	2007-09-11 08:09:17 UTC (rev 913)
+++ trunk/vhffs-robots/src/web_refused.pl	2007-09-11 09:51:51 UTC (rev 914)
@@ -1,87 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use strict;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Services::Web;
-use Vhffs::Panel::User;
-use Vhffs::Robots;
-
-
-my $vhffs;
-my $user;
-my $message;
-my $subject;
-my $object;
-my $lang;
-my $objects;
-
-$vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "web" );
-
-$objects = Vhffs::Services::Web::getall( $vhffs , Vhffs::Constants::VALIDATION_REFUSED );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
-
-foreach $object ( @{$objects} )
-{
-	$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 , $vhffs->get_config->get_mailtag , $subject , $message );
-	}
-		
-	$object->delete;
-}
-
-
-Vhffs::Robots::unlock( $vhffs , "web" );
-exit 0;


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