summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorivan <ivan>2010-11-07 23:47:04 +0000
committerivan <ivan>2010-11-07 23:47:04 +0000
commit874ad675da1321638b374d0b574231d7fa577196 (patch)
tree3ca9ad29f55550256e676ac4a752dedbbafa0f17 /httemplate/edit
parent5ac9e46a92f4eefd795f97643f3e8f62ec1a2b26 (diff)
certificates ala communigate, RT#7515
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/process/svc_cert.cgi20
-rw-r--r--httemplate/edit/svc_cert/import_certificate.html22
2 files changed, 37 insertions, 5 deletions
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 ) %>
<SCRIPT TYPE="text/javascript">
- window.top.location = '<% popurl(3). "edit/svc_cert.cgi?$svcnum" %>';
+ window.top.location = '<% popurl(3). "$popup/svc_cert.cgi?$svcnum" %>';
</SCRIPT>
</BODY></HTML>
% }
@@ -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') %>
+
+<FORM NAME="ImportKeyForm" ACTION="<% $p %>process/svc_cert.cgi" METHOD="POST">
+
+<INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $svcnum %>">
+
+<TEXTAREA NAME="certificate" COLS=64 ROWS=15 STYLE="font-family:monospace"></TEXTAREA>
+
+<BR><BR>
+<INPUT TYPE="submit" VALUE="Import">
+
+</FORM>
+</BODY>
+</HTML>
+<%init>
+
+$cgi->param('svcnum') =~ /^(\d*)$/ or die 'illegal svcnum';
+my $svcnum = $1;
+
+</%init>