X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fsvc_cert.cgi;h=0e6037e3137ed74e549fdaf2566466fbbc996b34;hp=1bf749f968eed416b88751777afc75c25aab3386;hb=e50b6ec8d63afe4c04ae33384758d8786fcc7cfe;hpb=2d73473ce78c22160b618e93802a9551c9c77d69 diff --git a/httemplate/edit/process/svc_cert.cgi b/httemplate/edit/process/svc_cert.cgi index 1bf749f96..0e6037e31 100644 --- a/httemplate/edit/process/svc_cert.cgi +++ b/httemplate/edit/process/svc_cert.cgi @@ -9,7 +9,7 @@ % } else { <% include('/elements/header-popup.html', $title ) %> % } @@ -17,9 +17,7 @@ % $cgi->param('error', $error); <% $cgi->redirect(popurl(2). "svc_cert.cgi?". $cgi->query_string ) %> %} else { -%#change link when we make a non-generic view -%#<% $cgi->redirect(popurl(3). "view/svc_cert.cgi?$svcnum") %> -<% $cgi->redirect(popurl(3). "view/svc_Common.html?svcdb=svc_cert;svcnum=$svcnum") %> +<% $cgi->redirect(popurl(3). "view/svc_cert.cgi?$svcnum") %> % } <%init> @@ -39,13 +37,13 @@ my $old = ''; if ( $svcnum ) { $old = qsearchs('svc_cert', { 'svcnum' => $svcnum } ) #agent virt; or die 'unknown svcnum'; - $new->$_( $old->$_ ) for grep $old->$_, qw( privatekey ); + $new->$_( $old->$_ ) for grep $old->$_, qw( privatekey csr certificate cacert ); } -my $popup = 0; +my $popup = ''; my $title = ''; if ( $cgi->param('privatekey') eq '_generate' ) { #generate - $popup = 1; + $popup = 'edit'; $title = 'Key generated'; $cgi->param('keysize') =~ /^(\d+)$/ or die 'illegal keysize'; @@ -53,12 +51,30 @@ if ( $cgi->param('privatekey') eq '_generate' ) { #generate $new->generate_privatekey($keysize); } elsif ( $cgi->param('privatekey') =~ /\S/ ) { #import - $popup = 1; + $popup = 'edit'; $title = 'Key imported'; $new->privatekey( $cgi->param('privatekey') ); -} #elsif ( $cgi->param('privatekey') eq '_clear' ) { #import +#} #elsif ( $cgi->param('privatekey') eq '_clear' ) { #clear + +} elsif ( $cgi->param('certificate') ) { + + $popup = 'view'; + $title = 'Certificate imported'; + + $new->certificate( $cgi->param('certificate') ); + $new->$_( $old->$_ ) for grep $old->$_, qw( recnum common_name organization organization_unit city state country cert_contact ); + +} elsif ( $cgi->param('cacert') ) { + + $popup = 'view'; + $title = 'Certificate authority chain imported'; + + $new->cacert( $cgi->param('cacert') ); + $new->$_( $old->$_ ) for grep $old->$_, qw( recnum common_name organization organization_unit city state country cert_contact ); + +} my $error = ''; if ($cgi->param('svcnum')) {