diff options
Diffstat (limited to 'httemplate/edit')
| -rw-r--r-- | httemplate/edit/domain_record.html | 53 | ||||
| -rwxr-xr-x | httemplate/edit/process/domain_record.cgi | 17 | ||||
| -rw-r--r-- | httemplate/edit/process/svc_domain-defaultrecords.cgi | 6 |
3 files changed, 70 insertions, 6 deletions
diff --git a/httemplate/edit/domain_record.html b/httemplate/edit/domain_record.html new file mode 100644 index 000000000..3ea6c77da --- /dev/null +++ b/httemplate/edit/domain_record.html @@ -0,0 +1,53 @@ +<% include('/elements/header-popup.html', 'Edit nameservice record') %> + +<% include('/elements/error.html') %> + +<FORM METHOD="POST" ACTION="process/domain_record.cgi"> + +<INPUT TYPE="hidden" NAME="recnum" VALUE="<% $opt{'recnum'} %>"> + +<% ntable("#cccccc", 2) %> + + <tr> + <td> + <INPUT TYPE="text" NAME="reczone" VALUE="<% $domain_record->reczone %>"> + <BR> + <FONT SIZE="-1"><I>Zone</I></FONT> + </TD> + <TD> + <INPUT TYPE="hidden" NAME="recaf" VALUE="IN"> + <SELECT NAME="rectype"> +% foreach ( @{ FS::domain_record->rectypes } ) { + <OPTION VALUE="<%$_%>" + <% $_ eq $domain_record->rectype ? 'SELECTED' : '' %> + >IN <%$_%></OPTION> +% } + </SELECT><BR> + <FONT SIZE="-1"><I>Type</I></FONT> + </TD> + <TD> + <INPUT TYPE="text" NAME="recdata" VALUE="<% $domain_record->recdata |h %>"> + <BR> + <FONT SIZE="-1"><I>Data</I></FONT> + </TD> + <TD> + <INPUT TYPE="text" NAME="ttl" size="6" VALUE="<% $domain_record->ttl %>"> + <BR> + <FONT SIZE="-1"><I>TTL</I></FONT> + </TD> + +</TABLE> + +<BR> +<INPUT TYPE="submit" VALUE="Edit record"> + +</FORM> + +<%init> + +my %opt = @_; + +my $domain_record = qsearchs('domain_record', { 'recnum' => $opt{'recnum'} } ) + or die "unknown recnum"; + +</%init> diff --git a/httemplate/edit/process/domain_record.cgi b/httemplate/edit/process/domain_record.cgi index ff0f2d414..8369f7114 100755 --- a/httemplate/edit/process/domain_record.cgi +++ b/httemplate/edit/process/domain_record.cgi @@ -1,8 +1,14 @@ %if ( $error ) { % errorpage($error); -%} else { +%} elsif ( $recnum ) { #editing +<% header('Nameservice record changed') %> + <SCRIPT TYPE="text/javascript"> + window.top.location.reload(); + </SCRIPT> + </BODY></HTML> +%} else { #adding % my $svcnum = $new->svcnum; -<% $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum") %> +<% $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum#dns") %> %} <%init> @@ -21,10 +27,11 @@ my $new = new FS::domain_record ( { my $error; if ( $recnum ) { - $error=$new->replace($old); + $new->svcnum( $old->svcnum ); + $error = $new->replace($old); } else { - $error=$new->insert; - $recnum=$new->getfield('recnum'); + $error = $new->insert; + #$recnum = $new->getfield('recnum'); } </%init> diff --git a/httemplate/edit/process/svc_domain-defaultrecords.cgi b/httemplate/edit/process/svc_domain-defaultrecords.cgi index feb58406c..ec3d221f3 100644 --- a/httemplate/edit/process/svc_domain-defaultrecords.cgi +++ b/httemplate/edit/process/svc_domain-defaultrecords.cgi @@ -1,4 +1,8 @@ -<% $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum") %> +% if ( $error ) { +% errorpage($error); +% } else { +<% $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum#dns") %> +% } <%init> die "access denied" |
