22#
33# Author Eric Vaandering (ewv@fnal.gov)
44
5- # Copyright 2001-2013 Eric Vaandering, Lynn Garren, Adam Bryant
5+ # Copyright 2001-2017 Eric Vaandering, Lynn Garren, Adam Bryant
66
77# This file is part of DocDB.
88
@@ -32,6 +32,8 @@ require "ResponseElements.pm";
3232require " FormElements.pm" ;
3333require " Scripts.pm" ;
3434require " Security.pm" ;
35+ require " SecurityHTML.pm" ;
36+ require " FormElements.pm" ;
3537
3638require " CertificateUtilities.pm" ;
3739
@@ -42,7 +44,11 @@ $dbh = DBI->connect('DBI:mysql:'.$db_name.':'.$db_host,$db_rouser,$db_ropass);
4244# ## Start HTML
4345
4446print $query -> header( -charset => $HTTP_ENCODING );
45- &DocDBHeader(" Certificate Status and Application" ," " ,-scripts => [" PopUps" ]);
47+ if ($UserValidation eq " FNALSSO" ) {
48+ DocDBHeader(" SSO Status and Application" ," " ,-scripts => [" PopUps" ]);
49+ } else {
50+ DocDBHeader(" Certificate Status and Application" ," " ,-scripts => [" PopUps" ]);
51+ }
4652
4753&EndPage(@ErrorStack );
4854
@@ -74,25 +80,50 @@ if ($CertificateStatus eq "verified") {
7480 print " <b>Certificate Distinguished Name (DN):</b> $CertDN <br/>\n " ;
7581 print " <b>Certificate Common Name (CN):</b> $CertCN <br/>\n " ;
7682 print " <b>Certificate E-mail Address:</b> $CertEmail <br/>\n " ;
77- } elsif ($CertificateStatus eq " nocert" ) {
78- print " <b>You didn't present a certificate. Make sure your browser is supplying one and contact an administrator if are supplying one.</b><p/>" ;
79- } elsif ($CertificateStatus eq " noapp" ) {
80- require " SecurityHTML.pm" ;
81- require " FormElements.pm" ;
82- print " <p><b>Your certificate is valid but you have never applied for access to
83- documents.<br/>Fill out the form below to apply for access.
84- Select the groups which you think you belong to from the list.
85- Your selection(s) will be verified by an administrator.</b></p>" ;
83+ } elsif ($CertificateStatus eq " noapp" || $UserValidation eq " FNALSSO" ) {
84+ if ($UserValidation eq " FNALSSO" ) {
85+ print " <p><b>Your SSO is valid and your current groups are listed.
86+ Fill out the form below to apply for access to additional groups.<br/>
87+ Select the groups which you think you belong to from the list.
88+ Your selection(s) will be verified by an administrator.</b></p>" ;
89+ } else {
90+ print " <p><b>Your certificate is valid but you have never applied for access to
91+ documents.<br/>Fill out the form below to apply for access.
92+ Select the groups which you think you belong to from the list.
93+ Your selection(s) will be verified by an administrator.</b></p>" ;
94+ }
8695 print " <center>\n " ;
87- print $query -> start_multipart_form(' POST' ,$UserAccessApply );
96+ if ($UserValidation eq " FNALSSO" ) {
97+ print $query -> start_multipart_form(' POST' ,$SSOAccessApply );
98+ } else {
99+ print $query -> start_multipart_form(' POST' ,$UserAccessApply );
100+ }
88101 print " <table class=\" MedPaddedTable CenteredTable\" >\n " ;
89102 print " <tr>\n " ;
90- print " <td colspan=\" 2\" ><b>Your certificate DN:</b><br/> $CertDN <p/>\n " ;
91- print " </tr><tr>\n " ;
92- print " <td><b>Your name (certificate CN):</b><br/> $CertCN <p/>\n " ;
93- TextField(-name => " email" , -helplink => " email" , -helptext => " Your E-mail" ,
94- -size => 20, -maxlength => 64, -default => $CertEmail );
95- print " </td>\n " ;
103+
104+ if ($UserValidation eq " FNALSSO" ) {
105+ require " FNALSSOUtilities.pm" ;
106+ my ($FQUN , $Username , $EmailAddress , $Name ) = GetUserInfoFSSO();
107+ my $EmailUserID = FetchEmailUserID();
108+ print " <td><b>Username:</b> $FQUN </p>\n " ;
109+ print " <b>Name:</b> $Name </p>\n " ;
110+ print " <b>Email:</b> $EmailAddress <p/>\n " ;
111+ print " <b>Current groups:</b>\n " ;
112+ print " <ul>\n " ;
113+ my @UserGroupIDs = FetchSecurityGroupsForFSSO();
114+ foreach my $UserGroupID (@UserGroupIDs ) {
115+ FetchSecurityGroup($UserGroupID );
116+ print " <li>" .SmartHTML({-text => $SecurityGroups {$UserGroupID }{NAME }})." </li>\n " ;
117+ }
118+ print " </ul>\n " ;
119+ } else {
120+ print " <td colspan=\" 2\" ><b>Your certificate DN:</b><br/> $CertDN <p/></td>\n " ;
121+ print " </tr><tr>\n " ;
122+ print " <td><b>Your name (certificate CN):</b><br/> $CertCN <p/>\n " ;
123+ TextField(-name => " email" , -helplink => " email" , -helptext => " Your E-mail" ,
124+ -size => 20, -maxlength => 64, -default => $CertEmail );
125+ print " </td>\n " ;
126+ }
96127 print " <td>\n " ;
97128 SecurityScroll(-helplink => " reqgroups" , -helptext => " Requested Groups" ,
98129 -name => " reqgroups" , -multiple => $TRUE , -format => " full" );
@@ -109,6 +140,8 @@ if ($CertificateStatus eq "verified") {
109140 print " </td></tr>" ;
110141 print " </table>\n " ;
111142 print " </center>\n " ;
143+ } elsif ($CertificateStatus eq " nocert" ) {
144+ print " <b>You didn't present a certificate. Make sure your browser is supplying one and contact an administrator if are supplying one.</b><p/>" ;
112145}
113146
114147&DocDBNavBar();
0 commit comments