Skip to content

Commit c2f0f79

Browse files
Merge pull request #21 from ericvaandering/8_8_9_br
Merge 8.8.9 changes into master
2 parents 16cad43 + 674d08a commit c2f0f79

65 files changed

Lines changed: 1505 additions & 805 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DocDB/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/doc/CHANGES merge=union

DocDB/cgi/AddFiles

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#! /usr/bin/env perl
22
#
3-
# Name: $RCSfile$
3+
# Name: AddFiles
44
# Description: Adds downloaded files to the database and filesystem
5-
# Revision: $Revision$
6-
# Modified: $Author$ on $Date$
75
#
86
# Author: Eric Vaandering (ewv@fnal.gov)
97
# Modified:
108

11-
# Copyright 2001-2014 Eric Vaandering, Lynn Garren, Adam Bryant
9+
# Copyright 2001-2017 Eric Vaandering, Lynn Garren, Adam Bryant
1210

1311
# This file is part of DocDB.
1412

@@ -101,7 +99,7 @@ if ($Preferences{Options}{SubmitAgree} && !$SubmitAgree) {
10199
'\nto add files to the document.';
102100
}
103101

104-
if ($PreserveSigs && !CanPreserveSigs()) {
102+
if ($PreserveSigs && !CanPreserveSigs("update")) {
105103
push @ErrorStack,'You are not authorized to preserve signatures when making '.
106104
'this change. Members of another group may have this capability. ';
107105
}

DocDB/cgi/AddFilesForm

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Author: Eric Vaandering (ewv@fnal.gov)
77
# Modified: Eric Vaandering (ewv@fnal.gov)
88

9-
# Copyright 2001-2014 Eric Vaandering, Lynn Garren, Adam Bryant
9+
# Copyright 2001-2018 Eric Vaandering, Lynn Garren, Adam Bryant
1010

1111
# This file is part of DocDB.
1212

@@ -43,6 +43,7 @@ require "FileHTML.pm";
4343
require "Cookies.pm";
4444
require "Defaults.pm";
4545
require "HTMLUtilities.pm";
46+
require "SignoffUtilities.pm";
4647
require "UntaintInput.pm";
4748
require "Scripts.pm";
4849

@@ -99,12 +100,16 @@ unless ($Version) {
99100
}
100101

101102
# Warn the user if they are about to modify a controlled document
103+
my ($SigStatus) = RevisionStatus($DocRevID);
102104

103105
if ($UseSignoffs) {
104106
require "SignoffUtilities.pm";
105-
my ($Status) = &RevisionStatus($DocRevID);
106-
unless ($Status eq "Unmanaged") {
107-
push @WarnStack,$Msg_WarnModManaged;
107+
unless ($SigStatus eq "Unmanaged") {
108+
if (CanPreserveSigs("update")) {
109+
push @WarnStack, $Msg_WarnModManagedHack;
110+
} else {
111+
push @WarnStack, $Msg_WarnModManaged;
112+
}
108113
}
109114
}
110115

@@ -146,7 +151,8 @@ print FormElementTitle(-helplink => "replacefiles", -helptext => "Replace duplic
146151
print $query -> checkbox(-name => "replace", -label => '(Check for yes.)',
147152
-onclick => "helppopupwindow(\'DocDBHelp?term=replacefiles\');");
148153
print "</td></tr>";
149-
if ($UseSignoffs && CanPreserveSigs()) {
154+
155+
if ($SigStatus ne "Unmanaged" && CanPreserveSigs("update")) {
150156
print '<tr><td>';
151157
print FormElementTitle(-helplink => "preservesigs",
152158
-helptext => "Preserve signatures on this revision?",

DocDB/cgi/AdministerElements.pm

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
# Name: $RCSfile$
1+
# Name: AdministerElements.pm
22
# Description: Various routines which supply input forms for administrative
33
# functions
44
#
5-
# Revision: $Revision$
6-
# Modified: $Author$ on $Date$
7-
#
85
# Author: Eric Vaandering (ewv@fnal.gov)
96

10-
# Copyright 2001-2013 Eric Vaandering, Lynn Garren, Adam Bryant
7+
# Copyright 2001-2018 Eric Vaandering, Lynn Garren, Adam Bryant
118

129
# This file is part of DocDB.
1310

DocDB/cgi/AdministerForm

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44
# Description: This single form provides a number of interfaces to admin
55
# tools, each run by a different script.
66
#
7-
# Revision: $Revision$
8-
# Modified: $Author$ on $Date$
9-
#
107
# Author: Eric Vaandering (ewv@fnal.gov)
118

12-
# Copyright 2001-2013 Eric Vaandering, Lynn Garren, Adam Bryant
9+
# Copyright 2001-2018 Eric Vaandering, Lynn Garren, Adam Bryant
1310

1411
# This file is part of DocDB.
1512

@@ -120,7 +117,7 @@ print "</tr>\n";
120117

121118
print "<tr valign=top>\n";
122119
print "<td>\n";
123-
&AuthorScroll(-helplink => "author", -disabled => true);
120+
&AuthorScroll(-helplink => "authors", -disabled => true);
124121
print "</td>\n";
125122
print "<td>\n";
126123
AuthorScroll(-helplink => "targetauthor", -helptext => "Consolidate", -name => "targetauthor", -disabled => true);

DocDB/cgi/AdministerHome

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ print "<strong>Document management:</strong>";
9090
if (CanAdminister()) { # Delete Form
9191
print "<ul>\n";
9292
print "<li>";
93-
print "\n",$query -> startform('POST',$DeleteConfirm),"<div>\n";
93+
print "\n",$query -> start_form('POST',$DeleteConfirm),"<div>\n";
9494
print $query -> submit (-class => "Action", -value => "Delete");
9595
print " document # ";
9696
print $query -> textfield(-name => "docid", -size => 6, -maxlength => 6);
9797
print " -v";
9898
print $query -> textfield(-name => "version", -size => 4, -maxlength => 4);
99-
print "\n</div>\n",$query -> endform,"\n\n";
99+
print "\n</div>\n",$query -> end_form,"\n\n";
100100
print "</li>";
101101
print "</ul>\n";
102102
}

DocDB/cgi/AuthorAdd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Modified: Eric Vaandering (ewv@fnal.gov)
99
#
1010

11-
# Copyright 2001-2013 Eric Vaandering, Lynn Garren, Adam Bryant
11+
# Copyright 2001-2018 Eric Vaandering, Lynn Garren, Adam Bryant
1212

1313
# This file is part of DocDB.
1414

@@ -44,9 +44,9 @@ GetSecurityGroups();
4444
my $Untaint = CGI::Untaint -> new($query -> Vars);
4545

4646
my $InstitutionID = $Untaint -> extract(-as_integer => "inst") || 0;
47-
my $FirstName = $Untaint -> extract(-as_safehtml => "first") || 0;
48-
my $MiddleInitials = $Untaint -> extract(-as_safehtml => "middle") || 0;
49-
my $LastName = $Untaint -> extract(-as_safehtml => "lastname") || 0;
47+
my $FirstName = $Untaint -> extract(-as_safehtml => "first") || "";
48+
my $MiddleInitials = $Untaint -> extract(-as_safehtml => "middle") || "";
49+
my $LastName = $Untaint -> extract(-as_safehtml => "lastname") || "";
5050

5151
print $query -> header( -charset => $HTTP_ENCODING );
5252
DocDBHeader("Author Addition Results");

DocDB/cgi/AuthorAdminister

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
# Author: Eric Vaandering (ewv@fnal.gov)
1111

12-
# Copyright 2001-2014 Eric Vaandering, Lynn Garren, Adam Bryant
12+
# Copyright 2001-2018 Eric Vaandering, Lynn Garren, Adam Bryant
1313

1414
# This file is part of DocDB.
1515

@@ -57,9 +57,9 @@ my $AuthorID = $Untaint -> extract(-as_integer => "authors") || 0;
5757
my $ConsolidateID = $Untaint -> extract(-as_integer => "targetauthor") || 0;
5858
my $InstitutionID = $Untaint -> extract(-as_integer => "inst") || 0;
5959

60-
my $FirstName = $Untaint -> extract(-as_safehtml => "first") || 0;
61-
my $Middle = $Untaint -> extract(-as_safehtml => "middle") || 0;
62-
my $LastName = $Untaint -> extract(-as_safehtml => "lastname") || 0;
60+
my $FirstName = $Untaint -> extract(-as_safehtml => "first") || "";
61+
my $Middle = $Untaint -> extract(-as_safehtml => "middle") || "";
62+
my $LastName = $Untaint -> extract(-as_safehtml => "lastname") || "";
6363

6464
$dbh = DBI->connect('DBI:mysql:'.$db_name.':'.$db_host,$Username,$Password);
6565

DocDB/cgi/AuthorHTML.pm

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# Name: AuthorHTML.pm
2-
#
3-
# Name: $RCSfile$
42
# Description: Routines to create HTML elements for authors and institutions
5-
# Revision: $Revision$
6-
# Modified: $Author$ on $Date$
73
#
84
# Author: Eric Vaandering (ewv@fnal.gov)
95
# Modified: Eric Vaandering (ewv@fnal.gov)
106

11-
# Copyright 2001-2013 Eric Vaandering, Lynn Garren, Adam Bryant
7+
# Copyright 2001-2018 Eric Vaandering, Lynn Garren, Adam Bryant
128

139
# This file is part of DocDB.
1410

@@ -328,13 +324,11 @@ sub RequesterActiveSearch {
328324

329325
sub AuthorActiveSearch {
330326
my ($ArgRef) = @_;
331-
my $Depth = exists $ArgRef->{-depth} ? $ArgRef->{-depth} : 2;
332-
my @DefaultAuthorIDs = exists $ArgRef->{-defaultauthorids} ? @{$ArgRef->{-defaultauthorids}} : ();
333-
my $Name = exists $ArgRef->{-name} ? $ArgRef->{-name} : "authors";
334-
my $HelpLink = exists $ArgRef->{-helplink} ? $ArgRef->{-helplink} : "authors";
335-
my $HelpText = exists $ArgRef->{-helptext} ? $ArgRef->{-helptext} : "Authors";
336-
my $Required = exists $ArgRef->{-required} ? $ArgRef->{-required} : $TRUE;
337-
my $ExtraText = $Params{-extratext} || "";
327+
my @DefaultAuthorIDs = exists $ArgRef->{-defaultauthorids} ? @{$ArgRef->{-defaultauthorids}} : ();
328+
my $HelpLink = exists $ArgRef->{-helplink} ? $ArgRef->{-helplink} : "authors";
329+
my $HelpText = exists $ArgRef->{-helptext} ? $ArgRef->{-helptext} : "Authors";
330+
my $Required = exists $ArgRef->{-required} ? $ArgRef->{-required} : $TRUE;
331+
my $ExtraText = exists $ArgRef->{-extratext} ? $ArgRef->{-extratext} : "";
338332

339333
my @AuthorIDs = sort byLastName keys %Authors;
340334

DocDB/cgi/CertificateApplyForm

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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";
3232
require "FormElements.pm";
3333
require "Scripts.pm";
3434
require "Security.pm";
35+
require "SecurityHTML.pm";
36+
require "FormElements.pm";
3537

3638
require "CertificateUtilities.pm";
3739

@@ -42,7 +44,11 @@ $dbh = DBI->connect('DBI:mysql:'.$db_name.':'.$db_host,$db_rouser,$db_ropass);
4244
### Start HTML
4345

4446
print $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/>&nbsp;&nbsp;$CertDN<p/>\n";
91-
print "</tr><tr>\n";
92-
print "<td><b>Your name (certificate CN):</b><br/>&nbsp;&nbsp;$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/>&nbsp;&nbsp;$CertDN<p/></td>\n";
121+
print "</tr><tr>\n";
122+
print "<td><b>Your name (certificate CN):</b><br/>&nbsp;&nbsp;$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

Comments
 (0)