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