diff options
Diffstat (limited to 'httemplate/view/svc_domain')
-rw-r--r-- | httemplate/view/svc_domain/acct_defaults.html | 149 | ||||
-rw-r--r-- | httemplate/view/svc_domain/basics.html | 151 | ||||
-rw-r--r-- | httemplate/view/svc_domain/dns.html | 136 |
3 files changed, 436 insertions, 0 deletions
diff --git a/httemplate/view/svc_domain/acct_defaults.html b/httemplate/view/svc_domain/acct_defaults.html new file mode 100644 index 000000000..b5612827b --- /dev/null +++ b/httemplate/view/svc_domain/acct_defaults.html @@ -0,0 +1,149 @@ +% if ( $communigate ) { + + Account defaults + <% &ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %> + +%# settings + + <% include('/view/elements/tr.html', + label=>'Password modification', + value=>$svc_domain->acct_def_password_selfchange ? 'YES' : 'NO', + ) + %> + + <% include('/view/elements/tr.html', + label=>'Password recovery', + value=>$svc_domain->acct_def_password_recover ? 'YES' : 'NO', + ) + %> + + <% include('/view/elements/tr.html', + label=>'Enabled services', + value=>$svc_domain->acct_def_cgp_accessmodes, + ) + %> + + <% include('/view/elements/tr.html', + label=>'Mail storage limit', + value=>$svc_domain->acct_def_quota, + ) + %> + + <% include('/view/elements/tr.html', + label=>'File storage limit', + value=>$svc_domain->acct_def_file_quota, + ) + %> + + <% include('/view/elements/tr.html', + label=>'Files limit', + value=>$svc_domain->acct_def_file_maxnum, + ) + %> + + <% include('/view/elements/tr.html', + label=>'File size limit', + value=>$svc_domain->acct_def_file_maxsize, + ) + %> + + <% include('/view/elements/tr.html', + label=>'Allowed mail rules', + value=>$svc_domain->acct_def_cgp_rulesallowed || 'default (No)', + ) + %> + + <% include('/view/elements/tr.html', + label=>'RPOP modifications', + value=>$svc_domain->acct_def_cgp_rpopallowed ? 'YES' : 'NO', + ) + %> + + <% include('/view/elements/tr.html', + label=>'Accepts mail to "all"', + value=>$svc_domain->acct_def_cgp_mailtoall ? 'YES' : 'NO', + ) + %> + + <% include('/view/elements/tr.html', + label=>'Add trailer to sent mail', + value=>$svc_domain->acct_def_cgp_addmailtrailer ? 'YES' : 'NO', + ) + %> + +% my $archive_after = $svc_domain->acct_def_cgp_archiveafter; +% $archive_after = +% $archive_after +% ? ( $archive_after / 86400 ). ' days' +% : ( $archive_after eq '0' ? 'Never' : 'default (730 days)' ); + <% include('/view/elements/tr.html', label=>'Archive messages after', + value=>$archive_after, ) %> + +%# preferences + + <% include('/view/elements/tr.html', + label=>'Message delete method', + value=>$svc_domain->acct_def_cgp_deletemode, + ) + %> + + <% include('/view/elements/tr.html', + label=>'On logout remove trash', + value=>$svc_domain->acct_def_cgp_emptytrash, + ) + %> + + <% include('/view/elements/tr.html', + label=>'Language', + value=>$svc_domain->acct_def_cgp_language || 'default (English)' + ) + %> + + <% include('/view/elements/tr.html', + label=>'Time zone', + value=>$svc_domain->acct_def_cgp_timezone || 'default (HostOS)' + ) + %> + + <% include('/view/elements/tr.html', + label=>'Layout', + value=>$svc_domain->acct_def_cgp_skinname || 'default (***)' + ) + %> + + <% include('/view/elements/tr.html', + label=>'Pronto style', + value=>$svc_domain->acct_def_cgp_prontoskinname + ) + %> + + <% include('/view/elements/tr.html', + label=>'Send read receipts', + value=>$svc_domain->acct_def_cgp_sendmdnmode + ) + %> + +%# mail +%#XXX rules, archive rule, spam foldering rule(s) + + </TABLE></TD></TR></TABLE> + +% } +<%init> + +my($svc_domain, %opt) = @_; + +my $part_svc = $opt{'part_svc'}; + +my $communigate = scalar($part_svc->part_export('communigate_pro')); + # || scalar($part_svc->part_export('communigate_pro_singledomain')); + +my %rulesallowed = ( + -1 => 'default (No)', #No always the default? + 0 => 'No', + 1 => 'Filter Only', + 2 => 'All But Exec', + 3 => 'Any', +); + +</%init> diff --git a/httemplate/view/svc_domain/basics.html b/httemplate/view/svc_domain/basics.html new file mode 100644 index 000000000..1915719a0 --- /dev/null +++ b/httemplate/view/svc_domain/basics.html @@ -0,0 +1,151 @@ +Service #<B><% $svcnum %></B> +% #if ( $conf->exists('svc_domain-edit_domain') ) { + | <A HREF="<%$p%>edit/svc_domain.cgi?<%$svcnum%>">Edit this domain</A> +% #} + +<% &ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %> + +<TR> + <TD ALIGN="right">Service</TD> + <TD BGCOLOR="#ffffff"><% $part_svc->svc %></TD> +</TR> + +<TR> + <TD ALIGN="right">Domain</TD> + <TD BGCOLOR="#ffffff"> + <B><% $domain %></B> + <A HREF="<% ${p} %>misc/whois.cgi?custnum=<%$custnum%>;svcnum=<%$svcnum%>;domain=<%$domain%>">(view whois information)</A> + </TD> +</TR> + +% if ($export) { + <TR> + <TD ALIGN="right">Registration status</TD> + <TD BGCOLOR="#ffffff"><B><% $status %></B> + +% if ( $FS::CurrentUser::CurrentUser->access_right('Manage domain registration') ) { +% if ( defined($ops{'register'}) ) { + <A HREF="<% ${p} %>edit/process/domreg.cgi?op=register&svcnum=<% $svcnum %>">Register at <% $registrar->{'name'} %></A> +% } +% if ( defined($ops{'transfer'}) ) { + <A HREF="<% ${p} %>edit/process/domreg.cgi?op=transfer&svcnum=<% $svcnum %>">Transfer to <% $registrar->{'name'} %></A> +% } +% if ( defined($ops{'renew'}) ) { + <A HREF="<% ${p} %>edit/process/domreg.cgi?op=renew&svcnum=<% $svcnum %>&period=1">Renew at <% $registrar->{'name'} %></A> +% } +% if ( defined($ops{'revoke'}) ) { + <A HREF="<% ${p} %>edit/process/domreg.cgi?op=revoke&svcnum=<% $svcnum %>">Revoke</A> +% } +% } + + </TD> + </TR> +% } + +% if ( $communigate ) { + + <TR> + <TD ALIGN="right">Administrator domain</TD> + <TD BGCOLOR="#ffffff"> +% if ( $svc_domain->parent_svcnum ) { +% #XXX agent-virt aware the link + <A HREF="svc_domain.cgi?<% $svc_domain->parent_svcnum %>"><% $svc_domain->parent_svc_x->domain %></A> +% } else { + <I>(none)</I> +% } + </TD> + </TR> + + <TR> + <TD ALIGN="right">Aliases</TD> + <TD BGCOLOR="#ffffff"><% $svc_domain->cgp_aliases %></TD> + </TR> + +% } + +% if ( $communigate && $svc_domain->max_accounts ) { + <TR> + <TD ALIGN="right">Maximum number of Accounts</TD> + <TD BGCOLOR="#ffffff"><% $svc_domain->max_accounts %></TD> + </TR> +% } + +<TR> + <TD ALIGN="right">Catch all email</TD> + <TD BGCOLOR="#ffffff"><% $email ? "<B>$email</B>" : '<I>(none)</I>' %> +% if ( $FS::CurrentUser::CurrentUser->access_right('Edit domain catchall') ) { + <A HREF="<% ${p} %>misc/catchall.cgi?<% $svcnum %>">(change)</A> +% } + </TD> +</TR> + +% if ( $svc_domain->cgp_accessmodes ) { + <TR> + <TD ALIGN="right">Enabled services</TD> + <TD BGCOLOR="#ffffff"><% $svc_domain->cgp_accessmodes %></TD> + </TR> +% } + +% if ( $svc_domain->trailer ) { + <TR> + <TD ALIGN="right">Mail trailer</TD> + <TD BGCOLOR="#ffffff"><PRE><% $svc_domain->trailer |h %></PRE></TD> + </TR> +% } + +% if ( $communigate ) { +% my $rule_url = $p. 'browse/cgp_rule.html?svcnum='. $svc_domain->svcnum; + <TR> + <TD ALIGN="right">Doimain mail rules</TD> + <TD BGCOLOR="#ffffff"><A HREF="<% $rule_url %>">View/Edit domain mail rules</A></TD> + </TR> +% } + +</TABLE></TD></TR></TABLE> + +<%init> + +my($svc_domain, %opt) = @_; +my $svcnum = $svc_domain->svcnum; +my $domain = $svc_domain->domain; +my $custnum = $opt{'custnum'}; +my $part_svc = $opt{'part_svc'}; + +my $communigate = scalar($part_svc->part_export('communigate_pro')); + # || scalar($part_svc->part_export('communigate_pro_singledomain')); + +my $email = ''; +if ($svc_domain->catchall) { + my $svc_acct = qsearchs('svc_acct',{'svcnum'=> $svc_domain->catchall } ); + die "Unknown svcpart" unless $svc_acct; + $email = $svc_acct->email; +} + +# Find the first export that does domain registration +my @exports = grep $_->can('registrar'), $part_svc->part_export; +my $export = $exports[0]; +# If we have a domain registration export, get the registrar object +my $registrar; +my $status = 'Unknown'; +my %ops = (); +if ($export) { + $registrar = $export->registrar; + my $domstat = $export->get_status( $svc_domain ); + if (defined($domstat->{'message'})) { + $status = $domstat->{'message'}; + } elsif (defined($domstat->{'unregistered'})) { + $status = 'Not registered'; + $ops{'register'} = "Register"; + } elsif (defined($domstat->{'status'})) { + $status = $domstat->{'status'} . ' ' . $domstat->{'contact_email'} . ' ' . $domstat->{'last_update_time'}; + } elsif (defined($domstat->{'expdate'})) { + $status = "Expires " . $domstat->{'expdate'}; + $ops{'renew'} = "Renew"; + $ops{'revoke'} = "Revoke"; + } else { + $status = $domstat->{'reason'}; + $ops{'transfer'} = "Transfer"; + } +} + +</%init> diff --git a/httemplate/view/svc_domain/dns.html b/httemplate/view/svc_domain/dns.html new file mode 100644 index 000000000..82cab068a --- /dev/null +++ b/httemplate/view/svc_domain/dns.html @@ -0,0 +1,136 @@ +<SCRIPT> + function areyousure(href, message) { + if ( confirm(message) == true ) + window.location.href = href; + } + function slave_areyousure() { + return confirm("Remove all records and slave from " + document.SlaveForm.recdata.value + "?"); + } +</SCRIPT> + +<div class="fscontainer"> +<div class="fsbox"> +<div class="fsbox-title"> + <span class="left">DNS Records</span> +</div> + +% my @records; if ( @records = $svc_domain->domain_record ) { + + <% include('/elements/table-grid.html') %> + +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor = $bgcolor2; + + <tr> + <th CLASS="grid" BGCOLOR="#cccccc">Zone</th> + <th CLASS="grid" BGCOLOR="#cccccc">Type</th> + <th CLASS="grid" BGCOLOR="#cccccc">Data</th> + <th CLASS="grid" BGCOLOR="#cccccc">TTL</th> + </tr> + +% foreach my $domain_record ( @records ) { +% my $type = $domain_record->rectype eq '_mstr' +% ? "(slave)" +% : $domain_record->recaf. ' '. $domain_record->rectype; + + + <tr> + <td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $domain_record->reczone %></td> + <td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $type %></td> + <td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $domain_record->recdata %></td> + <td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $domain_record->ttl %></td> + <td CLASS="grid" BGCOLOR="<% $bgcolor %>"> + +% unless ( $domain_record->rectype eq 'SOA' +% || ! $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice') +% ) { +% ( my $recdata = $domain_record->recdata ) =~ s/"/\\'\\'/g; + (<A HREF="<%$p%>edit/domain_record.html?<%$domain_record->recnum%>">edit</A>) + (<A HREF="javascript:areyousure('<%$p%>misc/delete-domain_record.cgi?<%$domain_record->recnum%>', 'Delete \'<% $domain_record->reczone %> <% $type %> <% $recdata %>\' ?' )">delete</A>) +% } + </td> + </tr> + + +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } + +% } + + </table> +% } else { + + <FORM METHOD="POST" NAME="DefaultForm" ACTION="<%$p%>edit/process/svc_domain-defaultrecords.cgi"> + <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>"> + <INPUT TYPE="submit" VALUE="Add default records"> + </FORM> + +% } + +% if ( $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice') ) { + <BR> + <FORM METHOD="POST" ACTION="<%$p%>edit/process/domain_record.cgi"> + <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>"> + <TABLE> + <TR> + <TD ALIGN="right" VALIGN="top"> + <INPUT TYPE="text" NAME="reczone"><BR> + <FONT SIZE="-1"><I>Zone</I></FONT> + </TD> + <TD ALIGN="right" VALIGN="top"> + <INPUT TYPE="hidden" NAME="recaf" VALUE="IN"> IN + </TD> + <TD ALIGN="right" VALIGN="top"> + <SELECT NAME="rectype"> +% foreach ( @{ FS::domain_record->rectypes } ) { + <OPTION VALUE="<%$_%>"><%$_%></OPTION> +% } + </SELECT><BR> + <FONT SIZE="-1"><I>Type</I></FONT> + </TD> + <TD ALIGN="right" VALIGN="top"> + <INPUT TYPE="text" NAME="recdata"><BR> + <FONT SIZE="-1"><I>Data</I></FONT> + </TD> + <TD ALIGN="right" VALIGN="top"> + <INPUT TYPE="text" NAME="ttl" size="6"><BR> + <FONT SIZE="-1"><I>TTL</I></FONT> + </TD> + <TD ALIGN="right" VALIGN="top"> + <INPUT TYPE="submit" VALUE="Add record"> + </TD> + </TR> + </TABLE> + </FORM> + + <BR> + <FORM NAME="SlaveForm" METHOD="POST" ACTION="<%$p%>edit/process/domain_record.cgi"> + <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>"> + Or +% if ( @records ) { + delete all records and +% } + slave from nameserver IP + <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>"> + <INPUT TYPE="hidden" NAME="reczone" VALUE="@"> + <INPUT TYPE="hidden" NAME="recaf" VALUE="IN"> + <INPUT TYPE="hidden" NAME="rectype" VALUE="_mstr"> + <INPUT TYPE="text" NAME="recdata"> + <INPUT TYPE="submit" VALUE="Slave domain" onClick="return slave_areyousure()"> + </FORM> + +% } + +</div> +</div> +<%init> + +my($svc_domain, %opt) = @_; +my $svcnum = $svc_domain->svcnum; + +</%init> + |