summaryrefslogtreecommitdiffstats
path: root/base/tps/forms/esc/cgi-bin/sow
diff options
context:
space:
mode:
Diffstat (limited to 'base/tps/forms/esc/cgi-bin/sow')
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/ajax-list.cgi79
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/cfg.pl174
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/enroll.cgi246
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi246
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/format.cgi207
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/formatso.cgi207
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/index.cgi42
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/is_agent.cgi69
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/is_user.cgi71
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/main.cgi70
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/noaccess.cgi56
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/read.cgi128
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/read_temp.cgi125
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/search.cgi70
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/search_temp.cgi70
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/seturl.cgi207
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/welcome.cgi57
17 files changed, 0 insertions, 2124 deletions
diff --git a/base/tps/forms/esc/cgi-bin/sow/ajax-list.cgi b/base/tps/forms/esc/cgi-bin/sow/ajax-list.cgi
deleted file mode 100755
index 0f4ac094f..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/ajax-list.cgi
+++ /dev/null
@@ -1,79 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-
-use CGI;
-use Mozilla::LDAP::Conn;
-use PKI::TPS::Common;
-
-[REQUIRE_CFG_PL]
-
-sub main()
-{
-
- my $q = new CGI;
-
- my $host = get_ldap_host();
- my $port = get_ldap_port();
- my $secureconn = get_ldap_secure();
- my $basedn = get_base_dn();
- my $certdir = get_ldap_certdir();
-
- my $letters = $q->param('letters');
- if ($letters eq "") {
- # HACK: ajax.js posts parameters into POST URL
- $letters = $ENV{'QUERY_STRING'};
- $letters =~ s/.*letters=//g;
- $letters =~ s/\+/ /g;
- }
-
- my $result = "";
-
- print "Content-Type: text/html\n\n";
-
- my $conn = PKI::TPS::Common::make_connection(
- {host => $host, port => $port, cert => $certdir},
- $secureconn);
-
- return if (!$conn);
-
- my $entry = $conn->search ( { base =>$basedn,
- scope => "sub",
- filter => "cn=$letters*",
- attrsonly => 0,
- attrs => qw(cn uid),
- sortattrs => qw(cn)}
- );
-
- while ($entry) {
- my $cn = ($entry->getValues("cn"))[0] || "";
- my $uid = ($entry->getValues("uid"))[0] || "";
- $result .= $uid . "###" . $cn . "|";
- $entry $conn->nextEntry();
- }
-
- $conn->close();
-
- print $result;
-}
-
-&main();
diff --git a/base/tps/forms/esc/cgi-bin/sow/cfg.pl b/base/tps/forms/esc/cgi-bin/sow/cfg.pl
deleted file mode 100755
index d616fa136..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/cfg.pl
+++ /dev/null
@@ -1,174 +0,0 @@
-#! /usr/bin/perl
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-
-use Mozilla::LDAP::Conn;
-use PKI::TPS::Common;
-
-#
-# Feel free to modify the following parameters:
-#
-my $ldapHost = "localhost";
-my $ldapPort = "389";
-my $basedn = "ou=People,dc=sfbay,dc=redhat,dc=com";
-my $port = "7888";
-my $secure_port = "7889";
-my $host = "localhost";
-
-my $cfg = "/var/lib/pki-tps/conf/CS.cfg";
-
-sub get_ldap_host()
-{
- my $ldapport = `grep auth.instance.0.hostport $cfg | cut -c26-`;
- chomp($ldapport);
- my ($ldapHost, $p) = split(/:/, $ldapport);
- return $ldapHost;
-}
-
-sub get_ldap_port()
-{
- my $ldapport = `grep auth.instance.0.hostport $cfg | cut -c26-`;
- chomp($ldapport);
- my ($p, $ldapPort) = split(/:/, $ldapport);
- return $ldapPort;
-}
-
-sub get_ldap_secure()
-{
- my $ldapsecure = `grep auth.instance.0.ssl $cfg | cut -c21-`;
- chomp($ldapsecure);
- return $ldapsecure;
-}
-
-sub get_ldap_certdir()
-{
- my $ldapcertdir = `grep service.instanceDir $cfg | cut -c21-`;
- chomp($ldapcertdir);
- return $ldapcertdir . "/alias";
-}
-
-sub get_base_dn()
-{
- my $basedn = `grep auth.instance.0.baseDN $cfg | cut -c24-`;
- chomp($basedn);
- return $basedn;
-}
-
-sub get_port()
-{
- my $port = `grep service.unsecurePort $cfg | cut -c22-`;
- chomp($port);
- return $port;
-}
-
-sub get_secure_port()
-{
- my $secure_port = `grep service.securePort $cfg | cut -c20-`;
- chomp($secure_port);
- return $secure_port;
-}
-
-sub get_host()
-{
- my $host = `grep service.machineName $cfg | cut -c21-`;
- chomp($host);
- return $host;
-}
-
-sub is_agent()
-{
- my ($dn) = @_;
-
- my $uid = $dn;
- # need to map a subject dn into user DN
- $uid =~ /uid=([^,]*)/; # retrieve the uid
- $uid = $1;
-
- my $x_hostport = `grep -e "^tokendb.hostport" $cfg | cut -c18-`;
- chomp($x_hostport);
- my ($x_host, $x_port) = split(/:/, $x_hostport);
-
- my $x_secureconn = `grep -e "^tokendb.ssl" $cfg | cut -c13-`;
- chomp($x_secureconn);
- my $x_basedn = `grep -e "^tokendb.userBaseDN" $cfg | cut -c20-`;
- chomp($x_basedn);
- my $x_binddn = `grep -e "^tokendb.bindDN" $cfg | cut -c16-`;
- chomp($x_binddn);
- my $x_bindpwdpath = `grep -e "^tokendb.bindPassPath" $cfg | cut -c22-`;
- chomp($x_bindpwdpath);
- my $x_bindpwd = `grep -e "^tokendbBindPass" $x_bindpwdpath | cut -c17-`;
- chomp($x_bindpwd);
-
- my $ldap = PKI::TPS::Common::make_connection(
- {host => $x_host, port => $x_port, pswd => $x_bindpwd, bind => $x_binddn, cert => $x_certdir},
- $x_secureconn);
-
- return 0 if (! $ldap);
-
- my $entry = $ldap->search ( "cn=TUS Officers,ou=Groups,$x_basedn",
- "sub",
- "uid=$uid",
- 0
- );
-
- $ldap->close();
-
- if ($entry) {
- return 1;
- }
- return 0;
-}
-
-sub is_user()
-{
- my ($dn) = @_;
-
- my $uid = $dn;
- # need to map a subject dn into user DN
- $uid =~ /uid=([^,]*)/; # retrieve the uid
- $uid = $1;
-
- my $x_host = get_ldap_host();
- my $x_port = get_ldap_port();
- my $x_secureconn = get_ldap_secure();
- my $x_basedn = get_base_dn();
- my $x_certdir = get_ldap_certdir();
-
- my $ldap = PKI::TPS::Common::make_connection(
- {host => $x_host, port => $x_port, cert => $x_certdir},
- $x_secureconn);
-
- return 0 if (! $ldap);
-
- my $entry = $ldap->search ( "ou=people,$x_basedn",
- "sub",
- "uid=$uid",
- 0
- );
-
- $ldap->close();
-
- if ($entry) {
- return 1;
- }
- return 0;
-}
-
diff --git a/base/tps/forms/esc/cgi-bin/sow/enroll.cgi b/base/tps/forms/esc/cgi-bin/sow/enroll.cgi
deleted file mode 100755
index 8a6431e52..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/enroll.cgi
+++ /dev/null
@@ -1,246 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-########################################################################
-#
-# Script: esc.cgi
-# Author: Kin Blas ()
-# Date: 12/19/2003
-#
-# CGI.pm Docs:
-#
-# http://stein.cshl.org/WWW/software/CGI/
-#
-########################################################################
-
-[REQUIRE_CFG_PL]
-
-use CGI;
-use Mozilla::LDAP::Conn;
-use PKI::TPS::Common;
-
-$gQuery = new CGI;
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoPage
-{
- if (!&authorize()) {
- print $gQuery->redirect("/cgi-bin/sow/noaccess.cgi");
- return;
- }
-
- $gQueryAction = "default";
- $gQueryOverrideAction = "default";
-
- @gCookieNames = ("ascScreenName",
- "ascSubscriptionType",
- "ascBindings");
-
- $gQueryAction = $gQuery->param("action") if
- (defined $gQuery->param("action"));
-
- $gQueryOverrideAction = $gQuery->param("override_action")
- if (defined $gQuery->param("override_action"));
-
- if ($gQueryOverrideAction ne "default")
- {
- $gQueryAction = $gQueryOverrideAction;
- }
-
-########################################################################
-#
-# If no action was provided, we default to showing our
-# admin page!
-#
-# http://www.foo.com/esc.cgi
-#
-########################################################################
-
- if ($gQueryAction eq "default")
- {
- GenerateEnrollmentPage();
- exit 0;
- }
-}
-
-sub ExitError
-{
- my($str) = @_;
- print $gQuery->header(), $gQuery->start_html(), $str, $gQuery->end_html();
- exit 0;
-}
-
-sub GetScreenName
-{
- my $sn = "";
-
- if (defined $gQuery->param("screenname"))
- {
- $sn = $gQuery->param("screenname");
- } else {
- $sn = "default";
- }
-
- return $sn;
-}
-
-sub GetKeyType
-{
- my $keyType = 0;
-
- if (defined $gQuery->param("keytype"))
- {
- $keyType = $gQuery->param("keytype");
- }
-
- return $keyType;
-}
-
-sub GetKeyID
-{
- my $keyID = "";
-
- if (defined $gQuery->param("keyid"))
- {
- $keyID = $gQuery->param("keyid");
- }
-
- return $keyID;
-}
-
-sub GetKeyLabelArg
-{
- my $keyLabel = "";
-
- if (defined $gQuery->param("keylabel"))
- {
- $keyLabel = $gQuery->param("keylabel");
- }
-
- return $keyLabel;
-}
-
-sub HaveScreenName
-{
- return 1 if (GetScreenName() ne "");
- return 0;
-}
-
-sub IsSubscriber
-{
- my $subType = $gUserObj{'SUBSCRIPTION'};
- return 1 if ($subType eq "HouseKey" || $subType eq "NetKey");
-
- return 0;
-}
-
-sub GetNextAction
-{
- my($nextActn) = "default";
-
- if (defined $gQuery->param('nextaction'))
- {
- $nextActn = $gQuery->param('nextaction');
- }
- elsif (defined $gQuery->param('action'))
- {
- $nextActn = $gQuery->param('action');
- }
-
- return $nextActn;
-}
-
-sub GenerateEnrollmentPage
-{
- my ($l);
- my $ldap_host = get_ldap_host();
- my $ldap_port = get_ldap_port();
- my $secureconn = get_ldap_secure();
- my $basedn = get_base_dn();
- my $port = get_port();
- my $host = get_host();
- my $secure_port = get_secure_port();
- my $certdir = get_ldap_certdir();
-
- ExitError("Failed to load enrollment page!") if (!open(ENROLL_FILE, "< enroll.html"));
-
- print $gQuery->header();
-
- my $uid = $gQuery->param("uid");
-
- my $conn = PKI::TPS::Common::make_connection(
- {host => $ldap_host, port => $ldap_port, cert => $certdir},
- $secureconn);
-
- ExitError("Failed to connect to the database. $msg") if (!$conn);
-
- my $entry = $conn->search ( $basedn,
- "sub",
- "uid=$uid",
- 0
- );
-
- if (!$entry) {
- $conn->close();
- ExitError("User $uid not found");
- }
-
- my $givenName = ($entry->getValues("givenName"))[0] || "-";
- my $cn = ($entry->getValues("cn"))[0] || "-";
- my $sn = ($entry->getValues("sn"))[0] ||"-";
- $uid = ($entry->getValues("uid"))[0] || "-";
- my $mail = ($entry->getValues("mail"))[0] || "-";
- my $phone = ($entry->getValues("telephoneNumber"))[0] || "-";
- my $departmentNumber = ($entry->getValues("departmentNumber"))[0] || "";
- my $employeeNumber = ($entry->getValues("employeeNumber"))[0] || "";
-
- while ($l = <ENROLL_FILE>)
- {
- $l =~ s/\$mail/$mail/g;
- $l =~ s/\$uid/$uid/g;
- $l =~ s/\$givenName/$givenName/g;
- $l =~ s/\$sn/$sn/g;
- $l =~ s/\$cn/$cn/g;
- $l =~ s/\$phone/$phone/g;
- $l =~ s/\$departmentNumber/$departmentNumber/g;
- $l =~ s/\$employeeNumber/$employeeNumber/g;
- $l =~ s/\$host/$host/g;
- $l =~ s/\$port/$port/g;
- $l =~ s/\$secure_port/$secure_port/g;
- print $l;
- }
-
- close(ENROLL_FILE);
-}
-
-&DoPage();
diff --git a/base/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi b/base/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi
deleted file mode 100755
index 5817039a2..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi
+++ /dev/null
@@ -1,246 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-########################################################################
-#
-# Script: esc.cgi
-# Author: Kin Blas ()
-# Date: 12/19/2003
-#
-# CGI.pm Docs:
-#
-# http://stein.cshl.org/WWW/software/CGI/
-#
-########################################################################
-
-[REQUIRE_CFG_PL]
-
-use CGI;
-use Mozilla::LDAP::Conn;
-use PKI::TPS::Common;
-
-$gQuery = new CGI;
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoPage
-{
- if (!&authorize()) {
- print $gQuery->redirect("/cgi-bin/sow/noaccess.cgi");
- return;
- }
-
- $gQueryAction = "default";
- $gQueryOverrideAction = "default";
-
- @gCookieNames = ("ascScreenName",
- "ascSubscriptionType",
- "ascBindings");
-
- $gQueryAction = $gQuery->param("action") if
- (defined $gQuery->param("action"));
-
- $gQueryOverrideAction = $gQuery->param("override_action")
- if (defined $gQuery->param("override_action"));
-
- if ($gQueryOverrideAction ne "default")
- {
- $gQueryAction = $gQueryOverrideAction;
- }
-
-########################################################################
-#
-# If no action was provided, we default to showing our
-# admin page!
-#
-# http://www.foo.com/esc.cgi
-#
-########################################################################
-
- if ($gQueryAction eq "default")
- {
- GenerateEnrollmentPage();
- exit 0;
- }
-}
-
-sub ExitError
-{
- my($str) = @_;
- print $gQuery->header(), $gQuery->start_html(), $str, $gQuery->end_html();
- exit 0;
-}
-
-sub GetScreenName
-{
- my $sn = "";
-
- if (defined $gQuery->param("screenname"))
- {
- $sn = $gQuery->param("screenname");
- } else {
- $sn = "default";
- }
-
- return $sn;
-}
-
-sub GetKeyType
-{
- my $keyType = 0;
-
- if (defined $gQuery->param("keytype"))
- {
- $keyType = $gQuery->param("keytype");
- }
-
- return $keyType;
-}
-
-sub GetKeyID
-{
- my $keyID = "";
-
- if (defined $gQuery->param("keyid"))
- {
- $keyID = $gQuery->param("keyid");
- }
-
- return $keyID;
-}
-
-sub GetKeyLabelArg
-{
- my $keyLabel = "";
-
- if (defined $gQuery->param("keylabel"))
- {
- $keyLabel = $gQuery->param("keylabel");
- }
-
- return $keyLabel;
-}
-
-sub HaveScreenName
-{
- return 1 if (GetScreenName() ne "");
- return 0;
-}
-
-sub IsSubscriber
-{
- my $subType = $gUserObj{'SUBSCRIPTION'};
- return 1 if ($subType eq "HouseKey" || $subType eq "NetKey");
-
- return 0;
-}
-
-sub GetNextAction
-{
- my($nextActn) = "default";
-
- if (defined $gQuery->param('nextaction'))
- {
- $nextActn = $gQuery->param('nextaction');
- }
- elsif (defined $gQuery->param('action'))
- {
- $nextActn = $gQuery->param('action');
- }
-
- return $nextActn;
-}
-
-sub GenerateEnrollmentPage
-{
- my ($l);
- my $ldap_host = get_ldap_host();
- my $ldap_port = get_ldap_port();
- my $secureconn = get_ldap_secure();
- my $basedn = get_base_dn();
- my $port = get_port();
- my $host = get_host();
- my $secure_port = get_secure_port();
- my $certdir = get_ldap_certdir();
-
- ExitError("Failed to load enrollment page!") if (!open(ENROLL_FILE, "< enroll_temp.html"));
-
- print $gQuery->header();
-
- my $uid = $gQuery->param("uid");
-
- my $conn = PKI::TPS::Common::make_connection(
- {host => $ldap_host, port => $ldap_port, cert => $certdir},
- $secureconn);
-
- ExitError("Failed to connect to the database. $msg") if (!$conn);
-
- my $entry = $conn->search ( $basedn,
- "sub",
- "uid=$uid",
- 0
- );
-
- if (!$entry) {
- $conn->close();
- ExitError("User $uid not found");
- }
-
- my $givenName = ($entry->getValues("givenName"))[0] || "-";
- my $cn = ($entry->getValues("cn"))[0] || "-";
- my $sn = ($entry->getValues("sn"))[0] ||"-";
- $uid = ($entry->getValues("uid"))[0] || "-";
- my $mail = ($entry->getValues("mail"))[0] || "-";
- my $phone = ($entry->getValues("telephoneNumber"))[0] || "-";
- my $departmentNumber = ($entry->getValues("departmentNumber"))[0] || "";
- my $employeeNumber = ($entry->getValues("employeeNumber"))[0] || "";
-
- while ($l = <ENROLL_FILE>)
- {
- $l =~ s/\$mail/$mail/g;
- $l =~ s/\$uid/$uid/g;
- $l =~ s/\$givenName/$givenName/g;
- $l =~ s/\$sn/$sn/g;
- $l =~ s/\$cn/$cn/g;
- $l =~ s/\$phone/$phone/g;
- $l =~ s/\$departmentNumber/$departmentNumber/g;
- $l =~ s/\$employeeNumber/$employeeNumber/g;
- $l =~ s/\$host/$host/g;
- $l =~ s/\$port/$port/g;
- $l =~ s/\$secure_port/$secure_port/g;
- print $l;
- }
-
- close(ENROLL_FILE);
-}
-
-&DoPage();
diff --git a/base/tps/forms/esc/cgi-bin/sow/format.cgi b/base/tps/forms/esc/cgi-bin/sow/format.cgi
deleted file mode 100755
index 9b310991d..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/format.cgi
+++ /dev/null
@@ -1,207 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-########################################################################
-#
-# Script: esc.cgi
-# Author: Kin Blas ()
-# Date: 12/19/2003
-#
-# CGI.pm Docs:
-#
-# http://stein.cshl.org/WWW/software/CGI/
-#
-########################################################################
-
-[REQUIRE_CFG_PL]
-
-use CGI;
-
-my $ldapHost = get_ldap_host();
-my $ldapPort = get_ldap_port();
-my $basedn = get_base_dn();
-my $host = get_host();
-my $port = get_port();
-my $secure_port = get_secure_port();
-
-$gQuery = new CGI;
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoPage
-{
- if (!&authorize()) {
- print $gQuery->redirect("/cgi-bin/sow/noaccess.cgi");
- return;
- }
-
- $gQueryAction = "default";
- $gQueryOverrideAction = "default";
-
- @gCookieNames = ("ascScreenName",
- "ascSubscriptionType",
- "ascBindings");
-
- $gQueryAction = $gQuery->param("action") if
- (defined $gQuery->param("action"));
-
- $gQueryOverrideAction = $gQuery->param("override_action")
- if (defined $gQuery->param("override_action"));
-
- if ($gQueryOverrideAction ne "default")
- {
- $gQueryAction = $gQueryOverrideAction;
- }
-
-########################################################################
-#
-# If no action was provided, we default to showing our
-# admin page!
-#
-# http://www.foo.com/esc.cgi
-#
-########################################################################
-
- if ($gQueryAction eq "default")
- {
- GeneratePage();
- exit 0;
- }
-}
-
-sub ExitError
-{
- my($str) = @_;
- print $gQuery->header(), $gQuery->start_html(), $str, $gQuery->end_html();
- exit 0;
-}
-
-sub GetScreenName
-{
- my $sn = "";
-
- if (defined $gQuery->param("screenname"))
- {
- $sn = $gQuery->param("screenname");
- } else {
- $sn = "default";
- }
-
- return $sn;
-}
-
-sub GetKeyType
-{
- my $keyType = 0;
-
- if (defined $gQuery->param("keytype"))
- {
- $keyType = $gQuery->param("keytype");
- }
-
- return $keyType;
-}
-
-sub GetKeyID
-{
- my $keyID = "";
-
- if (defined $gQuery->param("keyid"))
- {
- $keyID = $gQuery->param("keyid");
- }
-
- return $keyID;
-}
-
-sub GetKeyLabelArg
-{
- my $keyLabel = "";
-
- if (defined $gQuery->param("keylabel"))
- {
- $keyLabel = $gQuery->param("keylabel");
- }
-
- return $keyLabel;
-}
-
-sub HaveScreenName
-{
- return 1 if (GetScreenName() ne "");
- return 0;
-}
-
-sub IsSubscriber
-{
- my $subType = $gUserObj{'SUBSCRIPTION'};
- return 1 if ($subType eq "HouseKey" || $subType eq "NetKey");
-
- return 0;
-}
-
-sub GetNextAction
-{
- my($nextActn) = "default";
-
- if (defined $gQuery->param('nextaction'))
- {
- $nextActn = $gQuery->param('nextaction');
- }
- elsif (defined $gQuery->param('action'))
- {
- $nextActn = $gQuery->param('action');
- }
-
- return $nextActn;
-}
-
-sub GeneratePage
-{
- my ($l);
-
- ExitError("Failed to load enrollment page!") if (!open(ENROLL_FILE, "< format.html"));
-
- print $gQuery->header();
-
- while ($l = <ENROLL_FILE>)
- {
- $l =~ s/\$host/$host/g;
- $l =~ s/\$port/$port/g;
- $l =~ s/\$secure_port/$secure_port/g;
- print $l;
- }
-
- close(ENROLL_FILE);
-}
-
-&DoPage();
diff --git a/base/tps/forms/esc/cgi-bin/sow/formatso.cgi b/base/tps/forms/esc/cgi-bin/sow/formatso.cgi
deleted file mode 100755
index d53129139..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/formatso.cgi
+++ /dev/null
@@ -1,207 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-########################################################################
-#
-# Script: esc.cgi
-# Author: Kin Blas ()
-# Date: 12/19/2003
-#
-# CGI.pm Docs:
-#
-# http://stein.cshl.org/WWW/software/CGI/
-#
-########################################################################
-
-[REQUIRE_CFG_PL]
-
-use CGI;
-
-my $ldapHost = get_ldap_host();
-my $ldapPort = get_ldap_port();
-my $basedn = get_base_dn();
-my $host = get_host();
-my $port = get_port();
-my $secure_port = get_secure_port();
-
-$gQuery = new CGI;
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoPage
-{
- if (!&authorize()) {
- print $gQuery->redirect("/cgi-bin/sow/noaccess.cgi");
- return;
- }
-
- $gQueryAction = "default";
- $gQueryOverrideAction = "default";
-
- @gCookieNames = ("ascScreenName",
- "ascSubscriptionType",
- "ascBindings");
-
- $gQueryAction = $gQuery->param("action") if
- (defined $gQuery->param("action"));
-
- $gQueryOverrideAction = $gQuery->param("override_action")
- if (defined $gQuery->param("override_action"));
-
- if ($gQueryOverrideAction ne "default")
- {
- $gQueryAction = $gQueryOverrideAction;
- }
-
-########################################################################
-#
-# If no action was provided, we default to showing our
-# admin page!
-#
-# http://www.foo.com/esc.cgi
-#
-########################################################################
-
- if ($gQueryAction eq "default")
- {
- GeneratePage();
- exit 0;
- }
-}
-
-sub ExitError
-{
- my($str) = @_;
- print $gQuery->header(), $gQuery->start_html(), $str, $gQuery->end_html();
- exit 0;
-}
-
-sub GetScreenName
-{
- my $sn = "";
-
- if (defined $gQuery->param("screenname"))
- {
- $sn = $gQuery->param("screenname");
- } else {
- $sn = "default";
- }
-
- return $sn;
-}
-
-sub GetKeyType
-{
- my $keyType = 0;
-
- if (defined $gQuery->param("keytype"))
- {
- $keyType = $gQuery->param("keytype");
- }
-
- return $keyType;
-}
-
-sub GetKeyID
-{
- my $keyID = "";
-
- if (defined $gQuery->param("keyid"))
- {
- $keyID = $gQuery->param("keyid");
- }
-
- return $keyID;
-}
-
-sub GetKeyLabelArg
-{
- my $keyLabel = "";
-
- if (defined $gQuery->param("keylabel"))
- {
- $keyLabel = $gQuery->param("keylabel");
- }
-
- return $keyLabel;
-}
-
-sub HaveScreenName
-{
- return 1 if (GetScreenName() ne "");
- return 0;
-}
-
-sub IsSubscriber
-{
- my $subType = $gUserObj{'SUBSCRIPTION'};
- return 1 if ($subType eq "HouseKey" || $subType eq "NetKey");
-
- return 0;
-}
-
-sub GetNextAction
-{
- my($nextActn) = "default";
-
- if (defined $gQuery->param('nextaction'))
- {
- $nextActn = $gQuery->param('nextaction');
- }
- elsif (defined $gQuery->param('action'))
- {
- $nextActn = $gQuery->param('action');
- }
-
- return $nextActn;
-}
-
-sub GeneratePage
-{
- my ($l);
-
- ExitError("Failed to load enrollment page!") if (!open(ENROLL_FILE, "< formatso.html"));
-
- print $gQuery->header();
-
- while ($l = <ENROLL_FILE>)
- {
- $l =~ s/\$host/$host/g;
- $l =~ s/\$port/$port/g;
- $l =~ s/\$secure_port/$secure_port/g;
- print $l;
- }
-
- close(ENROLL_FILE);
-}
-
-&DoPage();
diff --git a/base/tps/forms/esc/cgi-bin/sow/index.cgi b/base/tps/forms/esc/cgi-bin/sow/index.cgi
deleted file mode 100755
index 7f7a98869..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/index.cgi
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/perl
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-#
-#
-#
-print "Content-type: text/xml\n\n";
-print "<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>";
-print "<ServiceInfo>";
-print "<IssuerName>";
-print "Fedora Project"; # Vendor
-print "</IssuerName>\n";
-print "<Services>";
-print "<Operation>";
-print "https://[SERVER_NAME]:[SECURE_PORT]/nk_service";
-print "</Operation>";
-print "<UI>";
-print "https://[SERVER_NAME]:[SECURE_PORT]/cgi-bin/sow/search.cgi";
-print "</UI>";
-print "<EnrolledTokenBrowserURL>";
-print "</EnrolledTokenBrowserURL>";
-print "</Services>";
-print "</ServiceInfo>";
diff --git a/base/tps/forms/esc/cgi-bin/sow/is_agent.cgi b/base/tps/forms/esc/cgi-bin/sow/is_agent.cgi
deleted file mode 100755
index c6b6a87f7..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/is_agent.cgi
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-
-use CGI;
-
-[REQUIRE_CFG_PL]
-
-
-my $ldapHost = get_ldap_host();
-my $ldapPort = get_ldap_port();
-my $basedn = get_base_dn();
-
-my $q = new CGI;
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoIsAgent
-{
-
- print "Content-type: text/xml\n\n";
-
- if (!&authorize()) {
- return;
- }
-
- my $uid = $q->param('uid');
-
- if(&is_agent("uid=$uid"))
- {
- print "<response>yes</response>\n";
- }
- else
- {
- print "<response>no</response>\n";
- }
-
-}
-
-&DoIsAgent();
diff --git a/base/tps/forms/esc/cgi-bin/sow/is_user.cgi b/base/tps/forms/esc/cgi-bin/sow/is_user.cgi
deleted file mode 100755
index d7a551421..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/is_user.cgi
+++ /dev/null
@@ -1,71 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-
-use CGI;
-
-use CGI::Carp qw(fatalsToBrowser);
-
-[REQUIRE_CFG_PL]
-
-
-my $ldapHost = get_ldap_host();
-my $ldapPort = get_ldap_port();
-my $basedn = get_base_dn();
-
-my $q = new CGI;
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoIsUser
-{
-
- print "Content-type: text/xml\n\n";
-
- if (!&authorize()) {
- return;
- }
-
- my $uid = $q->param('uid');
-
- if(&is_user("uid=$uid"))
- {
- print "<response>yes</response>\n";
- }
- else
- {
- print "<response>no</response>\n";
- }
-
-}
-
-&DoIsUser();
diff --git a/base/tps/forms/esc/cgi-bin/sow/main.cgi b/base/tps/forms/esc/cgi-bin/sow/main.cgi
deleted file mode 100755
index c6f65e42e..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/main.cgi
+++ /dev/null
@@ -1,70 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-
-use CGI;
-
-[REQUIRE_CFG_PL]
-
-
-my $ldapHost = get_ldap_host();
-my $ldapPort = get_ldap_port();
-my $basedn = get_base_dn();
-
-my $q = new CGI;
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoPage
-{
- if (!&authorize()) {
- print $q->redirect("/cgi-bin/sow/noaccess.cgi");
- return;
- }
-
- my $error = $q->param('error');
- $error = "" if !defined $error;
-
- open(FILE, "< main.html");
-
- print $q->header();
-
- while ($l = <FILE>)
- {
- $l =~ s/\$error/$error/g;
- print $l;
- }
-
- close(FILE);
-}
-
-&DoPage();
diff --git a/base/tps/forms/esc/cgi-bin/sow/noaccess.cgi b/base/tps/forms/esc/cgi-bin/sow/noaccess.cgi
deleted file mode 100755
index 17166bcb6..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/noaccess.cgi
+++ /dev/null
@@ -1,56 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-
-use CGI;
-
-[REQUIRE_CFG_PL]
-
-
-my $host = get_host();
-my $secure_port = get_secure_port();
-my $port = get_port();
-
-my $q = new CGI;
-
-sub DoPage
-{
-
- my $error = $q->param('error');
-
- open(FILE, "< noaccess.html");
-
- print $q->header();
-
- while ($l = <FILE>)
- {
- $l =~ s/\$error/$error/g;
- $l =~ s/\$host/$host/g;
- $l =~ s/\$secure_port/$secure_port/g;
- $l =~ s/\$port/$port/g;
- print $l;
- }
-
- close(FILE);
-}
-
-&DoPage();
diff --git a/base/tps/forms/esc/cgi-bin/sow/read.cgi b/base/tps/forms/esc/cgi-bin/sow/read.cgi
deleted file mode 100755
index 8a5793c2b..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/read.cgi
+++ /dev/null
@@ -1,128 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-
-use CGI;
-use Mozilla::LDAP::Conn;
-use PKI::TPS::Common;
-
-[REQUIRE_CFG_PL]
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoPage
-{
- my $q = new CGI;
- my $host = get_ldap_host();
- my $port = get_ldap_port();
- my $secureconn = get_ldap_secure();
- my $basedn = get_base_dn();
- my $certdir = get_ldap_certdir();
-
- if (!&authorize()) {
- print $q->redirect("/cgi-bin/sow/noaccess.cgi");
- return;
- }
-
- my $name = $q->param('name');
- my $uid = $q->param('name_ID');
- $name = "" if !defined $name;
-
- if ($name eq "") {
- print $q->redirect("/cgi-bin/sow/search.cgi?error=Name cannot be empty");
- return;
- }
-
- my $conn = PKI::TPS::Common::make_connection(
- {host => $host, port => $port, cert => $certdir},
- $secureconn);
-
- if (!$conn) {
- print $q->redirect("/cgi-bin/sow/search.cgi?error=Failed to connect to the database.");
- return;
- };
-
- my $entry = $conn->search ( $basedn,
- "sub",
- "cn=$name",
- 0
- );
-
- if (!$entry) {
- $conn->close();
- print $q->redirect("/cgi-bin/sow/search.cgi?error=User $name not found");
- return;
- }
-
- my $givenName = ($entry->getValues("givenName"))[0] || "-";
- my $cn = ($entry->getValues("cn"))[0] || "-";
- my $sn = ($entry->getValues("sn"))[0] ||"-";
- $uid = ($entry->getValues("uid"))[0] || "-";
- my $mail = ($entry->getValues("mail"))[0] || "-";
- my $phone = ($entry->getValues("telephoneNumber"))[0] || "-";
- my $photoLarge = ($entry->getValues("photoLarge"))[0] || ""; # photo (full size)
- my $photoSmall = ($entry->getValues("photoSmall"))[0] || ""; # photo (thumb)
- my $height = ($entry->getValues("height"))[0] || "";
- my $weight = ($entry->getValues("weight"))[0] || "";
- my $eyecolor = ($entry->getValues("eyeColor"))[0] || "";
-
- $conn->close();
-
- if ($uid eq "-") {
- print $q->redirect("/cgi-bin/sow/search.cgi?error=User $name not found");
- return;
- }
-
- open(FILE, "< read.html");
-
- print $q->header();
-
- while ($l = <FILE>)
- {
- $l =~ s/\$mail/$mail/g;
- $l =~ s/\$uid/$uid/g;
- $l =~ s/\$givenName/$givenName/g;
- $l =~ s/\$sn/$sn/g;
- $l =~ s/\$cn/$cn/g;
- $l =~ s/\$phone/$phone/g;
- $l =~ s/\$photoLarge/$photoLarge/g;
- $l =~ s/\$photoSmall/$photoSmall/g;
- $l =~ s/\$height/$height/g;
- $l =~ s/\$weight/$weight/g;
- $l =~ s/\$eyecolor/$eyecolor/g;
- print $l;
- }
-
- close(FILE);
-}
-
-&DoPage();
diff --git a/base/tps/forms/esc/cgi-bin/sow/read_temp.cgi b/base/tps/forms/esc/cgi-bin/sow/read_temp.cgi
deleted file mode 100755
index 31c6fd7e3..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/read_temp.cgi
+++ /dev/null
@@ -1,125 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-
-use CGI;
-use Mozilla::LDAP::Conn;
-use PKI::TPS::Common;
-
-[REQUIRE_CFG_PL]
-
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoPage
-{
- my $q = new CGI;
- my $host = get_ldap_host();
- my $port = get_ldap_port();
- my $secureconn = get_ldap_secure();
- my $basedn = get_base_dn();
- my $certdir = get_ldap_certdir();
-
- if (!&authorize()) {
- print $q->redirect("/cgi-bin/sow/noaccess.cgi");
- return;
- }
-
- my $name = $q->param('name');
- my $uid = $q->param('name_ID');
- $name = "" if !defined $name;
-
- if ($name eq "") {
- print $q->redirect("/cgi-bin/sow/search.cgi?error=Name cannot be empty");
- return;
- }
-
- my $conn = PKI::TPS::Common::make_connection(
- {host => $host, port => $port, cert => $certdir},
- $secureconn);
-
-
- my $entry = $conn->search ( $basedn,
- "sub",
- "cn=$name",
- 0
- );
-
- if (!$entry) {
- $conn->close();
- print $q->redirect("/cgi-bin/sow/search.cgi?error=User $name not found");
- return;
- }
-
- my $givenName = ($entry->getValues("givenName"))[0] || "-";
- my $cn = ($entry->getValues("cn"))[0] || "-";
- my $sn = ($entry->getValues("sn"))[0] ||"-";
- $uid = ($entry->getValues("uid"))[0] || "-";
- my $mail = ($entry->getValues("mail"))[0] || "-";
- my $phone = ($entry->getValues("telephoneNumber"))[0] || "-";
- my $photoLarge = ($entry->getValues("photoLarge"))[0] || ""; # photo (full size)
- my $photoSmall = ($entry->getValues("photoSmall"))[0] || ""; # photo (thumb)
- my $height = ($entry->getValues("height"))[0] || "";
- my $weight = ($entry->getValues("weight"))[0] || "";
- my $eyecolor = ($entry->getValues("eyeColor"))[0] || "";
-
- $conn->close();
-
- if ($uid eq "-") {
- print $q->redirect("/cgi-bin/sow/search.cgi?error=User $name not found");
- return;
- }
-
- open(FILE, "< read_temp.html");
-
- print $q->header();
-
- while ($l = <FILE>)
- {
- $l =~ s/\$mail/$mail/g;
- $l =~ s/\$uid/$uid/g;
- $l =~ s/\$givenName/$givenName/g;
- $l =~ s/\$sn/$sn/g;
- $l =~ s/\$cn/$cn/g;
- $l =~ s/\$phone/$phone/g;
- $l =~ s/\$photoLarge/$photoLarge/g;
- $l =~ s/\$photoSmall/$photoSmall/g;
- $l =~ s/\$height/$height/g;
- $l =~ s/\$weight/$weight/g;
- $l =~ s/\$eyecolor/$eyecolor/g;
- print $l;
- }
-
- close(FILE);
-}
-
-&DoPage();
diff --git a/base/tps/forms/esc/cgi-bin/sow/search.cgi b/base/tps/forms/esc/cgi-bin/sow/search.cgi
deleted file mode 100755
index e681ed100..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/search.cgi
+++ /dev/null
@@ -1,70 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-
-use CGI;
-
-[REQUIRE_CFG_PL]
-
-
-my $ldapHost = get_ldap_host();
-my $ldapPort = get_ldap_port();
-my $basedn = get_base_dn();
-
-my $q = new CGI;
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoPage
-{
- if (!&authorize()) {
- print $q->redirect("/cgi-bin/sow/noaccess.cgi");
- return;
- }
-
- my $error = $q->param('error');
- $error = "" if !defined $error;
-
- open(FILE, "< search.html");
-
- print $q->header();
-
- while ($l = <FILE>)
- {
- $l =~ s/\$error/$error/g;
- print $l;
- }
-
- close(FILE);
-}
-
-&DoPage();
diff --git a/base/tps/forms/esc/cgi-bin/sow/search_temp.cgi b/base/tps/forms/esc/cgi-bin/sow/search_temp.cgi
deleted file mode 100755
index 5d752a49d..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/search_temp.cgi
+++ /dev/null
@@ -1,70 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-
-use CGI;
-
-[REQUIRE_CFG_PL]
-
-
-my $ldapHost = get_ldap_host();
-my $ldapPort = get_ldap_port();
-my $basedn = get_base_dn();
-
-my $q = new CGI;
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoPage
-{
- if (!&authorize()) {
- print $q->redirect("/cgi-bin/sow/noaccess.cgi");
- return;
- }
-
- my $error = $q->param('error');
- $error = "" if !defined $error;
-
- open(FILE, "< search_temp.html");
-
- print $q->header();
-
- while ($l = <FILE>)
- {
- $l =~ s/\$error/$error/g;
- print $l;
- }
-
- close(FILE);
-}
-
-&DoPage();
diff --git a/base/tps/forms/esc/cgi-bin/sow/seturl.cgi b/base/tps/forms/esc/cgi-bin/sow/seturl.cgi
deleted file mode 100755
index dfac46d8f..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/seturl.cgi
+++ /dev/null
@@ -1,207 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-########################################################################
-#
-# Script: esc.cgi
-# Author: Kin Blas ()
-# Date: 12/19/2003
-#
-# CGI.pm Docs:
-#
-# http://stein.cshl.org/WWW/software/CGI/
-#
-########################################################################
-
-[REQUIRE_CFG_PL]
-
-use CGI;
-
-my $ldapHost = get_ldap_host();
-my $ldapPort = get_ldap_port();
-my $basedn = get_base_dn();
-my $host = get_host();
-my $port = get_port();
-my $secure_port = get_secure_port();
-
-$gQuery = new CGI;
-
-sub authorize
-{
- my $client_dn = $ENV{'SSL_CLIENT_S_DN'};
- $client_dn =~ tr/A-Z/a-z/; # all lower cases
- $client_dn =~ s/\s+//g; # remove all spacing
-
- if (&is_agent($client_dn)) {
- return 1;
- }
- return 0;
-}
-
-sub DoPage
-{
- if (!&authorize()) {
- print $gQuery->redirect("/cgi-bin/sow/noaccess.cgi");
- return;
- }
-
- $gQueryAction = "default";
- $gQueryOverrideAction = "default";
-
- @gCookieNames = ("ascScreenName",
- "ascSubscriptionType",
- "ascBindings");
-
- $gQueryAction = $gQuery->param("action") if
- (defined $gQuery->param("action"));
-
- $gQueryOverrideAction = $gQuery->param("override_action")
- if (defined $gQuery->param("override_action"));
-
- if ($gQueryOverrideAction ne "default")
- {
- $gQueryAction = $gQueryOverrideAction;
- }
-
-########################################################################
-#
-# If no action was provided, we default to showing our
-# admin page!
-#
-# http://www.foo.com/esc.cgi
-#
-########################################################################
-
- if ($gQueryAction eq "default")
- {
- GeneratePage();
- exit 0;
- }
-}
-
-sub ExitError
-{
- my($str) = @_;
- print $gQuery->header(), $gQuery->start_html(), $str, $gQuery->end_html();
- exit 0;
-}
-
-sub GetScreenName
-{
- my $sn = "";
-
- if (defined $gQuery->param("screenname"))
- {
- $sn = $gQuery->param("screenname");
- } else {
- $sn = "default";
- }
-
- return $sn;
-}
-
-sub GetKeyType
-{
- my $keyType = 0;
-
- if (defined $gQuery->param("keytype"))
- {
- $keyType = $gQuery->param("keytype");
- }
-
- return $keyType;
-}
-
-sub GetKeyID
-{
- my $keyID = "";
-
- if (defined $gQuery->param("keyid"))
- {
- $keyID = $gQuery->param("keyid");
- }
-
- return $keyID;
-}
-
-sub GetKeyLabelArg
-{
- my $keyLabel = "";
-
- if (defined $gQuery->param("keylabel"))
- {
- $keyLabel = $gQuery->param("keylabel");
- }
-
- return $keyLabel;
-}
-
-sub HaveScreenName
-{
- return 1 if (GetScreenName() ne "");
- return 0;
-}
-
-sub IsSubscriber
-{
- my $subType = $gUserObj{'SUBSCRIPTION'};
- return 1 if ($subType eq "HouseKey" || $subType eq "NetKey");
-
- return 0;
-}
-
-sub GetNextAction
-{
- my($nextActn) = "default";
-
- if (defined $gQuery->param('nextaction'))
- {
- $nextActn = $gQuery->param('nextaction');
- }
- elsif (defined $gQuery->param('action'))
- {
- $nextActn = $gQuery->param('action');
- }
-
- return $nextActn;
-}
-
-sub GeneratePage
-{
- my ($l);
-
- ExitError("Failed to load enrollment page!") if (!open(ENROLL_FILE, "< seturl.html"));
-
- print $gQuery->header();
-
- while ($l = <ENROLL_FILE>)
- {
- $l =~ s/\$host/$host/g;
- $l =~ s/\$port/$port/g;
- $l =~ s/\$secure_port/$secure_port/g;
- print $l;
- }
-
- close(ENROLL_FILE);
-}
-
-&DoPage();
diff --git a/base/tps/forms/esc/cgi-bin/sow/welcome.cgi b/base/tps/forms/esc/cgi-bin/sow/welcome.cgi
deleted file mode 100755
index bc76dd3fa..000000000
--- a/base/tps/forms/esc/cgi-bin/sow/welcome.cgi
+++ /dev/null
@@ -1,57 +0,0 @@
-#! /usr/bin/perl -w
-#
-# --- BEGIN COPYRIGHT BLOCK ---
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; 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 ---
-#
-
-use CGI;
-
-[REQUIRE_CFG_PL]
-
-
-my $host = get_host();
-my $secure_port = get_secure_port();
-my $port = get_port();
-
-my $q = new CGI;
-
-sub DoPage
-{
-
- my $error = $q->param('error');
- $error = "" if !defined $error;
-
- open(FILE, "< welcome.html");
-
- print $q->header();
-
- while ($l = <FILE>)
- {
- $l =~ s/\$error/$error/g;
- $l =~ s/\$host/$host/g;
- $l =~ s/\$secure_port/$secure_port/g;
- $l =~ s/\$port/$port/g;
- print $l;
- }
-
- close(FILE);
-}
-
-&DoPage();