summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2002-05-22 18:44:01 +0000
committerivan <ivan>2002-05-22 18:44:01 +0000
commit23186f0338ec248d930c85db08cc997bca42525b (patch)
tree0f913dcdf0b10d662baf90947d44cd4ac43584c2 /httemplate
parenta55f1c9e63b5428c55aa75d55ab4a280889be288 (diff)
bind export, editing zones, deleting unaudited domains, mmm
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/edit/process/domain_record.cgi31
-rwxr-xr-xhttemplate/misc/cancel-unaudited.cgi11
-rwxr-xr-xhttemplate/misc/delete-domain_record.cgi15
-rwxr-xr-xhttemplate/misc/delete-part_export.cgi2
-rwxr-xr-xhttemplate/view/svc_domain.cgi31
5 files changed, 79 insertions, 11 deletions
diff --git a/httemplate/edit/process/domain_record.cgi b/httemplate/edit/process/domain_record.cgi
new file mode 100755
index 000000000..8fb0368f6
--- /dev/null
+++ b/httemplate/edit/process/domain_record.cgi
@@ -0,0 +1,31 @@
+<%
+
+my $recnum = $cgi->param('recnum');
+
+my $old = qsearchs('agent',{'recnum'=>$recnum}) if $recnum;
+
+my $new = new FS::domain_record ( {
+ map {
+ $_, scalar($cgi->param($_));
+ } fields('domain_record')
+} );
+
+my $error;
+if ( $recnum ) {
+ $error=$new->replace($old);
+} else {
+ $error=$new->insert;
+ $recnum=$new->getfield('recnum');
+}
+
+if ( $error ) {
+# $cgi->param('error', $error);
+# print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string );
+ #no edit screen to send them back to
+ eidiot($error);
+} else {
+ my $svcnum = $new->svcnum;
+ print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum");
+}
+
+%>
diff --git a/httemplate/misc/cancel-unaudited.cgi b/httemplate/misc/cancel-unaudited.cgi
index ecfaef29f..f1fb15341 100755
--- a/httemplate/misc/cancel-unaudited.cgi
+++ b/httemplate/misc/cancel-unaudited.cgi
@@ -7,15 +7,18 @@ my($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
my $svcnum = $1;
-my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
-die "Unknown svcnum!" unless $svc_acct;
+#my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
+#die "Unknown svcnum!" unless $svc_acct;
my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
+die "Unknown svcnum!" unless $cust_svc;
&eidiot(qq!This account has already been audited. Cancel the
<A HREF="!. popurl(2). qq!view/cust_pkg.cgi?! . $cust_svc->getfield('pkgnum') .
qq!pkgnum"> package</A> instead.!)
if $cust_svc->pkgnum ne '' && $cust_svc->pkgnum ne '0';
+my $svc_x = $cust_svc->svc_x;
+
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
local $SIG{QUIT} = 'IGNORE';
@@ -24,8 +27,8 @@ local $SIG{TSTP} = 'IGNORE';
local $FS::UID::AutoCommit = 0;
-my $error = $svc_acct->cancel;
-$error ||= $svc_acct->delete;
+my $error = $svc_x->cancel;
+$error ||= $svc_x->delete;
$error ||= $cust_svc->delete;
if ( $error ) {
diff --git a/httemplate/misc/delete-domain_record.cgi b/httemplate/misc/delete-domain_record.cgi
new file mode 100755
index 000000000..dcc2d5022
--- /dev/null
+++ b/httemplate/misc/delete-domain_record.cgi
@@ -0,0 +1,15 @@
+<%
+
+#untaint recnum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal recnum";
+my $recnum = $1;
+
+my $domain_record = qsearchs('domain_record',{'recnum'=>$recnum});
+
+my $error = $domain_record->delete;
+eidiot($error) if $error;
+
+print $cgi->redirect($p. "view/svc_domain.cgi?". $domain_record->svcnum);
+
+%>
diff --git a/httemplate/misc/delete-part_export.cgi b/httemplate/misc/delete-part_export.cgi
index 34ef06b96..7c4ab8b9d 100755
--- a/httemplate/misc/delete-part_export.cgi
+++ b/httemplate/misc/delete-part_export.cgi
@@ -1,6 +1,6 @@
<%
-#untaint paynum
+#untaint exportnum
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/ || die "Illegal exportnum";
my $exportnum = $1;
diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi
index 61194a26d..28214f04e 100755
--- a/httemplate/view/svc_domain.cgi
+++ b/httemplate/view/svc_domain.cgi
@@ -35,7 +35,7 @@ print header('Domain View', menubar(
? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
"View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
)
- : ( "Cancel this (unaudited) account" =>
+ : ( "Cancel this (unaudited) domain" =>
"${p}misc/cancel-unaudited.cgi?$svcnum" )
),
"Main menu" => $p,
@@ -46,17 +46,36 @@ print header('Domain View', menubar(
qq!<BR>Catch all email <A HREF="${p}misc/catchall.cgi?$svcnum">(change)</A>:!,
$email ? "<B>$email</B>." : "<I>(none)<I>",
qq!<BR><BR><A HREF="http://www.geektools.com/cgi-bin/proxy.cgi?query=$domain;targetnic=auto">View whois information.</A>!,
- '<BR><BR>', ntable("",2),
+ '<BR><BR>',
+ '<SCRIPT>function areyousure(href) {
+ if ( confirm("Remove this record?") == true )
+ window.location.href = href;
+ }
+ </SCRIPT>',
+ ntable("",2),
'<tr><th>Zone</th><th>Type</th><th>Data</th></tr>',
;
-foreach my $domain_record ( qsearch('domain_record', { svcnum => $svcnum } ) ) {
+
+foreach my $domain_record ( $svc_domain->domain_record ) {
print '<tr><td>'. $domain_record->reczone. '</td>'.
'<td>'. $domain_record->recaf. ' '. $domain_record->rectype. '</td>'.
- '<td>'. $domain_record->recdata. '</td></tr>';
+ '<td>'. $domain_record->recdata;
+ print qq! (<A HREF="javascript:areyousure('${p}misc/delete-domain_record.cgi?!
+ .$domain_record->recnum. qq!')">delete</A>)!
+ unless $domain_record->rectype eq 'SOA';
+ print '</td></tr>';
}
-print '</table>'.
- '<BR>'. joblisting({'svcnum'=>$svcnum}, 1).
+print '</table><BR>'.
+ qq!<FORM METHOD="POST" ACTION="${p}edit/process/domain_record.cgi">!.
+ qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!.
+ '<INPUT TYPE="text" NAME="reczone"> '.
+ '<INPUT TYPE="hidden" NAME="recaf" VALUE="IN">IN '.
+ '<SELECT NAME="rectype">'.
+ join('', map qq!<OPTION VALUE="$_">$_</OPTION>!, qw(A NS CNAME MX) ).
+ '</SELECT>'.
+ ' <INPUT TYPE="text" NAME="recdata"> <INPUT TYPE="submit" VALUE="Add">'.
+ '<BR><BR>'. joblisting({'svcnum'=>$svcnum}, 1).
'</BODY></HTML>';
%>