0b7ec49287e0d023c798a1455c2cae9a68edaae5
[freeside.git] / httemplate / edit / process / svc_domain.cgi
1 <!-- $Id: svc_domain.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
2 <%
3
4 #remove this to actually test the domains!
5 $FS::svc_domain::whois_hack = 1;
6
7 $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
8 my $svcnum = $1;
9
10 my $new = new FS::svc_domain ( {
11   map {
12     $_, scalar($cgi->param($_));
13   #} qw(svcnum pkgnum svcpart domain action purpose)
14   } ( fields('svc_domain'), qw( pkgnum svcpart action purpose ) )
15 } );
16
17 my $error = '';
18 if ($cgi->param('svcnum')) {
19   $error="Can't modify a domain!";
20 } else {
21   $error=$new->insert;
22   $svcnum=$new->svcnum;
23 }
24
25 if ($error) {
26   $cgi->param('error', $error);
27   print $cgi->redirect(popurl(2). "svc_domain.cgi?". $cgi->query_string );
28 } else {
29   print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum");
30 }
31
32 %>