[vhffs-dev] [846] bye Conf::use_nospam and Conf::use_novirus |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 846
Author: gradator
Date: 2007-08-31 00:38:32 +0000 (Fri, 31 Aug 2007)
Log Message:
-----------
bye Conf::use_nospam and Conf::use_novirus
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Conf.pm
trunk/vhffs-api/src/Vhffs/Services/Mail.pm
trunk/vhffs-panel/mail/prefs.pl
trunk/vhffs-panel/mail/spambox.pl
trunk/vhffs-panel/mail/spamvirus.pl
trunk/vhffs-panel/user/prefs.pl
Modified: trunk/vhffs-api/src/Vhffs/Conf.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Conf.pm 2007-08-30 23:55:46 UTC (rev 845)
+++ trunk/vhffs-api/src/Vhffs/Conf.pm 2007-08-31 00:38:32 UTC (rev 846)
@@ -249,23 +249,6 @@
}
-sub use_nospam
-{
- return -1 if( ! defined $Config{"services"}{"mail"} );
- return -1 if( ! defined $Config{"services"}{"mail"}{'use_nospam'} );
- return 1 if( $Config{"services"}{"mail"}{'use_nospam'} eq "yes");
- return 0;
-}
-
-sub use_novirus
-{
- return -1 if( ! defined $Config{"services"}{"mail"} );
- return -1 if( ! defined $Config{"services"}{"mail"}{'use_novirus'} );
- return 1 if( $Config{"services"}{"mail"}{'use_novirus'} eq "yes");
- return 0;
-}
-
-
sub get_moderation
{
if( ( defined $Config{"global"}{"moderation"} ) && ( $Config{"global"}{"moderation"} eq 'yes' ) )
Modified: trunk/vhffs-api/src/Vhffs/Services/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mail.pm 2007-08-30 23:55:46 UTC (rev 845)
+++ trunk/vhffs-api/src/Vhffs/Services/Mail.pm 2007-08-31 00:38:32 UTC (rev 846)
@@ -415,7 +415,7 @@
###########################
# ospam function only use when the mail domain
# if fetched
-# It can explain if a box ue antispam or not
+# It can explain if a box use antispam or not
# for example $mail->use_nospam( 'myaccount' );
# returns -1 if error
# 0 if nospam is used
Modified: trunk/vhffs-panel/mail/prefs.pl
===================================================================
--- trunk/vhffs-panel/mail/prefs.pl 2007-08-30 23:55:46 UTC (rev 845)
+++ trunk/vhffs-panel/mail/prefs.pl 2007-08-31 00:38:32 UTC (rev 846)
@@ -156,7 +156,7 @@
- if( $vhffs->get_config->use_nospam == 1 )
+ if( $vhffs->get_config->get_service('mail')->{'use_nospam'} eq 'yes' )
{
$subtemplate2 = new HTML::Template( filename => $templatedir."/panel/mail/prefs_spam.tmpl" );
$subtemplate2->param( LOCALPART => $_ );
@@ -175,7 +175,7 @@
- if( $vhffs->get_config->use_novirus == 1 )
+ if( $vhffs->get_config->get_service('mail')->{'use_novirus'} eq 'yes' )
{
$subtemplate2 = new HTML::Template( filename => $templatedir."/panel/mail/prefs_virus.tmpl" );
$subtemplate2->param( LOCALPART => $_ );
Modified: trunk/vhffs-panel/mail/spambox.pl
===================================================================
--- trunk/vhffs-panel/mail/spambox.pl 2007-08-30 23:55:46 UTC (rev 845)
+++ trunk/vhffs-panel/mail/spambox.pl 2007-08-31 00:38:32 UTC (rev 846)
@@ -47,10 +47,9 @@
use Vhffs::Services::Mail;
use Vhffs::Acl;
use Vhffs::Constants;
+
my $panel = new Vhffs::Panel::Main();
-if(!$panel) {
- exit 0;
-}
+exit 0 unless defined $panel;
my $vhffs = $panel->{'vhffs'};
my $session = $panel->{'session'};
@@ -95,7 +94,7 @@
$message = gettext("You're not allowed to do this (ACL rights)");
$template->param( MESSAGE => $message );
}
-elsif( $vhffs->get_config->use_nospam != 1 )
+elsif( $vhffs->get_config->get_service('mail')->{'use_nospam'} ne 'yes' )
{
$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
$message = gettext("Spam protection is not allowed");
Modified: trunk/vhffs-panel/mail/spamvirus.pl
===================================================================
--- trunk/vhffs-panel/mail/spamvirus.pl 2007-08-30 23:55:46 UTC (rev 845)
+++ trunk/vhffs-panel/mail/spamvirus.pl 2007-08-31 00:38:32 UTC (rev 846)
@@ -95,7 +95,7 @@
$message = gettext("You're not allowed to do this (ACL rights)");
$template->param( MESSAGE => $message );
}
-elsif( $vhffs->get_config->use_novirus != 1 )
+elsif( $vhffs->get_config->get_service('mail')->{'use_novirus'} ne 'yes' )
{
$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
$message = gettext("Virus protection is not allowed");
Modified: trunk/vhffs-panel/user/prefs.pl
===================================================================
--- trunk/vhffs-panel/user/prefs.pl 2007-08-30 23:55:46 UTC (rev 845)
+++ trunk/vhffs-panel/user/prefs.pl 2007-08-31 00:38:32 UTC (rev 846)
@@ -195,7 +195,7 @@
}
# We change the spam status. if the spam status changed
- if( $vhffs->get_config->use_nospam == 1 ) {
+ if( $vhffs->get_config->get_service('mail')->{'use_nospam'} eq 'yes' ) {
if( $nospam != $mu->use_nospam ) {
if( $mu->change_spam_status == 1 ) {
$panel->add_info( gettext( "Change spam protection status for your account\n" ) );
@@ -206,7 +206,7 @@
}
# As spam, the virus status changes only if the user changed values
- if( $vhffs->get_config->use_novirus == 1 ) {
+ if( $vhffs->get_config->get_service('mail')->{'use_novirus'} eq 'yes' ) {
if( $novirus != $mu->use_novirus ) {
if( $mu->change_virus_status == 1 ) {
$panel->add_info( gettext( "Changed anti-virus status for your account\n" ) );
@@ -386,7 +386,7 @@
$template->param( HELP_URL => $url );
}
- if( $vhffs->get_config->use_nospam == 1 )
+ if( $vhffs->get_config->get_service('mail')->{'use_nospam'} eq 'yes' )
{
$subtemplate2 = new HTML::Template( filename => $templatedir."/panel/user/mailuserspam.tmpl" );
$subtemplate2->param( TEXT_NOSPAM => gettext("Use anti-spam protection") );
@@ -394,7 +394,7 @@
$tmp .= $subtemplate2->output;
}
- if( $vhffs->get_config->use_novirus == 1 )
+ if( $vhffs->get_config->get_service('mail')->{'use_novirus'} eq 'yes' )
{
$subtemplate2 = new HTML::Template( filename => $templatedir."/panel/user/mailuservirus.tmpl" );
$subtemplate2->param( TEXT_VIRUS => gettext("Use anti-virus protection") );