blob: 2e427e4fb4ff475e47af72209a1c77d1d99097e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
%if ( $error ) {
% errorpage($error);
%} else {
% my $svcnum = $new->svcnum;
<% $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum") %>
%}
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice');
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');
}
</%init>
|