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