diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-11-21 13:28:22 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-12-03 11:40:25 -0500 |
commit | 538dee3554b0a84497afa78770706a5ad4a8ff52 (patch) | |
tree | 239fa83c28241f3d4d8b6ba27214db539fc9cb19 /base/ra/forms/ee | |
parent | 35dc1009494453803d22573ef876c8b418a609d3 (diff) | |
download | pki-538dee3554b0a84497afa78770706a5ad4a8ff52.tar.gz pki-538dee3554b0a84497afa78770706a5ad4a8ff52.tar.xz pki-538dee3554b0a84497afa78770706a5ad4a8ff52.zip |
Reorganized RA templates and scripts.
The templates, JS, and CGI scripts for RA have been moved into
the RA core package.
Ticket #407
Diffstat (limited to 'base/ra/forms/ee')
25 files changed, 0 insertions, 2148 deletions
diff --git a/base/ra/forms/ee/agent/enroll.cgi b/base/ra/forms/ee/agent/enroll.cgi deleted file mode 100755 index 4f1af8f16..000000000 --- a/base/ra/forms/ee/agent/enroll.cgi +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use MIME::Base64; -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Conf; -use PKI::Base::Registry; -use PKI::Request::Queue; -use PKI::Conn::CA; -use PKI::Base::PinStore; -use PKI::Base::Util; - -use vars qw (@ISA); -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $util = PKI::Base::Util->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my $uid = $util->get_val($q->param('uid')); - my $pin = $util->get_alphanum_val($q->param('pin')); - my $csr = $util->get_val($q->param('csr')); - $csr = $util->normalize_csr($csr); - - my $key = $uid; - - my $pin_store = PKI::Base::PinStore->new(); - $pin_store->open($cfg); - my $pinref = $pin_store->read_pin($key); - if (defined($pinref) && $pinref->{'pin'} eq $pin) { - $pin_store->delete($key); - } else { - $pin_store->close(); - print $q->redirect("/ee/error.cgi?error=Invalid Pin"); - return; - } - my $rid = $pinref->{'rid'}; - $pin_store->close(); - - my $profile_id = $cfg->get("request.agent.profileId"); - my $cert_request_type = $cfg->get("request.agent.reqType"); - - my $queue = PKI::Request::Queue->new(); - $queue->open($cfg); - my $req = $queue->read_request($rid); - $queue->set_request($rid, "subject_dn", "uid=$uid, e=$req->{'created_by'}"); - - my $ca = PKI::Conn::CA->new(); - $ca->open($cfg); - my $cert = $ca->enroll($rid, "ca1", $profile_id, $cert_request_type, $csr); - $ca->close(); - $queue->set_request($rid, "output", $cert); - - $req = $queue->read_request($rid); - if ($cert eq "") { - my $error = $req->{'errorString'}; - $queue->close(); - print $q->redirect("/ee/error.cgi?error=$error"); - return; - } - - my $decoded = decode_base64($cert); - my $encoded = encode_base64($decoded); - - my %context; - $context{cert} = $encoded; - $context{rid} = $util->html_encode($rid); - $context{subject_dn} = $util->html_encode($req->{'subject_dn'}); - $queue->close(); - - my $result = $parser->execute_file_with_context("ee/agent/enroll.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/agent/index.cgi b/base/ra/forms/ee/agent/index.cgi deleted file mode 100755 index 66fceb8ff..000000000 --- a/base/ra/forms/ee/agent/index.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use PKI::Base::Registry; -use Template::Velocity; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my %context; - my $result = $parser->execute_file_with_context("ee/agent/index.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/agent/new.cgi b/base/ra/forms/ee/agent/new.cgi deleted file mode 100755 index c209f5e74..000000000 --- a/base/ra/forms/ee/agent/new.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use PKI::Base::Registry; -use Template::Velocity; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my %context; - my $result = $parser->execute_file_with_context("ee/agent/new.vm", \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } - -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/agent/start.cgi b/base/ra/forms/ee/agent/start.cgi deleted file mode 100755 index 27aedb546..000000000 --- a/base/ra/forms/ee/agent/start.cgi +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use PKI::Base::Registry; -use Template::Velocity; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my %context; - - my $result = $parser->execute_file_with_context("ee/agent/start.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/agent/submit.cgi b/base/ra/forms/ee/agent/submit.cgi deleted file mode 100755 index a68242114..000000000 --- a/base/ra/forms/ee/agent/submit.cgi +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Conf; -use PKI::Base::Util; -use PKI::Base::Registry; -use PKI::Request::Queue; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $util = PKI::Base::Util->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my $uid = $util->get_val($q->param('uid')); - my $email = $util->get_val($q->param('email')); - - $self->debug_params($cfg, $q); - - my $queue = PKI::Request::Queue->new(); - $queue->open($cfg); - my $request_id = $queue->create_request("agent", - "uid=" . $uid, - "0", - $email); - my %context; - $context{request_id} = $util->html_encode($request_id); - $self->debug_log($cfg, "request $request_id created"); - $queue->close(); - - my $result = $parser->execute_file_with_context("ee/agent/submit.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/error.cgi b/base/ra/forms/ee/error.cgi deleted file mode 100755 index 1417d4b61..000000000 --- a/base/ra/forms/ee/error.cgi +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use Template::Velocity; -use PKI::Base::Conf; -use PKI::Base::UserStore; -use PKI::Base::Util; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my $util = PKI::Base::Util->new(); - - my %context; - - my $error = $util->get_val($q->param('error')); - if ($error ne "") { - $context{has_error} = 1; - $context{'error'} = $util->html_encode($error); - } - - my $result = $parser->execute_file_with_context("ee/error.vm", \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/index.cgi b/base/ra/forms/ee/index.cgi deleted file mode 100755 index 453b2873b..000000000 --- a/base/ra/forms/ee/index.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my %context; - my $result = $parser->execute_file_with_context("ee/index.vm", \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/request/getcert.cgi b/base/ra/forms/ee/request/getcert.cgi deleted file mode 100755 index b22444dc1..000000000 --- a/base/ra/forms/ee/request/getcert.cgi +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use DBI; -use CGI; -use PKI::Service::Op; -use PKI::Base::Conf; -use PKI::Base::Util; -use PKI::Base::Registry; -use PKI::Request::Queue; -use Template::Velocity; -use MIME::Base64; -use Encode; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $util = PKI::Base::Util->new(); - - my $id = $util->get_alphanum_val($q->param('id')); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my $queue = PKI::Request::Queue->new(); - $queue->open($cfg); - my $req = $queue->read_request($id); - $queue->close(); - - my %context; - $context{id} = $util->html_encode($req->{'rowid'}); - $context{serialno} = $util->html_encode($req->{'serialno'}); - $context{subject_dn} = $util->html_encode(Encode::decode('UTF-8', $req->{'subject_dn'})); - if ($req->{'serialno'} eq "unavailable") { - $context{output} = ""; - } else { - $context{output} = "-----BEGIN CERTIFICATE-----\n".$util->breakline($util->html_encode($req->{'output'}), 40)."\n-----END CERTIFICATE-----"; - } - my $result = $parser->execute_file_with_context("ee/request/getcert.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/request/importcert.cgi b/base/ra/forms/ee/request/importcert.cgi deleted file mode 100755 index fdc309746..000000000 --- a/base/ra/forms/ee/request/importcert.cgi +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use DBI; -use CGI; -use PKI::Service::Op; -use PKI::Base::Conf; -use PKI::Base::Util; -use PKI::Base::Registry; -use PKI::Request::Queue; -use Template::Velocity; -use MIME::Base64; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $util = PKI::Base::Util->new(); - - my $id = $util->get_alphanum_val($q->param('id')); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my $queue = PKI::Request::Queue->new(); - $queue->open($cfg); - my $req = $queue->read_request($id); - $queue->close(); - - my %context; -# $::symbol{id} = $req->{'rowid'}; -# $::symbol{status} = $req->{'status'}; - -# my $result = $parser->execute_file("ee/request/status.vm"); - - my $cert = MIME::Base64::decode($req->{'output'}); - - print "Content-Type: application/x-x509-user-cert\n\n"; - print $cert; -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/request/index.cgi b/base/ra/forms/ee/request/index.cgi deleted file mode 100755 index ef2a68b23..000000000 --- a/base/ra/forms/ee/request/index.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my %context; - my $result = $parser->execute_file_with_context("ee/request/index.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/request/status.cgi b/base/ra/forms/ee/request/status.cgi deleted file mode 100755 index 6a3154716..000000000 --- a/base/ra/forms/ee/request/status.cgi +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use DBI; -use CGI; -use PKI::Service::Op; -use PKI::Base::Conf; -use PKI::Base::Util; -use PKI::Base::Registry; -use PKI::Request::Queue; -use Template::Velocity; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - - my $util = PKI::Base::Util->new(); - - my $id = $util->get_alphanum_val($q->param('id')); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my $queue = PKI::Request::Queue->new(); - $queue->open($cfg); - my $req = $queue->read_request($id); - $queue->close(); - if ($req == "") { - print $q->redirect("/ee/error.cgi?error=request%20not%20found"); - return; - } - - my %context; - $context{id} = $util->html_encode($req->{'rowid'}); - $context{type} =$util->html_encode($req->{'type'}); - $context{status} = $util->html_encode($req->{'status'}); - $context{serialno} = $util->html_encode($req->{'serialno'}); - $context{errorString} = $util->html_encode($req->{'errorString'}); - - my $result = $parser->execute_file_with_context("ee/request/status.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/scep/enroll.cgi b/base/ra/forms/ee/scep/enroll.cgi deleted file mode 100755 index 53291636a..000000000 --- a/base/ra/forms/ee/scep/enroll.cgi +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use MIME::Base64; -use URI::URL; -use URI::Escape; -use XML::Simple; -use CGI; -use PKI::Base::Conf; -use PKI::Base::Util; -use PKI::Base::Registry; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Conn::CA; -use PKI::Base::PinStore; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $util = PKI::Base::Util->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my $client_id = $util->get_val($q->param('client_id')); - my $site_id = $util->get_val($q->param('site_id')); - my $pin = $util->get_alphanum_val($q->param('pin')); - my $csr = $util->get_val($q->param('csr')); - - my $key = $client_id . "/" . $site_id; - - my $pin_store = PKI::Base::PinStore->new(); - $pin_store->open($cfg); - my $pinref = $pin_store->read_pin($key); - if (defined($pinref) && $pinref->{'pin'} eq $pin) { - $pin_store->delete($key); - } else { - $pin_store->close(); - # error, redirect user back to the original enrollment page - print $q->redirect("/ee/scep/installer.cgi"); - return; - } - $pin_store->close(); - - my $profile_id = $cfg->get("request.scep.profileId"); - my $cert_request_type = $cfg->get("request.scep.reqType"); - - my $ca = PKI::Conn::CA->new(); - $ca->open($cfg); - my $cert = $ca->enroll($pinref->{'rid'}, "ca1", $profile_id, $cert_request_type, $csr); - $ca->close(); - my $decoded = decode_base64($cert); - my $encoded = encode_base64($decoded); - - my %context; - $context{cert} = $encoded; - - my $result = $parser->execute_file_with_context("ee/scep/enroll.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/scep/index.cgi b/base/ra/forms/ee/scep/index.cgi deleted file mode 100755 index c73fc379a..000000000 --- a/base/ra/forms/ee/scep/index.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my %context; - my $result = $parser->execute_file_with_context("ee/scep/index.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/scep/installer.cgi b/base/ra/forms/ee/scep/installer.cgi deleted file mode 100755 index 8453c2cc4..000000000 --- a/base/ra/forms/ee/scep/installer.cgi +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Conf; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my %context; - $context{machine} = $cfg->get("service.machineName"); - $context{port} = $cfg->get("service.unsecurePort"); - - my $result = $parser->execute_file_with_context("ee/scep/installer.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/scep/manager.cgi b/base/ra/forms/ee/scep/manager.cgi deleted file mode 100755 index 8b547a928..000000000 --- a/base/ra/forms/ee/scep/manager.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my %context; - my $result = $parser->execute_file_with_context("ee/scep/manager.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/scep/pkiclient.cgi b/base/ra/forms/ee/scep/pkiclient.cgi deleted file mode 100755 index a54558f37..000000000 --- a/base/ra/forms/ee/scep/pkiclient.cgi +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use MIME::Base64; -use URI::URL; -use URI::Escape; -use XML::Simple; -use CGI; -use PKI::Base::Conf; -use PKI::Base::Util; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Conn::CA; -use PKI::Base::PinStore; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $util = PKI::Base::Util->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my $operation = $util->get_alphanum_val($q->param('operation')); - my $message = $util->get_val($q->param('message')); - $message = uri_escape($message); - - my $ca = PKI::Conn::CA->new(); - $ca->open($cfg); - if ($operation eq "GetCACert") { - my $content = $ca->scep_get_ca_cert("ca1", $operation, $message); - - print "Content-Type: application/x-x509-ca-cert\n\n"; - print $content; - } elsif ($operation eq "PKIOperation") { - my $decoded = $ca->scep_decode("ca1", $operation, $message); - $decoded =~ /(\<XMLResponse\>.*\<\/XMLResponse\>)/; - $decoded = $1; - my $parser = XML::Simple->new(); - my $response = $parser->XMLin($decoded); - - # one time pin - my $pin = $response->{'PKCS10'}->{'ChallengePassword'}->{'Password'} ; - # IP Address - my $key = $ENV{'REMOTE_ADDR'}; - - # check PIN - if (1) { - my $pin_store = PKI::Base::PinStore->new(); - $pin_store->open($cfg); - my $pinref = $pin_store->read_pin($key); - if (defined($pinref) && $pinref->{'pin'} eq $pin) { - $pin_store->delete($key); - } else { - $pin_store->close(); - # XXX - return SCEP error - print $q->redirect("/ee/scep/installer.cgi"); - return; - } - $pin_store->close(); - } - - my $content = $ca->scep_pki_message("ca1", $operation, $message); - - print "Content-Type: application/x-pki-message\n\n"; - print $content; - } - $ca->close(); -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/scep/submit.cgi b/base/ra/forms/ee/scep/submit.cgi deleted file mode 100755 index b3dfd7a5d..000000000 --- a/base/ra/forms/ee/scep/submit.cgi +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use DBI; -use CGI; -use PKI::Service::Op; -use PKI::Base::Conf; -use PKI::Base::Util; -use PKI::Request::Queue; -use Template::Velocity; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $util = PKI::Base::Util->new(); - - my $client_id = $util->get_val($q->param('client_id')); - my $site_id = $util->get_val($q->param('site_id')); - my $email = $util->get_val($q->param('email')); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my $queue = PKI::Request::Queue->new(); - $queue->open($cfg); - my $request_id = $queue->create_request("scep", - "client_id=" . $client_id . ";" . - "site_id=" . $site_id, - "0", - $email); - my %context; - $context{request_id} = $util->html_encode($request_id); - $self->debug_log($cfg, "request $request_id created"); - $queue->close(); - - my $result = $parser->execute_file_with_context("ee/scep/submit.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/server/admin.cgi b/base/ra/forms/ee/server/admin.cgi deleted file mode 100755 index 18945da02..000000000 --- a/base/ra/forms/ee/server/admin.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my %context; - my $result = $parser->execute_file_with_context("ee/server/admin.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/server/index.cgi b/base/ra/forms/ee/server/index.cgi deleted file mode 100755 index 830409a8b..000000000 --- a/base/ra/forms/ee/server/index.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my %context; - my $result = $parser->execute_file_with_context("ee/server/index.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/server/submit.cgi b/base/ra/forms/ee/server/submit.cgi deleted file mode 100755 index 4916033ee..000000000 --- a/base/ra/forms/ee/server/submit.cgi +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use PKI::Base::Conf; -use PKI::Base::Util; -use PKI::Request::Queue; -use Template::Velocity; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $util = PKI::Base::Util->new(); - - my $server_id = $util->get_val($q->param('server_id')); - my $site_id = $util->get_val($q->param('site_id')); - my $email = $util->get_val($q->param('email')); - my $csr = $util->get_val($q->param('csr')); - - $csr = $util->normalize_csr($csr); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my $queue = PKI::Request::Queue->new(); - $queue->open($cfg); - my $request_id = $queue->create_request("server", - "server_id=" . $server_id . ";" . - "site_id=" . $site_id . ";" . - "csr=" . $csr, - "0", - $email); - my %context; - $context{request_id} = $util->html_encode($request_id); - $self->debug_log($cfg, "request $request_id created"); - $queue->close(); - - my $result = $parser->execute_file_with_context("ee/server/submit.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/user/index.cgi b/base/ra/forms/ee/user/index.cgi deleted file mode 100755 index ef6b3aa47..000000000 --- a/base/ra/forms/ee/user/index.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my %context; - my $result = $parser->execute_file_with_context("ee/user/index.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/user/renew.cgi b/base/ra/forms/ee/user/renew.cgi deleted file mode 100755 index 63d646ec9..000000000 --- a/base/ra/forms/ee/user/renew.cgi +++ /dev/null @@ -1,165 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Base::Conf; -use PKI::Request::Queue; -use Template::Velocity; -use PKI::Service::Op; -use PKI::Base::Util; -use PKI::Base::Registry; - -use vars qw (@ISA); -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my $util = PKI::Base::Util->new(); - my $error = ""; - - my $host = $cfg->get("service.machineName"); - my $port = $cfg->get("service.non_clientauth_securePort"); - - $self->debug_params($cfg, $q); - - my $cert = $self->get_cert_record($cfg); - $self->debug_log( $cfg, "after get_cert_record"); - if (!defined($cert) || ($cert eq "")) { - $self->debug_log( $cfg, "cert not defined"); - $error = "certificate not found in database"; - print $q->redirect("/ee/error.cgi?error=$error"); - return; - } - $self->debug_log( $cfg, "got cert"); - - my $csr = $cert->{'csr'}; - if ($csr eq "") { - $error = "csr not found in database"; - print $q->redirect("/ee/error.cgi?error=$error"); - return; - } - $self->debug_log( $cfg, "got csr"); - - my $req_id = $cert->{'rid'}; - if ($req_id eq "") { - $error = "reqid not found in database"; - print $q->redirect("/ee/error.cgi?error=$error"); - return; - } - $self->debug_log( $cfg, "got req_id = $req_id"); - $self->debug_log( $cfg, "before renewl read/create request"); - my $queue = PKI::Request::Queue->new(); - $queue->open($cfg); - my $o_req = $queue->read_request($req_id); - if ($o_req eq "") { - $self->debug_log( $cfg, "got null o_req"); - print $q->redirect("/ee/error.cgi?error=$error"); - return; - } - - my $uid = ""; - my $site_id = ""; - my $org_csr = ""; - my $csr_type = ""; - - my $data = $o_req->{'data'}; - foreach $nv (split(/;/, $data)) { - my ($n, $v) = split(/=/, $nv); - if ($n eq "uid") { - $uid = $v; - } - if ($n eq "site_id") { - $site_id = $v; - } - if ($n eq "csr") { - $org_csr = $v; - } - if ($n eq "csr_type") { - $csr_type = $v; - } - } - - my $new_request = $queue->create_request("renewal", - "uid=" . $uid . ";" . - "site_id=" . $site_id . ";" . - "csr_type=" . $csr_type . ";" . - "csr=" . $csr, - "orig_reqid=" . $o_req->{'rowid'}, - $o_req->{'created_by'}); - - #self-renewal is created and processed by the same user - $ref = $queue->approve_request($new_request, $o_req->{'created_by'}); - my $nreq = $queue->read_request($new_request); - $error = $nreq->{'errorString'}; - if ($error ne "0") { - $self->debug_log( $cfg, "after approve request, got error=$error"); - print $q->redirect("/ee/error.cgi?error=$error"); - return; - } - - my %context; - $context{request_id} = $util->html_encode($new_request); - $self->debug_log($cfg, "request $new_request created"); - $queue->close(); - $self->debug_log( $cfg, "after renewl read/create request $new_request"); - - $context{data} = $util->breakline($util->html_encode($ref->{'data'}), 40); - $context{output} = $util->breakline($util->html_encode($ref->{'output'}), 40); - $context{serialno} = $util->html_encode($ref->{'serialno'}); - $context{host} = $util->html_encode($host); - $context{port} = $util->html_encode($port); - - #print $q->redirect("/ee/request/getcert.cgi?id=$new_request"); - my $result = $parser->execute_file_with_context("ee/user/renew.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/user/renewal.cgi b/base/ra/forms/ee/user/renewal.cgi deleted file mode 100755 index 63a211eff..000000000 --- a/base/ra/forms/ee/user/renewal.cgi +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Conf; -use PKI::Base::Registry; - -use vars qw (@ISA); -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my $host = $cfg->get("service.machineName"); - my $port = $cfg->get("service.securePort"); - - my %context; - $context{url} = "https://$host:$port/ee/user/renew.cgi"; - my $result = $parser->execute_file_with_context("ee/user/renewal.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/user/submit.cgi b/base/ra/forms/ee/user/submit.cgi deleted file mode 100755 index 26c900e00..000000000 --- a/base/ra/forms/ee/user/submit.cgi +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use Benchmark; -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Conf; -use PKI::Base::Util; -use PKI::Base::Registry; -use PKI::Request::Queue; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $st = new Benchmark; - - my $util = PKI::Base::Util->new(); - - my $userid = $util->get_val($q->param('uid')); - my $fullname = $util->get_val($q->param('cn')); - my $site_id = $util->get_val($q->param('site_id')); - my $email = $util->get_val($q->param('email')); - my $csr_type = $util->get_alphanum_val($q->param('csr_type')); - my $csr = $util->get_val($q->param('csr')); - - $csr = $util->normalize_csr($csr); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - $self->debug_params($cfg, $q); - - my $db_st = new Benchmark; - my $queue = PKI::Request::Queue->new(); - $queue->open($cfg); - my $request_id = $queue->create_request("user", - "uid=" . $userid . ";" . - "cn=" . $fullname . ";" . - "site_id=" . $site_id . ";" . - "csr_type=" . $csr_type . ";" . - "csr=" . $csr, - "0", - $email); - my %context; - $context{request_id} = $util->html_encode($request_id); - $self->debug_log($cfg, "request $request_id created"); - $queue->close(); - my $db_et = new Benchmark; - - my $t_st = new Benchmark; - my $result = $parser->execute_file_with_context("ee/user/submit.vm", - \%context); - my $t_et = new Benchmark; - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } - - my $et = new Benchmark; - $self->debug_log($cfg, "benchmark " . - "total=" . timestr(timediff($et, $st)) . " " . - "db total=" . timestr(timediff($db_et, $db_st)) . " " . - "template total=" . timestr(timediff($t_et, $t_st)) . " " - ); -} - -my $op = op->new(); -$op->execute(); diff --git a/base/ra/forms/ee/user/user.cgi b/base/ra/forms/ee/user/user.cgi deleted file mode 100755 index 2d58a532b..000000000 --- a/base/ra/forms/ee/user/user.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -# -# --- BEGIN COPYRIGHT BLOCK --- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2007 Red Hat, Inc. -# All rights reserved. -# --- END COPYRIGHT BLOCK --- -# -# -# -# - -package op; - -use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; - -use CGI; -use PKI::Service::Op; -use Template::Velocity; -use PKI::Base::Registry; - -use vars qw (@ISA); -use PKI::Service::Op; -@ISA = qw(PKI::Service::Op); - -sub new { - my $self = {}; - bless ($self); - return $self; -} - -sub process() -{ - my $self = shift; - my $q = CGI->new(); - - my $docroot = PKI::Base::Registry->get_docroot(); - my $parser = PKI::Base::Registry->get_parser(); - my $cfg = PKI::Base::Registry->get_config(); - - my %context; - my $result = $parser->execute_file_with_context("ee/user/user.vm", - \%context); - - my $xml = $q->param('xml'); - if ($xml eq "true") { - print "Content-Type: text/xml\n\n"; - print $self->xml_output(\%context); - } else { - print "Content-Type: text/html\n\n"; - print "$result"; - } -} - -my $op = op->new(); -$op->execute(); |