diff options
| author | ivan <ivan> | 2010-04-19 06:15:58 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2010-04-19 06:15:58 +0000 | 
| commit | 5beabbb6a5dfe410545ceab8b4ed0ddcb96fd9c8 (patch) | |
| tree | 1e7afcb7d7d755773b308ec8b62367d03614ec23 | |
| parent | 20f38e4c256094bd938b732950e8f93319f851a5 (diff) | |
communigate provisioning phase 2: Account:Settings: RulesAllowed, RPOPAllowed, MailToAll, AddMailTrailer.  RT#7514
| -rw-r--r-- | FS/FS/Schema.pm | 4 | ||||
| -rw-r--r-- | FS/FS/part_export/communigate_pro.pm | 27 | ||||
| -rw-r--r-- | FS/FS/svc_acct.pm | 4 | ||||
| -rw-r--r-- | FS/FS/svc_domain.pm | 2 | ||||
| -rwxr-xr-x | httemplate/edit/svc_acct.cgi | 42 | ||||
| -rw-r--r-- | httemplate/view/svc_acct/basics.html | 20 | 
6 files changed, 92 insertions, 7 deletions
| diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index d73b28228..a9fde2f91 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1670,6 +1670,10 @@ sub tables_hashref {          'cgp_aliases',     'varchar', 'NULL',     255, '', '',          'cgp_deletemode',  'varchar', 'NULL', $char_d, '', '', #DeleteMode          'cgp_emptytrash',  'varchar', 'NULL', $char_d, '', '', #EmptyTrash +        'cgp_rulesallowed','varchar', 'NULL', $char_d, '', '', #RulesAllowed +        'cgp_rpopallowed',    'char', 'NULL',       1, '', '', #RPOPAllowed +        'cgp_mailtoall',      'char', 'NULL',       1, '', '', #MailToAll +        'cgp_addmailtrailer', 'char', 'NULL',       1, '', '', #AddMailTrailer        ],        'primary_key' => 'svcnum',        #'unique' => [ [ 'username', 'domsvc' ] ], diff --git a/FS/FS/part_export/communigate_pro.pm b/FS/FS/part_export/communigate_pro.pm index 9ea840174..b94eaf66d 100644 --- a/FS/FS/part_export/communigate_pro.pm +++ b/FS/FS/part_export/communigate_pro.pm @@ -77,12 +77,18 @@ sub _export_insert_svc_acct {                          ],      'RealName'       => $svc_acct->finger,      'Password'       => $svc_acct->_password, + +    #phase 2: allowed mail rules, RPOP modifications, accepts mail to all, add trailer to sent mail +    'RulesAllowed'     => $svc_acct->cgp_rulesallowed, +    'RPOPAllowed'      =>($svc_acct->cgp_rpopallowed    ?'YES':'NO'), +    'MailToAll'        =>($svc_acct->cgp_mailtoall      ?'YES':'NO'), +    'AddMailTrailer'   =>($svc_acct->cgp_addmailtrailer ?'YES':'NO'), +      map { $quotas{$_} => $svc_acct->$_() }          grep $svc_acct->$_(), keys %quotas    ); -  #phase 2: pwdallowed, passwordrecovery, allowed mail rules, -  # RPOP modifications, accepts mail to all, add trailer to sent mail -  #phase 3: archive messages, mailing lists +  #XXX phase 2: pwdallowed, passwordrecovery +  #XXX phase 3: archive messages, mailing lists    my @options = ( 'CreateAccount',      'accountName'    => $self->export_username($svc_acct), @@ -274,9 +280,18 @@ sub _export_replace_svc_acct {      if $old->cgp_accessmodes ne $new->cgp_accessmodes      || $old->cgp_type ne $new->cgp_type; -  #phase 2: pwdallowed, passwordrecovery, allowed mail rules, -  # RPOP modifications, accepts mail to all, add trailer to sent mail -  #phase 3: archive messages, mailing lists +  #phase 2: allowed mail rules, RPOP modifications, accepts mail to all, add trailer to sent mail +  $settings{'RulesAllowed'} = $new->cgp_rulesallowed +    if $old->cgp_rulesallowed ne $new->cgp_rulesallowed; +  $settings{'RPOPAllowed'} = $new->cgp_rpopallowed +    if $old->cgp_rpopallowed ne $new->cgp_rpopallowed; +  $settings{'MailToAll'} = $new->cgp_mailtoall +    if $old->cgp_mailtoall ne $new->cgp_mailtoall; +  $settings{'AddMailTrailer'} = $new->cgp_addmailtrailer +    if $old->cgp_addmailtrailer ne $new->cgp_addmailtrailer; + +  #XXX phase 2: pwdallowed, passwordrecovery +  #XXX phase 3: archive messages, mailing lists    if ( keys %settings ) {      my $error = $self->communigate_pro_queue( diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index fbf47072d..6e7fb91df 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -1113,6 +1113,10 @@ sub check {                || $self->ut_textn('cgp_aliases' ) #well                || $self->ut_alphasn('cgp_deletemode')                || $self->ut_alphan('cgp_emptytrash') +              || $self->ut_alphasn('cgp_rulesallowed') +              || $self->ut_enum('cgp_rpopallowed', [ '', 'Y' ]) +              || $self->ut_enum('cgp_mailtoall', [ '', 'Y' ]) +              || $self->ut_enum('cgp_addmailtrailer', [ '', 'Y' ])    ;    return $error if $error; diff --git a/FS/FS/svc_domain.pm b/FS/FS/svc_domain.pm index f8c6615a5..5a593bb05 100644 --- a/FS/FS/svc_domain.pm +++ b/FS/FS/svc_domain.pm @@ -430,7 +430,7 @@ sub check {                || $self->ut_alphan('acct_def_maxsize')                || $self->ut_alphasn('acct_def_cgp_deletemode')                || $self->ut_alphan('acct_def_cgp_emptytrash') -              || $self->ut_textn('acct_def_cgp_rulesallowed') +              || $self->ut_alphasn('acct_def_cgp_rulesallowed')                || $self->ut_enum('acct_def_cgp_rpopallowed', [ '', 'Y' ])                || $self->ut_enum('acct_def_cgp_mailtoall', [ '', 'Y' ])                || $self->ut_enum('acct_def_cgp_addmailtrailer', [ '', 'Y' ]) diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi index 9c21c44bc..04c442a30 100755 --- a/httemplate/edit/svc_acct.cgi +++ b/httemplate/edit/svc_acct.cgi @@ -260,6 +260,8 @@ Service # <% $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR>  %      && $part_svc->part_svc_column('cgp_type')->columnflag ne 'F' )  % { +% # settings +    <TR>      <TD ALIGN="right">Mailbox type</TD>      <TD> @@ -331,6 +333,43 @@ Service # <% $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR>  % if ( $communigate ) { +%  #preferences + +  <% include('/elements/tr-select.html', +               'label'      => 'Allowed mail rules', +               'field'      => 'cgp_rulesallowed', +               'options'    => [ '', 'No', 'Filter Only', 'All But Exec', 'Any' ], +               'labels'     => { +                                 '' => 'default (No)', #No always the default? +                               }, +               'curr_value' => $svc_acct->cgp_rulesallowed, +            ) +  %> + +  <% include('/elements/tr-checkbox.html', +               'label'      => 'RPOP modifications', +               'field'      => 'cgp_rpopallowed', +               'curr_value' => $svc_acct->cgp_rpopallowed, +               'value'      => 'Y', +            ) +  %> + +  <% include('/elements/tr-checkbox.html', +               'label'      => 'Accepts mail to "all"', +               'field'      => 'cgp_mailtoall', +               'curr_value' => $svc_acct->cgp_mailtoall, +               'value'      => 'Y', +            ) +  %> + +  <% include('/elements/tr-checkbox.html', +               'label'      => 'Add trailer to sent mail', +               'field'      => 'cgp_addmailtrailer', +               'curr_value' => $svc_acct->cgp_addmailtrailer, +               'value'      => 'Y', +            ) +  %> +  %# false laziness w/svc_domain acct_def    <TR>      <TD ALIGN="right">Message delete method</TD> @@ -350,6 +389,9 @@ Service # <% $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR>      <TD><INPUT TYPE="text" NAME="cgp_emptytrash" VALUE="<% $svc_acct->cgp_emptytrash %>"></TD>    </TR> +%#XXX language, time zone, layout, printo style, send read receipts +%#XXX vacation message, redirect all mail, mail rules +  % } else {    <INPUT TYPE="hidden" NAME="cgp_deletemode" VALUE="<% $svc_acct->cgp_deletemode %>"> diff --git a/httemplate/view/svc_acct/basics.html b/httemplate/view/svc_acct/basics.html index 92b9ad7fe..9fc94488a 100644 --- a/httemplate/view/svc_acct/basics.html +++ b/httemplate/view/svc_acct/basics.html @@ -68,6 +68,8 @@  % } elsif ( $opt{'communigate'} ) { +%# settings +    <% include('/view/elements/tr.html', label=>'Mailbox type', value=>$svc_acct->cgp_type) %>    <% include('/view/elements/tr.html', label=>'Enabled services', @@ -85,12 +87,30 @@    <% include('/view/elements/tr.html', label=>'File size limit',                          value=>$svc_acct->file_maxsize ) %> +%#XXX password recovery + +  <% include('/view/elements/tr.html', label=>'Allowed mail rules', +                        value=>$svc_acct->cgp_rulesallowed || 'default (No)') %> + +  <% include('/view/elements/tr.html', label=>'RPOP modifications', +                        value=>$svc_acct->cgp_rpopallowed ? 'YES' : 'NO' ) %> + +  <% include('/view/elements/tr.html', label=>'Accepts mail to "all"', +                        value=>$svc_acct->cgp_mailtoall ? 'YES' : 'NO' ) %> + +  <% include('/view/elements/tr.html', label=>'Add trailer to sent mail', +                        value=>$svc_acct->cgp_addmailtrailer ? 'YES' : 'NO' ) %> + +%# preferences +    <% include('/view/elements/tr.html', label=>'Message delete method',                          value=>$svc_acct->cgp_deletemode ) %>    <% include('/view/elements/tr.html', label=>'On logout remove trash',                          value=>$svc_acct->cgp_emptytrash ) %> +%#XXX language, time zone, layout, printo style, send read receipts +%#XXX vacation message, redirect all mail, mail rules  % } | 
