diff --git a/DocDB/cgi/AddFiles b/DocDB/cgi/AddFiles index 07909978..ce90a2ab 100755 --- a/DocDB/cgi/AddFiles +++ b/DocDB/cgi/AddFiles @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: AddFiles # Description: Adds downloaded files to the database and filesystem diff --git a/DocDB/cgi/AddFilesForm b/DocDB/cgi/AddFilesForm index 7981f97e..76b8ca5f 100755 --- a/DocDB/cgi/AddFilesForm +++ b/DocDB/cgi/AddFilesForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: AddFilesForm # Description: An entry form to add files to an existing document diff --git a/DocDB/cgi/AdministerElements.pm b/DocDB/cgi/AdministerElements.pm index 8eb3bd4f..0e82f40b 100644 --- a/DocDB/cgi/AdministerElements.pm +++ b/DocDB/cgi/AdministerElements.pm @@ -29,17 +29,14 @@ sub AdministerActions (%) { my $Form = $Params{-form} || ""; my $AddTransfer = $Params{-addTransfer} || $FALSE; - my %Action = (); + my @Action = ('New', 'Delete', 'Modify'); - $Action{Delete} = "Delete"; - $Action{New} = "New"; - $Action{Modify} = "Modify"; if ($AddTransfer) { $Action{Transfer} = "Transfer"; } print FormElementTitle(-helplink => "admaction", -helptext => "Action"); print $query -> radio_group(-name => "admaction", - -values => \%Action, -default => "-", + -values => \@Action, -default => "-", -onclick => "disabler_$Form();"); }; diff --git a/DocDB/cgi/AdministerForm b/DocDB/cgi/AdministerForm index e7a915f6..a7a7b527 100755 --- a/DocDB/cgi/AdministerForm +++ b/DocDB/cgi/AdministerForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: AdministerForm # Description: This single form provides a number of interfaces to admin diff --git a/DocDB/cgi/AdministerHome b/DocDB/cgi/AdministerHome index 4cad6c8b..540fcccf 100755 --- a/DocDB/cgi/AdministerHome +++ b/DocDB/cgi/AdministerHome @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # Name: $RCSfile$ # Description: Group administrative actions into one page # diff --git a/DocDB/cgi/AuthorAdd b/DocDB/cgi/AuthorAdd index a9052bd1..8649a8e5 100755 --- a/DocDB/cgi/AuthorAdd +++ b/DocDB/cgi/AuthorAdd @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: AuthorAdd # Description: Adds an author into the DB list of authors. diff --git a/DocDB/cgi/AuthorAddForm b/DocDB/cgi/AuthorAddForm index 0eca817d..517cca64 100755 --- a/DocDB/cgi/AuthorAddForm +++ b/DocDB/cgi/AuthorAddForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: A simple script to allow new author addition (no changes possible) # diff --git a/DocDB/cgi/AuthorAdminister b/DocDB/cgi/AuthorAdminister index 0b517f06..5daee667 100755 --- a/DocDB/cgi/AuthorAdminister +++ b/DocDB/cgi/AuthorAdminister @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: This script is called by AdministerForm and does administration # on Authors in the DB. AddAuthor is simpler and can only add diff --git a/DocDB/cgi/BulkCertificateInsert b/DocDB/cgi/BulkCertificateInsert index a3e6acb0..8c5bd135 100755 --- a/DocDB/cgi/BulkCertificateInsert +++ b/DocDB/cgi/BulkCertificateInsert @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: Allows an administrator to create entries for certificate users in EmailUser # diff --git a/DocDB/cgi/CertificateApplyForm b/DocDB/cgi/CertificateApplyForm index 718e3228..5ec3a74e 100755 --- a/DocDB/cgi/CertificateApplyForm +++ b/DocDB/cgi/CertificateApplyForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) diff --git a/DocDB/cgi/ConfirmTalkHint b/DocDB/cgi/ConfirmTalkHint index aae9a1e9..705958f6 100755 --- a/DocDB/cgi/ConfirmTalkHint +++ b/DocDB/cgi/ConfirmTalkHint @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: Script to confirm a match between a talk entered in the agenda # and a document diff --git a/DocDB/cgi/CustomListForm b/DocDB/cgi/CustomListForm index e37afa3f..d00a7c4a 100755 --- a/DocDB/cgi/CustomListForm +++ b/DocDB/cgi/CustomListForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: CustomListForm # Description: Allow users, admins, and meeting organizers to change how various diff --git a/DocDB/cgi/DeleteConfirm b/DocDB/cgi/DeleteConfirm index 83c535cb..c72a74a1 100755 --- a/DocDB/cgi/DeleteConfirm +++ b/DocDB/cgi/DeleteConfirm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # Name: $RCSfile$ # Description: Displays the document (or document and version) # to be deleted and requests the admin password. diff --git a/DocDB/cgi/DeleteDocument b/DocDB/cgi/DeleteDocument index 893e260b..0d2c0605 100755 --- a/DocDB/cgi/DeleteDocument +++ b/DocDB/cgi/DeleteDocument @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # Name: $RCSfile$ # Description: This script is called by DeleteConfirm to actually delete # the requested document, all associated entries in the DB, diff --git a/DocDB/cgi/DisplayMeeting b/DocDB/cgi/DisplayMeeting index 49a455fb..a9b28377 100755 --- a/DocDB/cgi/DisplayMeeting +++ b/DocDB/cgi/DisplayMeeting @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: DisplayMeeting # Description: Displays talks for a meeting or just a session of a meeting diff --git a/DocDB/cgi/DocDBHelp b/DocDB/cgi/DocDBHelp index ea18350c..6d72668e 100755 --- a/DocDB/cgi/DocDBHelp +++ b/DocDB/cgi/DocDBHelp @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: DocDBHelp # Description: Usually called as a pop-up, this looks up in docdb.hlp @@ -54,15 +57,15 @@ my ($DefaultText, $DefaultTitle, $ProjectText, $ProjectTitle, $Action); my $HelpXML = XMLin("DocDBHelp.xml"); -$DefaultText = %{$HelpXML->{entry}{$helpterm}}->{text}; -$DefaultTitle = %{$HelpXML->{entry}{$helpterm}}->{title}; +$DefaultText = $HelpXML->{entry}{$helpterm}->{text}; +$DefaultTitle = $HelpXML->{entry}{$helpterm}->{title}; if ($ProjectHelp) { my $ProjectXML = XMLin("ProjectHelp.xml"); - $ProjectText = %{$ProjectXML->{entry}{$helpterm}}->{text}; - $ProjectTitle = %{$ProjectXML->{entry}{$helpterm}}->{title}; - $Action = %{$ProjectXML->{entry}{$helpterm}}->{action}; + $ProjectText = $ProjectXML->{entry}{$helpterm}->{text}; + $ProjectTitle = $ProjectXML->{entry}{$helpterm}->{title}; + $Action = $ProjectXML->{entry}{$helpterm}->{action}; } # Remove line breaks and XML element tags diff --git a/DocDB/cgi/DocDBInstructions b/DocDB/cgi/DocDBInstructions index 780d1667..7fb71f2e 100755 --- a/DocDB/cgi/DocDBInstructions +++ b/DocDB/cgi/DocDBInstructions @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: The instructions for DocDB. This is mostly HTML, but making # it a script allows us to eliminate parts of it that we don't want diff --git a/DocDB/cgi/DocTypeAdminister b/DocDB/cgi/DocTypeAdminister index 110e3d2d..68c88be7 100755 --- a/DocDB/cgi/DocTypeAdminister +++ b/DocDB/cgi/DocTypeAdminister @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: DocTypeAdminister # Description: This script is called by AdministerForm and does administration diff --git a/DocDB/cgi/DocumentAddForm b/DocDB/cgi/DocumentAddForm index d514b7f4..cc8d90a6 100755 --- a/DocDB/cgi/DocumentAddForm +++ b/DocDB/cgi/DocumentAddForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: DocumentAddForm # Description: The main form to add or modify documents or metadata @@ -519,6 +522,7 @@ SecurityScroll(-addpublic => 'true', -helplink => 'security', -helptext => $SecurityText, -multiple => $TRUE, + -permission=> 'CanView', -default => \@SecurityDefaults); print "\n"; if ($EnhancedSecurity) { @@ -527,6 +531,7 @@ if ($EnhancedSecurity) { -helplink => 'modifygroups', -helptext => 'Can Modify', -multiple => $TRUE, + -permission=> 'CanCreate', -default => \@ModifyDefaults); print "\n"; } diff --git a/DocDB/cgi/DocumentDatabase b/DocDB/cgi/DocumentDatabase index ca08ecc8..42916ef1 100755 --- a/DocDB/cgi/DocumentDatabase +++ b/DocDB/cgi/DocumentDatabase @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: DocumentDatabase # Description: The Document Database homepage. Give the user various ways to diff --git a/DocDB/cgi/EditTalkInfo b/DocDB/cgi/EditTalkInfo index 04f01b5b..ab4f26a5 100755 --- a/DocDB/cgi/EditTalkInfo +++ b/DocDB/cgi/EditTalkInfo @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: ShowTalkNote # Description: Usually called as a pop-up, this will look up the note for a talk diff --git a/DocDB/cgi/EmailAdminister b/DocDB/cgi/EmailAdminister index ff24e886..59fed9f8 100755 --- a/DocDB/cgi/EmailAdminister +++ b/DocDB/cgi/EmailAdminister @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: EmailAdminister # Description: This script is called by EmailAdministerForm and does diff --git a/DocDB/cgi/EmailAdministerForm b/DocDB/cgi/EmailAdministerForm index 2fb0cdbb..3ab07201 100755 --- a/DocDB/cgi/EmailAdministerForm +++ b/DocDB/cgi/EmailAdministerForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: EmailAdministerForm # Description: This script provides a form to administer users receiving diff --git a/DocDB/cgi/EmailLogin b/DocDB/cgi/EmailLogin index 49c5cd7b..4f7e2792 100755 --- a/DocDB/cgi/EmailLogin +++ b/DocDB/cgi/EmailLogin @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: The login form to a users e-mail notification account # diff --git a/DocDB/cgi/EventAdministerForm b/DocDB/cgi/EventAdministerForm index dd91d814..d6099531 100755 --- a/DocDB/cgi/EventAdministerForm +++ b/DocDB/cgi/EventAdministerForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: EventAdministerForm # Description: This single form provides interfaces to admin tools for diff --git a/DocDB/cgi/ExternalDocDBAdministerForm b/DocDB/cgi/ExternalDocDBAdministerForm index 0929a523..d7f9232e 100755 --- a/DocDB/cgi/ExternalDocDBAdministerForm +++ b/DocDB/cgi/ExternalDocDBAdministerForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: ExternalDocDBAdministerForm # Description: Allows the administrator to add knowledge of other DocDBs. diff --git a/DocDB/cgi/GroupAdminister b/DocDB/cgi/GroupAdminister index 07de410f..2cc5b2c5 100755 --- a/DocDB/cgi/GroupAdminister +++ b/DocDB/cgi/GroupAdminister @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: GroupAdminister # Description: This script is called by GroupAdministerForm and does @@ -64,10 +67,15 @@ my $NoPerm = $Untaint -> extract(-as_printable => "remove") || ""; my $RemoveChildren = $Untaint -> extract(-as_printable => "removesubs") || ""; if ($View) {$View = 1;} # Make sure they are in format MySQL is expecting +else {$View = 0;} if ($Create) {$Create = 1;} +else {$Create = 0;} if ($Admin) {$Admin = 1;} +else {$Admin = 0;} if ($NoPerm) {$NoPerm = 1;} +else {$NoPerm = 0;} if ($RemoveChildren) {$RemoveChildren = 1;} +else {$RemoveChildren = 0;} $dbh = DBI->connect('DBI:mysql:'.$db_name.':'.$db_host,$Username,$Password); @@ -241,8 +249,8 @@ if ($Action eq "Delete") { # Delete group } elsif ($Action eq "New") { # Create new groups push @ActionStack,"Adding a new group."; my $GroupInsert = $dbh->prepare( - "insert into SecurityGroup (GroupID,Name,Description,CanCreate,CanAdminister,CanView,CanConfig) ". - "values (0,?,?,?,?,?,0)"); + "insert into SecurityGroup (Name,Description,CanCreate,CanAdminister,CanView,CanConfig) ". + "values (?,?,?,?,?,0)"); $GroupInsert -> execute($Name,$Description,$Create,$Admin,$View); $ParentID = $GroupInsert -> {mysql_insertid}; # Works with MySQL only diff --git a/DocDB/cgi/GroupAdministerForm b/DocDB/cgi/GroupAdministerForm index 8d21ca23..8326231e 100755 --- a/DocDB/cgi/GroupAdministerForm +++ b/DocDB/cgi/GroupAdministerForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: This script provides a form to administer groups in # the DocDB and shows the relationships between groups. diff --git a/DocDB/cgi/InstitutionAdminister b/DocDB/cgi/InstitutionAdminister index e450f719..4a8e9058 100755 --- a/DocDB/cgi/InstitutionAdminister +++ b/DocDB/cgi/InstitutionAdminister @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: This script is called by AdministerForm and does administration # on Institutions in the DB. This script adds, modifies and deletes diff --git a/DocDB/cgi/JournalAdminister b/DocDB/cgi/JournalAdminister index 937ff6b6..d045aa67 100755 --- a/DocDB/cgi/JournalAdminister +++ b/DocDB/cgi/JournalAdminister @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: This script is called by AdministerForm and does administration # on journals in the DB. This script adds, modifies and deletes diff --git a/DocDB/cgi/KeywordAdministerForm b/DocDB/cgi/KeywordAdministerForm index 1c8f8c77..9e0d3a11 100755 --- a/DocDB/cgi/KeywordAdministerForm +++ b/DocDB/cgi/KeywordAdministerForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: Add keywords or keyword groups to the keyword list # The keyword list is used indirectly to lookup approved keywords diff --git a/DocDB/cgi/KeywordGroupAdminister b/DocDB/cgi/KeywordGroupAdminister index bfb38b2c..135db226 100755 --- a/DocDB/cgi/KeywordGroupAdminister +++ b/DocDB/cgi/KeywordGroupAdminister @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: This script is called by KeywordAdministerForm and does administration # on Keyword Groups in the DB. This script adds, modifies and deletes diff --git a/DocDB/cgi/KeywordListAdminister b/DocDB/cgi/KeywordListAdminister index dae6381d..87d43afb 100755 --- a/DocDB/cgi/KeywordListAdminister +++ b/DocDB/cgi/KeywordListAdminister @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: This script is called by KeywordAdministerForm and does administration # on the Keyword table in the DB. diff --git a/DocDB/cgi/ListAllMeetings b/DocDB/cgi/ListAllMeetings index d2ecc19b..efe6d306 100755 --- a/DocDB/cgi/ListAllMeetings +++ b/DocDB/cgi/ListAllMeetings @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: ListAllMeetings # Description: Generates a nice table of all meetings, either for viewing or modification diff --git a/DocDB/cgi/ListAuthors b/DocDB/cgi/ListAuthors index 99df7d66..cb51ee95 100755 --- a/DocDB/cgi/ListAuthors +++ b/DocDB/cgi/ListAuthors @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) diff --git a/DocDB/cgi/ListBy b/DocDB/cgi/ListBy index 4b6f8d4e..da0ac1f1 100755 --- a/DocDB/cgi/ListBy +++ b/DocDB/cgi/ListBy @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: $RCSfile$ # Description: Generate tables of document for various input parameters diff --git a/DocDB/cgi/ListEventsBy b/DocDB/cgi/ListEventsBy index b3f3219c..d4f1a340 100755 --- a/DocDB/cgi/ListEventsBy +++ b/DocDB/cgi/ListEventsBy @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: ListEventsBy # Description: This script lists events and sessions based on the topic(s) or diff --git a/DocDB/cgi/ListGroupUsers b/DocDB/cgi/ListGroupUsers index 27bf7ee2..9e35c472 100755 --- a/DocDB/cgi/ListGroupUsers +++ b/DocDB/cgi/ListGroupUsers @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: EmailAdministerForm # Description: This script provides a form to administer users receiving diff --git a/DocDB/cgi/ListGroups b/DocDB/cgi/ListGroups index 98237d4b..66e7dfee 100755 --- a/DocDB/cgi/ListGroups +++ b/DocDB/cgi/ListGroups @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) diff --git a/DocDB/cgi/ListKeywords b/DocDB/cgi/ListKeywords index a0a8f8de..8e968930 100755 --- a/DocDB/cgi/ListKeywords +++ b/DocDB/cgi/ListKeywords @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: ListKeywords # Description: Lists the managed keywords. diff --git a/DocDB/cgi/ListManagedDocuments b/DocDB/cgi/ListManagedDocuments index ca8c3b87..f0659017 100755 --- a/DocDB/cgi/ListManagedDocuments +++ b/DocDB/cgi/ListManagedDocuments @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) diff --git a/DocDB/cgi/ListTopics b/DocDB/cgi/ListTopics index bdbec0be..6cf70a08 100755 --- a/DocDB/cgi/ListTopics +++ b/DocDB/cgi/ListTopics @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) diff --git a/DocDB/cgi/ListTypes b/DocDB/cgi/ListTypes index 293aea4f..0da9d9ee 100755 --- a/DocDB/cgi/ListTypes +++ b/DocDB/cgi/ListTypes @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) diff --git a/DocDB/cgi/MeetingModify b/DocDB/cgi/MeetingModify index 266b7eeb..0d93f8c2 100755 --- a/DocDB/cgi/MeetingModify +++ b/DocDB/cgi/MeetingModify @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: $RCSfile$ # Description: Modify sessions of meeting the shell of a meeting. Calls itself @@ -528,6 +531,7 @@ if ($NoSessions) { -helplink => 'meetingviewgroups', -helptext => 'Viewable by', -multiple => $TRUE, + -permission=> 'CanView', -default => \@MeetingViewDefaults, -size => 8); print "\n"; @@ -538,6 +542,7 @@ if ($NoSessions) { -helplink => 'meetingmodifygroups', -helptext => 'Modifiable by', -multiple => $TRUE, + -permission=> 'CanCreate', -default => \@MeetingModifyDefaults, -size => 8); print "\n"; diff --git a/DocDB/cgi/ModifyHome b/DocDB/cgi/ModifyHome index cd15f8f4..258bffd5 100755 --- a/DocDB/cgi/ModifyHome +++ b/DocDB/cgi/ModifyHome @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: ModifyHome # Description: The second "homepage" for adding documents and other metadata diff --git a/DocDB/cgi/ProcessDocumentAdd b/DocDB/cgi/ProcessDocumentAdd index da0bd483..9bcaf56d 100755 --- a/DocDB/cgi/ProcessDocumentAdd +++ b/DocDB/cgi/ProcessDocumentAdd @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: ProcessDocumentAdd # Description: Receives the output of DocumentAddForm and creates or updates the document diff --git a/DocDB/cgi/RetrieveArchive b/DocDB/cgi/RetrieveArchive index ce07f571..d21535af 100755 --- a/DocDB/cgi/RetrieveArchive +++ b/DocDB/cgi/RetrieveArchive @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: RetrieveArchive # Description: Create an archive (.zip, .tar, .tar.gz) file of the document diff --git a/DocDB/cgi/RetrieveFile b/DocDB/cgi/RetrieveFile index 95927a6f..78c1b1ac 100755 --- a/DocDB/cgi/RetrieveFile +++ b/DocDB/cgi/RetrieveFile @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: $RCSfile$ # Description: Get a file from a document. Automatically or by extension if possible. diff --git a/DocDB/cgi/SSOAccessApply b/DocDB/cgi/SSOAccessApply index 4a5c427a..9a331424 100644 --- a/DocDB/cgi/SSOAccessApply +++ b/DocDB/cgi/SSOAccessApply @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: SSOAccessApply # Description: Deal with the process of having a user apply to use DocDB via their SSO login. This is mostly diff --git a/DocDB/cgi/Search b/DocDB/cgi/Search index 8ce310de..2655a356 100755 --- a/DocDB/cgi/Search +++ b/DocDB/cgi/Search @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: $RCSfile$ # Description: Search on documents in local DocDB diff --git a/DocDB/cgi/SearchAtoms.pm b/DocDB/cgi/SearchAtoms.pm index cbdeebfb..ef9a54ee 100644 --- a/DocDB/cgi/SearchAtoms.pm +++ b/DocDB/cgi/SearchAtoms.pm @@ -113,13 +113,13 @@ sub RegExpSearchAtom { } if ($RequireWord) { - $RegExpAtom .= '[[:<:]]'; + $RegExpAtom .= '\\b'; } $RegExpAtom .= '('; $RegExpAtom .= join '|', @RegExpParts; $RegExpAtom .= ')'; if ($RequireWord) { - $RegExpAtom .= '[[:>:]]'; + $RegExpAtom .= '\\b'; } my $SafeAtom = $dbh->quote($RegExpAtom); diff --git a/DocDB/cgi/SearchForm b/DocDB/cgi/SearchForm index cf4d88fb..ca144d20 100755 --- a/DocDB/cgi/SearchForm +++ b/DocDB/cgi/SearchForm @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: SearchForm # Description: Build the input form for the "Advanced" (formerly normal) DocDB Search diff --git a/DocDB/cgi/SecurityHTML.pm b/DocDB/cgi/SecurityHTML.pm index d6502be7..d912213d 100644 --- a/DocDB/cgi/SecurityHTML.pm +++ b/DocDB/cgi/SecurityHTML.pm @@ -39,6 +39,7 @@ sub SecurityScroll (%) { my $Format = $Params{-format} || "short"; my $Size = $Params{-size} || 10; my $Disabled = $Params{-disabled} || $FALSE; + my $Permission= $Params{-permission}|| ""; my @GroupIDs = @{$Params{-groupids}}; my @Default = @{$Params{-default}}; @@ -51,7 +52,17 @@ sub SecurityScroll (%) { &GetSecurityGroups; unless (@GroupIDs) { - @GroupIDs = keys %SecurityGroups; + if($Permission){ + @GroupIDs = (); + foreach my $ID (keys %SecurityGroups) { + if($SecurityGroups{$ID}{$Permission}){ + push @GroupIDs,$ID; + } + } + } + else{ + @GroupIDs = keys %SecurityGroups; + } } my %GroupLabels = (); diff --git a/DocDB/cgi/SelectEmailPrefs b/DocDB/cgi/SelectEmailPrefs index f5f4f851..afa621e3 100755 --- a/DocDB/cgi/SelectEmailPrefs +++ b/DocDB/cgi/SelectEmailPrefs @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: SelectEmailPrefs.pm # Description: Change preferences for what/when to be notified of document diff --git a/DocDB/cgi/SelectGroups b/DocDB/cgi/SelectGroups index 8529a4b5..797bfebc 100755 --- a/DocDB/cgi/SelectGroups +++ b/DocDB/cgi/SelectGroups @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author: Eric Vaandering # Date: 22 May 2005 diff --git a/DocDB/cgi/SelectPrefs b/DocDB/cgi/SelectPrefs index 582306e9..363d2c34 100755 --- a/DocDB/cgi/SelectPrefs +++ b/DocDB/cgi/SelectPrefs @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: $RCSfile$ # Description: Main page for selecting various user-level preferences diff --git a/DocDB/cgi/SessionModify b/DocDB/cgi/SessionModify index f4dee865..695bc0cd 100755 --- a/DocDB/cgi/SessionModify +++ b/DocDB/cgi/SessionModify @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: $RCSfile$ # Description: Add talks to sessions of a meeting. Calls itself. In future, @@ -588,6 +591,7 @@ if ($SingleSession) { -helplink => 'meetingviewgroups', -helptext => 'Viewable by', -multiple => true, + -permission=> 'CanView', -default => \@MeetingViewDefaults, -size => 8); print "\n"; @@ -596,6 +600,7 @@ if ($SingleSession) { -helplink => 'meetingmodifygroups', -helptext => 'Modifiable by', -multiple => true, + -permission=> 'CanCreate', -default => \@MeetingModifyDefaults, -size => 8); print "\n"; diff --git a/DocDB/cgi/SetGroups b/DocDB/cgi/SetGroups index 9989ef7b..4d9a2b7b 100755 --- a/DocDB/cgi/SetGroups +++ b/DocDB/cgi/SetGroups @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author: Eric Vaandering # Date: 22 May 2005 diff --git a/DocDB/cgi/SetPrefs b/DocDB/cgi/SetPrefs index 511db715..03dbf19a 100755 --- a/DocDB/cgi/SetPrefs +++ b/DocDB/cgi/SetPrefs @@ -1,5 +1,8 @@ #! /usr/bin/env perl +use lib "."; + + # Name: SetPrefs # Description: Reads form parameters from SelectPrefs and stores user's # selections in a group of cookies, one for each preference. diff --git a/DocDB/cgi/ShowCalendar b/DocDB/cgi/ShowCalendar index e1e17b0a..63e794f6 100755 --- a/DocDB/cgi/ShowCalendar +++ b/DocDB/cgi/ShowCalendar @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: $RCSfile$ # Description: Print out various types of calendar (monthly/yearly/daily) and the events diff --git a/DocDB/cgi/ShowDocument b/DocDB/cgi/ShowDocument index 1321d5c7..6132cad6 100755 --- a/DocDB/cgi/ShowDocument +++ b/DocDB/cgi/ShowDocument @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: ShowDocument # Description: Display a document, its metadata, links to other versions and links to the files diff --git a/DocDB/cgi/ShowTalkNote b/DocDB/cgi/ShowTalkNote index cfb27d84..71d12430 100755 --- a/DocDB/cgi/ShowTalkNote +++ b/DocDB/cgi/ShowTalkNote @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: ShowTalkNote # Description: Usually called as a pop-up, this will look up the note for a talk diff --git a/DocDB/cgi/SignRevision b/DocDB/cgi/SignRevision index 76e5bac3..c046e6cf 100755 --- a/DocDB/cgi/SignRevision +++ b/DocDB/cgi/SignRevision @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: SignRevision # Description: Sign (approve) a revision of a document diff --git a/DocDB/cgi/SignatureReport b/DocDB/cgi/SignatureReport index 7d4aea2a..3c9cae19 100755 --- a/DocDB/cgi/SignatureReport +++ b/DocDB/cgi/SignatureReport @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) # diff --git a/DocDB/cgi/SignoffChooser b/DocDB/cgi/SignoffChooser index 9343df66..5c1a86a6 100755 --- a/DocDB/cgi/SignoffChooser +++ b/DocDB/cgi/SignoffChooser @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: $RCSfile$ # Description: Lists the people who can sign a document and helps the user diff --git a/DocDB/cgi/Statistics b/DocDB/cgi/Statistics index 6b9870cc..ca8a8ea1 100755 --- a/DocDB/cgi/Statistics +++ b/DocDB/cgi/Statistics @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: Gather and display aggregate statistics on DocDB # diff --git a/DocDB/cgi/TopicAdminister b/DocDB/cgi/TopicAdminister index dbfc8caf..482ec6f6 100755 --- a/DocDB/cgi/TopicAdminister +++ b/DocDB/cgi/TopicAdminister @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Description: This script is called by AdministerForm and does administration # on Topics in the DB. TopicAdd is simpler and can only add diff --git a/DocDB/cgi/UserAccessApply b/DocDB/cgi/UserAccessApply index 882bec14..a03c052c 100755 --- a/DocDB/cgi/UserAccessApply +++ b/DocDB/cgi/UserAccessApply @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: UserAccessApply # Description: Deal with the process of having a user apply to use DocDB via their certificate diff --git a/DocDB/cgi/VEntryOutput.pm b/DocDB/cgi/VEntryOutput.pm index 41153109..b1815b14 100644 --- a/DocDB/cgi/VEntryOutput.pm +++ b/DocDB/cgi/VEntryOutput.pm @@ -97,8 +97,23 @@ sub ICalEventEntry { my $ICalFormatter = DateTime::Format::ICal->new(); - $EventHash{dtstart} = $ICalFormatter->format_datetime($Conferences{$EventID}{StartDateTime}); - $EventHash{dtend} = $ICalFormatter->format_datetime($Conferences{$EventID}{EndDateTime}); + my $formated_dtstart = $ICalFormatter->format_datetime($Conferences{$EventID}{StartDateTime}); + if ($formated_dtstart =~ m/TZID=/) { + my ($timezone, $timestamp) = split(':', $formated_dtstart, 2); + $EventHash{'dtstart;'.$timezone} = $timestamp + } + else { + $EventHash{dtstart} = $formated_dtstart + } + my $formated_dtend = $ICalFormatter->format_datetime($Conferences{$EventID}{EndDateTime}); + if ($formated_dtend =~ m/TZID=/) { + my ($timezone, $timestamp) = split(':', $formated_dtend, 2); + $EventHash{'dtend;'.$timezone} = $timestamp + } + else { + $EventHash{dtend} = $formated_dtend + } + $EventHash{"LAST-MODIFIED"} = $ICalFormatter->format_datetime($Conferences{$EventID}{ModifiedDateTime}); foreach my $Key (keys %ICalMapping) { @@ -154,8 +169,23 @@ sub ICalSessionEntry { SessionEndTime($SessionID); my $ICalFormatter = DateTime::Format::ICal->new(); - $SessionHash{dtstart} = $ICalFormatter->format_datetime($Sessions{$SessionID}{StartDateTime}); - $SessionHash{dtend} = $ICalFormatter->format_datetime($Sessions{$SessionID}{EndDateTime}); + my $formated_dtstart = $ICalFormatter->format_datetime($Sessions{$SessionID}{StartDateTime}); + if ($formated_dtstart =~ m/TZID=/) { + my ($timezone, $timestamp) = split(':', $formated_dtstart, 2); + $SessionHash{'dtstart;'.$timezone} = $timestamp + } + else { + $SessionHash{dtstart} = $formated_dtstart + } + my $formated_dtend = $ICalFormatter->format_datetime($Sessions{$SessionID}{EndDateTime}); + if ($formated_dtend =~ m/TZID=/) { + my ($timezone, $timestamp) = split(':', $formated_dtend, 2); + $SessionHash{'dtend;'.$timezone} = $timestamp + } + else { + $SessionHash{dtend} = $formated_dtend + } + $SessionHash{"LAST-MODIFIED"} = $ICalFormatter->format_datetime($Sessions{$SessionID}{ModifiedDateTime}); foreach my $Key (keys %ICalMapping) { diff --git a/DocDB/cgi/WatchDocument b/DocDB/cgi/WatchDocument index c993bd8a..7b9c4f81 100755 --- a/DocDB/cgi/WatchDocument +++ b/DocDB/cgi/WatchDocument @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: WatchDocument # Description: Change preferences for what/when to be notified of document diff --git a/DocDB/cgi/XMLUpload b/DocDB/cgi/XMLUpload index 3619aeb6..b0e0b5a1 100755 --- a/DocDB/cgi/XMLUpload +++ b/DocDB/cgi/XMLUpload @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Name: $RCSfile$ # Description: Allows the user to provide an XML file with all the data describing a document. diff --git a/DocDB/cgi/XSearch b/DocDB/cgi/XSearch index 3ce7ba74..f1f5945a 100755 --- a/DocDB/cgi/XSearch +++ b/DocDB/cgi/XSearch @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) # diff --git a/DocDB/scripts/CheckModules b/DocDB/scripts/CheckModules index 78d60fc7..fd8afc8b 100755 --- a/DocDB/scripts/CheckModules +++ b/DocDB/scripts/CheckModules @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) # diff --git a/DocDB/scripts/CheckSubUsed b/DocDB/scripts/CheckSubUsed index a7b88496..cdbc204a 100755 --- a/DocDB/scripts/CheckSubUsed +++ b/DocDB/scripts/CheckSubUsed @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) # diff --git a/DocDB/scripts/ContentSearch.template b/DocDB/scripts/ContentSearch.template index de650d68..d10575a2 100755 --- a/DocDB/scripts/ContentSearch.template +++ b/DocDB/scripts/ContentSearch.template @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) # diff --git a/DocDB/scripts/FullList b/DocDB/scripts/FullList index 4af22fd9..90153bee 100755 --- a/DocDB/scripts/FullList +++ b/DocDB/scripts/FullList @@ -1,4 +1,8 @@ #! /usr/bin/env perl + +use lib "."; + +# # # Description: Invoke with "-u username" which will generate an HTML list of # all the documents that user is allowed to see. Redirect to a diff --git a/DocDB/scripts/NotifyDigest b/DocDB/scripts/NotifyDigest index f3fd259f..fcc96674 100755 --- a/DocDB/scripts/NotifyDigest +++ b/DocDB/scripts/NotifyDigest @@ -1,4 +1,7 @@ #! /usr/bin/env perl + +use lib "."; + # # Author Eric Vaandering (ewv@fnal.gov) #