[vhffs-dev] [1414] Fix bug #0000260 and correct consistency between template and code when no catchall_type is defined

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


Revision: 1414
Author:   beuss
Date:     2009-05-28 14:48:34 +0200 (Thu, 28 May 2009)

Log Message:
-----------
Fix bug #0000260 and correct consistency between template and code when no catchall_type is defined

Modified Paths:
--------------
    trunk/vhffs-panel/mail/prefs.pl
    trunk/vhffs-panel/templates/mail/prefs.tmpl


Modified: trunk/vhffs-panel/mail/prefs.pl
===================================================================
--- trunk/vhffs-panel/mail/prefs.pl	2009-05-28 06:00:01 UTC (rev 1413)
+++ trunk/vhffs-panel/mail/prefs.pl	2009-05-28 12:48:34 UTC (rev 1414)
@@ -76,7 +76,7 @@
 	$template->param( MESSAGE => gettext( 'You\'re not allowed to do this, object is not in active state or you don\'t have enough ACL rights' ) );
 } else {
     my $catchall_type = lc($mail_config->{allowed_catchall});
-    $catchall_type = 'domain' unless(defined $catchall_type);
+    $catchall_type = 'domain' unless(defined $catchall_type and $catchall_type ne '');
 
     if( defined $cgi->param('modify_catchall_submit') ) {
         update_catchall($catchall_type);
@@ -184,8 +184,8 @@
             $panel->add_error( gettext('CGI Error !') );
         } else {
             if($type eq 'domain' && $catchall ne '') {
-                if( ! $mail->exists_box($catchall) ) {
-                    $panel->add_error( gettext('Selected mailbox doesn\'t exist for this mail domain') );
+                if( ! $mail->exists_box($catchall) || $mail->get_box_status($catchall) != Vhffs::Constants::ACTIVATED) {
+                    $panel->add_error( gettext('Selected mailbox doesn\'t exist for this mail domain or is not yet active.') );
                     return;
                 }
                 $catchall .= "\@$domain";

Modified: trunk/vhffs-panel/templates/mail/prefs.tmpl
===================================================================
--- trunk/vhffs-panel/templates/mail/prefs.tmpl	2009-05-28 06:00:01 UTC (rev 1413)
+++ trunk/vhffs-panel/templates/mail/prefs.tmpl	2009-05-28 12:48:34 UTC (rev 1414)
@@ -14,7 +14,9 @@
         <select name="catchall" id="catchall">
             <option value="">---</option>
         <TMPL_LOOP NAME="boxes">
-            <option <TMPL_IF EXPR="VALUE_CATCHALL eq (sprintf('%s@%s', LOCAL_PART, DOMAIN))">selected="selected"</TMPL_IF> value="<TMPL_VAR ESCAPE=1 NAME="LOCAL_PART">"><TMPL_VAR ESCAPE=1 NAME="LOCAL_PART">@<TMPL_VAR ESCAPE=1 NAME="DOMAIN"></option>
+	    <TMPL_IF NAME="ACTIVE">
+	            <option <TMPL_IF EXPR="VALUE_CATCHALL eq (sprintf('%s@%s', LOCAL_PART, DOMAIN))">selected="selected"</TMPL_IF> value="<TMPL_VAR ESCAPE=1 NAME="LOCAL_PART">"><TMPL_VAR ESCAPE=1 NAME="LOCAL_PART">@<TMPL_VAR ESCAPE=1 NAME="DOMAIN"></option>
+	    </TMPL_IF>
         </TMPL_LOOP>
         </select>
         </TMPL_IF>


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