diff options
author | ivan <ivan> | 2010-11-07 05:30:12 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-11-07 05:30:12 +0000 |
commit | cd91e59d897b1359dd91b2b9e5e7e008d2dbd9ed (patch) | |
tree | 0d22c6b82e55fcc08d752bb198a8ac8050179548 /httemplate/edit | |
parent | 2d73473ce78c22160b618e93802a9551c9c77d69 (diff) |
certificates ala communigate, RT#7515
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/process/svc_cert.cgi | 8 | ||||
-rw-r--r-- | httemplate/edit/svc_cert.cgi | 174 |
2 files changed, 100 insertions, 82 deletions
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 @@ <TR> <TD ALIGN="right">Private key</TD> <TD BGCOLOR="#ffffff"> -% if ( $svc_cert->privatekey && $svc_cert->check_privatekey ) { - <FONT COLOR="#33ff33">Verification OK</FONT> -% # remove key & cert link? just unprovision? - </TD> -</TR> -% my $cust_main = $svc_cert->cust_svc->cust_pkg->cust_main; +% if ( $svc_cert->privatekey && $svc_cert->check_privatekey ) { -<TR> - <TD ALIGN="right">Organization</TD> - <TD><INPUT TYPE="text" NAME="organization" SIZE=40 MAXLENGTH=80 VALUE="<% $svc_cert->organization || $cust_main->company |h %>"></TD> -</TR> + <FONT COLOR="#33ff33">Verification OK</FONT> +% # remove key & cert link? just unprovision? -<TR> - <TD ALIGN="right">Organization Unit</TD> - <TD><INPUT TYPE="text" NAME="organization_unit" SIZE=40 MAXLENGTH=80 VALUE="<% $svc_cert->organization_unit |h %>"></TD> -</TR> + </TD></TR> -<TR> - <TD ALIGN="right">City</TD> - <TD><% 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, - ) - %> - </TD> -</TR> +% if (0) { #( $svc_cert->csr_submitted ) { #XXX add field? date? } -<TR> - <TD ALIGN="right">State</TD> - <TD><% 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, - ) - %> - </TD> -</TR> - -<TR> - <TD ALIGN="right">City</TD> - <TD><% 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, - ) - %> - </TD> -</TR> +% # just show the fields once the csr has been submitted % } else { -% my $re = ''; -% if ( $svc_cert->privatekey ) { - <FONT COLOR="#ff0000">Verification error</FONT> -% $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 ) { -<PRE><% $svc_cert->privatekey |h %></PRE> -% } + +% my $cust_main = $svc_cert->cust_svc->cust_pkg->cust_main; + + <TR> + <TD ALIGN="right">Common name</TD> + <TD><INPUT TYPE="text" NAME="common_name" SIZE=40 MAXLENGTH=80 VALUE="<% $svc_cert->common_name |h %>"></TD> + </TR> + + <TR> + <TD ALIGN="right">Organization</TD> + <TD><INPUT TYPE="text" NAME="organization" SIZE=40 MAXLENGTH=80 VALUE="<% $svc_cert->organization || $cust_main->company |h %>"></TD> + </TR> + + <TR> + <TD ALIGN="right">Organization Unit</TD> + <TD><INPUT TYPE="text" NAME="organization_unit" SIZE=40 MAXLENGTH=80 VALUE="<% $svc_cert->organization_unit |h %>"></TD> + </TR> + + <TR> + <TD ALIGN="right">City</TD> + <TD><% 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, + ) + %> + </TD> + </TR> + + <TR> + <TD ALIGN="right">State</TD> + <TD><% 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, + ) + %> + </TD> + </TR> + + <TR> + <TD ALIGN="right">Country</TD> + <TD><% 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, + ) + %> + </TD> + </TR> + + <TR> + <TD ALIGN="right">Contact email</TD> + <TD><INPUT TYPE="text" NAME="cert_contact" SIZE=40 MAXLENGTH=80 VALUE="<% $svc_cert->cert_contact || ($cust_main->invoicing_list_emailonly)[0] |h %>"></TD> + </TR> + +% } + +% } else { +% my $re = ''; +% if ( $svc_cert->privatekey ) { + <FONT COLOR="#ff0000">Verification error</FONT> +% $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 ) { + <PRE><% $svc_cert->privatekey |h %></PRE> +% } </TD> </TR> -% } +% } </TABLE> <BR> |