From 9d8fe677d8b1aa8273d5379e14da325e33d52bb4 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 7 Nov 2010 23:47:05 +0000 Subject: certificates ala communigate, RT#7515 --- httemplate/edit/process/svc_cert.cgi | 20 +++++++++++++++----- httemplate/edit/svc_cert/import_certificate.html | 22 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 httemplate/edit/svc_cert/import_certificate.html (limited to 'httemplate/edit') diff --git a/httemplate/edit/process/svc_cert.cgi b/httemplate/edit/process/svc_cert.cgi index 58b95a6e9..a8dc0ca8a 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 ) %> % } @@ -40,10 +40,10 @@ if ( $svcnum ) { $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'; @@ -51,12 +51,22 @@ 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' ) { #clear +#} #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 ); + +} my $error = ''; if ($cgi->param('svcnum')) { diff --git a/httemplate/edit/svc_cert/import_certificate.html b/httemplate/edit/svc_cert/import_certificate.html new file mode 100644 index 000000000..337a7419e --- /dev/null +++ b/httemplate/edit/svc_cert/import_certificate.html @@ -0,0 +1,22 @@ +<% include('/elements/header-popup.html', 'Import issued certificate' ) %> + +<% include('/elements/error.html') %> + +
+ + + + + +

+ + +
+ + +<%init> + +$cgi->param('svcnum') =~ /^(\d*)$/ or die 'illegal svcnum'; +my $svcnum = $1; + + -- cgit v1.2.1