summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-11-21 20:20:55 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-11-22 03:11:25 -0500
commit5685366bab1cb72fc96855f450b162b6e1ae3aeb (patch)
tree480c37917813a344401019c2bef696f566608d8b
parent224c4c4f2a81404874d959acafa496fbdd6e4422 (diff)
downloadpki-5685366bab1cb72fc96855f450b162b6e1ae3aeb.zip
pki-5685366bab1cb72fc96855f450b162b6e1ae3aeb.tar.gz
pki-5685366bab1cb72fc96855f450b162b6e1ae3aeb.tar.xz
Merged TPS CGI scripts.
-rw-r--r--base/tps/CMakeLists.txt34
-rwxr-xr-xbase/tps/apache/cgi-bin/demo/enroll.cgi (renamed from base/tps/forms/esc/cgi-bin/demo/enroll.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/demo/index.cgi (renamed from base/tps/forms/esc/cgi-bin/demo/index.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/esc.cgi (renamed from base/tps/forms/esc/esc.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/home.cgi (renamed from base/tps/forms/esc/home.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/home/cachain.cgi (renamed from base/tps/forms/esc/cgi-bin/home/cachain.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/home/enroll.cgi (renamed from base/tps/forms/esc/cgi-bin/home/enroll.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/home/index.cgi (renamed from base/tps/forms/esc/cgi-bin/home/index.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/so/enroll.cgi (renamed from base/tps/forms/esc/cgi-bin/so/enroll.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/so/index.cgi (renamed from base/tps/forms/esc/cgi-bin/so/index.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/ajax-list.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/ajax-list.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/enroll.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/enroll.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/enroll_temp.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/format.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/format.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/formatso.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/formatso.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/index.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/index.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/is_agent.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/is_agent.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/is_user.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/is_user.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/main.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/main.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/noaccess.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/noaccess.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/read.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/read.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/read_temp.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/read_temp.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/search.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/search.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/search_temp.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/search_temp.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/seturl.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/seturl.cgi)0
-rwxr-xr-xbase/tps/apache/cgi-bin/sow/welcome.cgi (renamed from base/tps/forms/esc/cgi-bin/sow/welcome.cgi)0
-rwxr-xr-xbase/tps/apache/docroot/index.cgi (renamed from base/tps/forms/index.cgi)0
-rw-r--r--base/tps/apache/docroot/index.html (renamed from base/tps/forms/index.html)0
-rwxr-xr-xbase/tps/forms/esc/cgi-bin/sow/cfg.pl174
29 files changed, 10 insertions, 198 deletions
diff --git a/base/tps/CMakeLists.txt b/base/tps/CMakeLists.txt
index 4e6a922..6044a13 100644
--- a/base/tps/CMakeLists.txt
+++ b/base/tps/CMakeLists.txt
@@ -79,13 +79,6 @@ install(
install(
DIRECTORY
- forms/esc/cgi-bin
- DESTINATION
- ${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME}/${PROJECT_NAME}
-)
-
-install(
- DIRECTORY
apache/conf
DESTINATION
${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME}/${PROJECT_NAME}
@@ -105,23 +98,16 @@ install(
${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME}/${PROJECT_NAME}
)
-install(
- FILES
- forms/index.html
- DESTINATION
- ${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME}/${PROJECT_NAME}/docroot
-)
-
-install(
- FILES
- forms/index.cgi
- DESTINATION
- ${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME}/${PROJECT_NAME}/docroot
- PERMISSIONS
- OWNER_EXECUTE OWNER_WRITE OWNER_READ
- GROUP_EXECUTE GROUP_READ
- WORLD_EXECUTE WORLD_READ
-)
+# install(
+# FILES
+# apache/docroot/index.cgi
+# DESTINATION
+# ${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME}/${PROJECT_NAME}/docroot
+# PERMISSIONS
+# OWNER_EXECUTE OWNER_WRITE OWNER_READ
+# GROUP_EXECUTE GROUP_READ
+# WORLD_EXECUTE WORLD_READ
+# )
install(
DIRECTORY
diff --git a/base/tps/forms/esc/cgi-bin/demo/enroll.cgi b/base/tps/apache/cgi-bin/demo/enroll.cgi
index c0f4bca..c0f4bca 100755
--- a/base/tps/forms/esc/cgi-bin/demo/enroll.cgi
+++ b/base/tps/apache/cgi-bin/demo/enroll.cgi
diff --git a/base/tps/forms/esc/cgi-bin/demo/index.cgi b/base/tps/apache/cgi-bin/demo/index.cgi
index c9a1d21..c9a1d21 100755
--- a/base/tps/forms/esc/cgi-bin/demo/index.cgi
+++ b/base/tps/apache/cgi-bin/demo/index.cgi
diff --git a/base/tps/forms/esc/esc.cgi b/base/tps/apache/cgi-bin/esc.cgi
index 70a93c0..70a93c0 100755
--- a/base/tps/forms/esc/esc.cgi
+++ b/base/tps/apache/cgi-bin/esc.cgi
diff --git a/base/tps/forms/esc/home.cgi b/base/tps/apache/cgi-bin/home.cgi
index 5fdf5ec..5fdf5ec 100755
--- a/base/tps/forms/esc/home.cgi
+++ b/base/tps/apache/cgi-bin/home.cgi
diff --git a/base/tps/forms/esc/cgi-bin/home/cachain.cgi b/base/tps/apache/cgi-bin/home/cachain.cgi
index ddbf5e6..ddbf5e6 100755
--- a/base/tps/forms/esc/cgi-bin/home/cachain.cgi
+++ b/base/tps/apache/cgi-bin/home/cachain.cgi
diff --git a/base/tps/forms/esc/cgi-bin/home/enroll.cgi b/base/tps/apache/cgi-bin/home/enroll.cgi
index c0f4bca..c0f4bca 100755
--- a/base/tps/forms/esc/cgi-bin/home/enroll.cgi
+++ b/base/tps/apache/cgi-bin/home/enroll.cgi
diff --git a/base/tps/forms/esc/cgi-bin/home/index.cgi b/base/tps/apache/cgi-bin/home/index.cgi
index 1e54a83..1e54a83 100755
--- a/base/tps/forms/esc/cgi-bin/home/index.cgi
+++ b/base/tps/apache/cgi-bin/home/index.cgi
diff --git a/base/tps/forms/esc/cgi-bin/so/enroll.cgi b/base/tps/apache/cgi-bin/so/enroll.cgi
index 148cd78..148cd78 100755
--- a/base/tps/forms/esc/cgi-bin/so/enroll.cgi
+++ b/base/tps/apache/cgi-bin/so/enroll.cgi
diff --git a/base/tps/forms/esc/cgi-bin/so/index.cgi b/base/tps/apache/cgi-bin/so/index.cgi
index 7b3f2c6..7b3f2c6 100755
--- a/base/tps/forms/esc/cgi-bin/so/index.cgi
+++ b/base/tps/apache/cgi-bin/so/index.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/ajax-list.cgi b/base/tps/apache/cgi-bin/sow/ajax-list.cgi
index 0f4ac09..0f4ac09 100755
--- a/base/tps/forms/esc/cgi-bin/sow/ajax-list.cgi
+++ b/base/tps/apache/cgi-bin/sow/ajax-list.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/enroll.cgi b/base/tps/apache/cgi-bin/sow/enroll.cgi
index 8a6431e..8a6431e 100755
--- a/base/tps/forms/esc/cgi-bin/sow/enroll.cgi
+++ b/base/tps/apache/cgi-bin/sow/enroll.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi b/base/tps/apache/cgi-bin/sow/enroll_temp.cgi
index 5817039..5817039 100755
--- a/base/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi
+++ b/base/tps/apache/cgi-bin/sow/enroll_temp.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/format.cgi b/base/tps/apache/cgi-bin/sow/format.cgi
index 9b31099..9b31099 100755
--- a/base/tps/forms/esc/cgi-bin/sow/format.cgi
+++ b/base/tps/apache/cgi-bin/sow/format.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/formatso.cgi b/base/tps/apache/cgi-bin/sow/formatso.cgi
index d531291..d531291 100755
--- a/base/tps/forms/esc/cgi-bin/sow/formatso.cgi
+++ b/base/tps/apache/cgi-bin/sow/formatso.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/index.cgi b/base/tps/apache/cgi-bin/sow/index.cgi
index 7f7a988..7f7a988 100755
--- a/base/tps/forms/esc/cgi-bin/sow/index.cgi
+++ b/base/tps/apache/cgi-bin/sow/index.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/is_agent.cgi b/base/tps/apache/cgi-bin/sow/is_agent.cgi
index c6b6a87..c6b6a87 100755
--- a/base/tps/forms/esc/cgi-bin/sow/is_agent.cgi
+++ b/base/tps/apache/cgi-bin/sow/is_agent.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/is_user.cgi b/base/tps/apache/cgi-bin/sow/is_user.cgi
index d7a5514..d7a5514 100755
--- a/base/tps/forms/esc/cgi-bin/sow/is_user.cgi
+++ b/base/tps/apache/cgi-bin/sow/is_user.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/main.cgi b/base/tps/apache/cgi-bin/sow/main.cgi
index c6f65e4..c6f65e4 100755
--- a/base/tps/forms/esc/cgi-bin/sow/main.cgi
+++ b/base/tps/apache/cgi-bin/sow/main.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/noaccess.cgi b/base/tps/apache/cgi-bin/sow/noaccess.cgi
index 17166bc..17166bc 100755
--- a/base/tps/forms/esc/cgi-bin/sow/noaccess.cgi
+++ b/base/tps/apache/cgi-bin/sow/noaccess.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/read.cgi b/base/tps/apache/cgi-bin/sow/read.cgi
index 8a5793c..8a5793c 100755
--- a/base/tps/forms/esc/cgi-bin/sow/read.cgi
+++ b/base/tps/apache/cgi-bin/sow/read.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/read_temp.cgi b/base/tps/apache/cgi-bin/sow/read_temp.cgi
index 31c6fd7..31c6fd7 100755
--- a/base/tps/forms/esc/cgi-bin/sow/read_temp.cgi
+++ b/base/tps/apache/cgi-bin/sow/read_temp.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/search.cgi b/base/tps/apache/cgi-bin/sow/search.cgi
index e681ed1..e681ed1 100755
--- a/base/tps/forms/esc/cgi-bin/sow/search.cgi
+++ b/base/tps/apache/cgi-bin/sow/search.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/search_temp.cgi b/base/tps/apache/cgi-bin/sow/search_temp.cgi
index 5d752a4..5d752a4 100755
--- a/base/tps/forms/esc/cgi-bin/sow/search_temp.cgi
+++ b/base/tps/apache/cgi-bin/sow/search_temp.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/seturl.cgi b/base/tps/apache/cgi-bin/sow/seturl.cgi
index dfac46d..dfac46d 100755
--- a/base/tps/forms/esc/cgi-bin/sow/seturl.cgi
+++ b/base/tps/apache/cgi-bin/sow/seturl.cgi
diff --git a/base/tps/forms/esc/cgi-bin/sow/welcome.cgi b/base/tps/apache/cgi-bin/sow/welcome.cgi
index bc76dd3..bc76dd3 100755
--- a/base/tps/forms/esc/cgi-bin/sow/welcome.cgi
+++ b/base/tps/apache/cgi-bin/sow/welcome.cgi
diff --git a/base/tps/forms/index.cgi b/base/tps/apache/docroot/index.cgi
index 0e64316..0e64316 100755
--- a/base/tps/forms/index.cgi
+++ b/base/tps/apache/docroot/index.cgi
diff --git a/base/tps/forms/index.html b/base/tps/apache/docroot/index.html
index b225251..b225251 100644
--- a/base/tps/forms/index.html
+++ b/base/tps/apache/docroot/index.html
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 d616fa1..0000000
--- 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;
-}
-