From cd91e59d897b1359dd91b2b9e5e7e008d2dbd9ed Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 7 Nov 2010 05:30:12 +0000 Subject: certificates ala communigate, RT#7515 --- httemplate/edit/process/svc_cert.cgi | 8 +- httemplate/edit/svc_cert.cgi | 174 +++++++++++++++++++---------------- 2 files changed, 100 insertions(+), 82 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/process/svc_cert.cgi b/httemplate/edit/process/svc_cert.cgi index 1bf749f96..58b95a6e9 100644 --- a/httemplate/edit/process/svc_cert.cgi +++ b/httemplate/edit/process/svc_cert.cgi @@ -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,7 +37,7 @@ 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; @@ -58,7 +56,7 @@ if ( $cgi->param('privatekey') eq '_generate' ) { #generate $new->privatekey( $cgi->param('privatekey') ); -} #elsif ( $cgi->param('privatekey') eq '_clear' ) { #import +} #elsif ( $cgi->param('privatekey') eq '_clear' ) { #clear my $error = ''; if ($cgi->param('svcnum')) { diff --git a/httemplate/edit/svc_cert.cgi b/httemplate/edit/svc_cert.cgi index 89460f3e3..93194228e 100644 --- a/httemplate/edit/svc_cert.cgi +++ b/httemplate/edit/svc_cert.cgi @@ -12,92 +12,112 @@ Private key -% if ( $svc_cert->privatekey && $svc_cert->check_privatekey ) { - Verification OK -% # remove key & cert link? just unprovision? - - -% my $cust_main = $svc_cert->cust_svc->cust_pkg->cust_main; +% if ( $svc_cert->privatekey && $svc_cert->check_privatekey ) { - - Organization - - + Verification OK +% # remove key & cert link? just unprovision? - - Organization Unit - - + - - City - <% include('/elements/city.html', - 'city' => $svc_cert->city || $cust_main->city, - 'state' => $svc_cert->state || $cust_main->state, - 'country' => $svc_cert->country || $cust_main->country, - ) - %> - - +% if (0) { #( $svc_cert->csr_submitted ) { #XXX add field? date? } - - State - <% include('/elements/select-state.html', - 'city' => $svc_cert->city || $cust_main->city, - 'state' => $svc_cert->state || $cust_main->state, - 'country' => $svc_cert->country || $cust_main->country, - ) - %> - - - - - City - <% include('/elements/select-country.html', - 'city' => $svc_cert->city || $cust_main->city, - 'state' => $svc_cert->state || $cust_main->state, - 'country' => $svc_cert->country || $cust_main->country, - ) - %> - - +% # just show the fields once the csr has been submitted % } else { -% my $re = ''; -% if ( $svc_cert->privatekey ) { - Verification error -% $re = 'Clear and Re-'; -% } - <% include('/elements/popup_link.html', { - 'action' => "svc_cert/generate_privatekey.html$link_query", - 'label' => $re.'Generate', - 'actionlabel' => 'Generate private key', - #opt - 'width' => '350', - 'height' => '150' - #'color' => '#ff0000', - #'closetext' => 'Go Away', # the value '' removes the link - })%> - - or - - <% include('/elements/popup_link.html', { - 'action' => "svc_cert/import_privatekey.html$link_query", - 'label' => $re.'Import', - 'actionlabel' => 'Import private key', - #opt - 'width' => '544', - 'height' => '368', - #'color' => '#ff0000', - #'closetext' => 'Go Away', # the value '' removes the link - })%> -% if ( $svc_cert->privatekey ) { -
<% $svc_cert->privatekey |h %>
-% } + +% my $cust_main = $svc_cert->cust_svc->cust_pkg->cust_main; + + + Common name + + + + + Organization + + + + + Organization Unit + + + + + City + <% include('/elements/city.html', + 'city' => $svc_cert->city || $cust_main->city, + 'state' => $svc_cert->state || $cust_main->state, + 'country' => $svc_cert->country || $cust_main->country, + ) + %> + + + + + State + <% include('/elements/select-state.html', + 'city' => $svc_cert->city || $cust_main->city, + 'state' => $svc_cert->state || $cust_main->state, + 'country' => $svc_cert->country || $cust_main->country, + ) + %> + + + + + Country + <% include('/elements/select-country.html', + 'city' => $svc_cert->city || $cust_main->city, + 'state' => $svc_cert->state || $cust_main->state, + 'country' => $svc_cert->country || $cust_main->country, + ) + %> + + + + + Contact email + + + +% } + +% } else { +% my $re = ''; +% if ( $svc_cert->privatekey ) { + Verification error +% $re = 'Clear and Re-'; +% } + <% include('/elements/popup_link.html', { + 'action' => "svc_cert/generate_privatekey.html$link_query", + 'label' => $re.'Generate', + 'actionlabel' => 'Generate private key', + #opt + 'width' => '350', + 'height' => '150' + #'color' => '#ff0000', + #'closetext' => 'Go Away', # the value '' removes the link + })%> + + or + + <% include('/elements/popup_link.html', { + 'action' => "svc_cert/import_privatekey.html$link_query", + 'label' => $re.'Import', + 'actionlabel' => 'Import private key', + #opt + 'width' => '544', + 'height' => '368', + #'color' => '#ff0000', + #'closetext' => 'Go Away', # the value '' removes the link + })%> +% if ( $svc_cert->privatekey ) { +
<% $svc_cert->privatekey |h %>
+% } -% } +% }
-- cgit v1.2.1