From 196b0357663de8fcafd051b2a50db53c426bc0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Athayde=20Marcondes=20de=20Andr=C3=A9?= Date: Wed, 20 Mar 2019 19:35:51 +0100 Subject: [PATCH 1/9] Set explicitly a value in case options not selected so the insert works without a problem in my installation -- otherwise it tried inserting text1,,text3 and that was an error in my sql version. --- DocDB/cgi/GroupAdminister | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DocDB/cgi/GroupAdminister b/DocDB/cgi/GroupAdminister index 07de410f..cee2fd87 100755 --- a/DocDB/cgi/GroupAdminister +++ b/DocDB/cgi/GroupAdminister @@ -64,10 +64,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); From 0fc333ed186b4469b0728bba875938be66914c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Athayde=20Marcondes=20de=20Andr=C3=A9?= Date: Wed, 20 Mar 2019 19:37:20 +0100 Subject: [PATCH 2/9] Do not provide GroupID on insert when creating user. MYSQL is set to auto increment so that will not be an issue anyway --- DocDB/cgi/GroupAdminister | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DocDB/cgi/GroupAdminister b/DocDB/cgi/GroupAdminister index cee2fd87..e4d50bc3 100755 --- a/DocDB/cgi/GroupAdminister +++ b/DocDB/cgi/GroupAdminister @@ -246,8 +246,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 From 4f28fed5d5d17cfdb77fe1f1e7a5bcb085f0314c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Athayde=20Marcondes=20de=20Andr=C3=A9?= Date: Wed, 20 Mar 2019 19:42:01 +0100 Subject: [PATCH 3/9] Change formating of dtstart and dtend: a colon(:) separator in this case makes it not work when importing to external calendar programs, while a semi-colon (;) works. This is a workaround to deal with that. --- DocDB/cgi/VEntryOutput.pm | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) 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) { From 0bcb322389926f577f67ba1f02d5e037590c4be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Athayde=20Marcondes=20de=20Andr=C3=A9?= Date: Wed, 20 Mar 2019 19:43:47 +0100 Subject: [PATCH 4/9] Fixes deprecation warning: AH01215: Using a hash as a reference is deprecated at .... --- DocDB/cgi/DocDBHelp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DocDB/cgi/DocDBHelp b/DocDB/cgi/DocDBHelp index ea18350c..88f06093 100755 --- a/DocDB/cgi/DocDBHelp +++ b/DocDB/cgi/DocDBHelp @@ -54,15 +54,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 From 026adce85e4eabe247092765df65afe0e447bf23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Athayde=20Marcondes=20de=20Andr=C3=A9?= Date: Wed, 20 Mar 2019 19:46:03 +0100 Subject: [PATCH 5/9] In my perl installation . is not included by default. Include it as we need to be able to use the localy defined .pm files --- DocDB/cgi/AddFiles | 3 +++ DocDB/cgi/AddFilesForm | 3 +++ DocDB/cgi/AdministerForm | 3 +++ DocDB/cgi/AdministerHome | 3 +++ DocDB/cgi/AuthorAdd | 3 +++ DocDB/cgi/AuthorAddForm | 3 +++ DocDB/cgi/AuthorAdminister | 3 +++ DocDB/cgi/BulkCertificateInsert | 3 +++ DocDB/cgi/CertificateApplyForm | 3 +++ DocDB/cgi/ConfirmTalkHint | 3 +++ DocDB/cgi/CustomListForm | 3 +++ DocDB/cgi/DeleteConfirm | 3 +++ DocDB/cgi/DeleteDocument | 3 +++ DocDB/cgi/DisplayMeeting | 3 +++ DocDB/cgi/DocDBHelp | 3 +++ DocDB/cgi/DocDBInstructions | 3 +++ DocDB/cgi/DocTypeAdminister | 3 +++ DocDB/cgi/DocumentAddForm | 3 +++ DocDB/cgi/DocumentDatabase | 3 +++ DocDB/cgi/EditTalkInfo | 3 +++ DocDB/cgi/EmailAdminister | 3 +++ DocDB/cgi/EmailAdministerForm | 3 +++ DocDB/cgi/EmailLogin | 3 +++ DocDB/cgi/EventAdministerForm | 3 +++ DocDB/cgi/ExternalDocDBAdministerForm | 3 +++ DocDB/cgi/GroupAdminister | 3 +++ DocDB/cgi/GroupAdministerForm | 3 +++ DocDB/cgi/InstitutionAdminister | 3 +++ DocDB/cgi/JournalAdminister | 3 +++ DocDB/cgi/KeywordAdministerForm | 3 +++ DocDB/cgi/KeywordGroupAdminister | 3 +++ DocDB/cgi/KeywordListAdminister | 3 +++ DocDB/cgi/ListAllMeetings | 3 +++ DocDB/cgi/ListAuthors | 3 +++ DocDB/cgi/ListBy | 3 +++ DocDB/cgi/ListEventsBy | 3 +++ DocDB/cgi/ListGroupUsers | 3 +++ DocDB/cgi/ListGroups | 3 +++ DocDB/cgi/ListKeywords | 3 +++ DocDB/cgi/ListManagedDocuments | 3 +++ DocDB/cgi/ListTopics | 3 +++ DocDB/cgi/ListTypes | 3 +++ DocDB/cgi/MeetingModify | 3 +++ DocDB/cgi/ModifyHome | 3 +++ DocDB/cgi/ProcessDocumentAdd | 3 +++ DocDB/cgi/RetrieveArchive | 3 +++ DocDB/cgi/RetrieveFile | 3 +++ DocDB/cgi/SSOAccessApply | 3 +++ DocDB/cgi/Search | 3 +++ DocDB/cgi/SearchForm | 3 +++ DocDB/cgi/SelectEmailPrefs | 3 +++ DocDB/cgi/SelectGroups | 3 +++ DocDB/cgi/SelectPrefs | 3 +++ DocDB/cgi/SessionModify | 3 +++ DocDB/cgi/SetGroups | 3 +++ DocDB/cgi/SetPrefs | 3 +++ DocDB/cgi/ShowCalendar | 3 +++ DocDB/cgi/ShowDocument | 3 +++ DocDB/cgi/ShowTalkNote | 3 +++ DocDB/cgi/SignRevision | 3 +++ DocDB/cgi/SignatureReport | 3 +++ DocDB/cgi/SignoffChooser | 3 +++ DocDB/cgi/Statistics | 3 +++ DocDB/cgi/TopicAdminister | 3 +++ DocDB/cgi/UserAccessApply | 3 +++ DocDB/cgi/WatchDocument | 3 +++ DocDB/cgi/XMLUpload | 3 +++ DocDB/cgi/XSearch | 3 +++ DocDB/scripts/CheckModules | 3 +++ DocDB/scripts/CheckSubUsed | 3 +++ DocDB/scripts/ContentSearch.template | 3 +++ DocDB/scripts/FullList | 4 ++++ DocDB/scripts/NotifyDigest | 3 +++ 73 files changed, 220 insertions(+) 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/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 88f06093..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 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..45fabc54 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 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 e4d50bc3..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 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..0fb3108a 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 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/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/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..9c05cd11 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, 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/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) # From e799bf6cba611f7135bdfbaa3d96b34940a5d1a0 Mon Sep 17 00:00:00 2001 From: Sho Uemura Date: Fri, 9 Jun 2017 20:54:30 -0500 Subject: [PATCH 6/9] use array instead of hash for radio button group On any of the administration pages with new/delete/modify radio buttons (e.g. AdministerForm), our DocDB installation (DocDB 8.8.6) orders the radio buttons randomly. I don't think this can be intended behavior, and AuthorAdminDisable.js expects a consistent ordering of [new, delete, modify]. I think this is a bug in the AdministerActions method of AdministerElements.pm, which exists in trunk as well as in 8.8.6. The button names are stored in a hash when an array is appropriate. This commit fixes the bug. --- DocDB/cgi/AdministerElements.pm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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();"); }; From 5348f78754ae6751ea353b50a023bb36a4e55f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Athayde=20Marcondes=20de=20Andr=C3=A9?= Date: Fri, 22 Mar 2019 14:48:40 +0100 Subject: [PATCH 7/9] Only show users that make sense in viewable/modifiable by lists. This could already be accomplished by passing a list of users in a group, but with this change it becomes easier to set the required permissions by looking at the MYSQL current permission list. The option is already used in the forms for creating new users or events. --- DocDB/cgi/DocumentAddForm | 2 ++ DocDB/cgi/MeetingModify | 2 ++ DocDB/cgi/SecurityHTML.pm | 13 ++++++++++++- DocDB/cgi/SessionModify | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/DocDB/cgi/DocumentAddForm b/DocDB/cgi/DocumentAddForm index 45fabc54..cc8d90a6 100755 --- a/DocDB/cgi/DocumentAddForm +++ b/DocDB/cgi/DocumentAddForm @@ -522,6 +522,7 @@ SecurityScroll(-addpublic => 'true', -helplink => 'security', -helptext => $SecurityText, -multiple => $TRUE, + -permission=> 'CanView', -default => \@SecurityDefaults); print "\n"; if ($EnhancedSecurity) { @@ -530,6 +531,7 @@ if ($EnhancedSecurity) { -helplink => 'modifygroups', -helptext => 'Can Modify', -multiple => $TRUE, + -permission=> 'CanCreate', -default => \@ModifyDefaults); print "\n"; } diff --git a/DocDB/cgi/MeetingModify b/DocDB/cgi/MeetingModify index 0fb3108a..0d93f8c2 100755 --- a/DocDB/cgi/MeetingModify +++ b/DocDB/cgi/MeetingModify @@ -531,6 +531,7 @@ if ($NoSessions) { -helplink => 'meetingviewgroups', -helptext => 'Viewable by', -multiple => $TRUE, + -permission=> 'CanView', -default => \@MeetingViewDefaults, -size => 8); print "\n"; @@ -541,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/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/SessionModify b/DocDB/cgi/SessionModify index 9c05cd11..695bc0cd 100755 --- a/DocDB/cgi/SessionModify +++ b/DocDB/cgi/SessionModify @@ -591,6 +591,7 @@ if ($SingleSession) { -helplink => 'meetingviewgroups', -helptext => 'Viewable by', -multiple => true, + -permission=> 'CanView', -default => \@MeetingViewDefaults, -size => 8); print "\n"; @@ -599,6 +600,7 @@ if ($SingleSession) { -helplink => 'meetingmodifygroups', -helptext => 'Modifiable by', -multiple => true, + -permission=> 'CanCreate', -default => \@MeetingModifyDefaults, -size => 8); print "\n"; From f4f9c1430be48f8c10d4797d8161c983adb1f55c Mon Sep 17 00:00:00 2001 From: JP Date: Wed, 17 Apr 2024 16:56:35 +0200 Subject: [PATCH 8/9] Due to a change in mysql version the way to search with regexps changed... See https://stackoverflow.com/questions/59998409/error-code-3685-illegal-argument-to-a-regular-expression This question will probably become more popular as adoption of MySQL 8.0 increases and previously-stored SQL queries using REGEXP start to break. According to MySQL 8.0 Reference Manual / ... / Regular Expressions, "MySQL implements regular expression support using International Components for Unicode (ICU)." According to MySQL 5.6 Reference Manual / ... / Regular Expressions, "MySQL uses Henry Spencer's implementation of regular expressions." Therefore, since you are using MySQL 8.0, rather than using [[:<:]] and [[:>:]], you can now use \b. Your query might look like this: SELECT * FROM `rulebook`.`node__body` WHERE `body_value` REGEXP "\\bDVP\\b" ; --- DocDB/cgi/SearchAtoms.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); From 55a5908ffa1d2e74896465aa91b7274aa253c8b9 Mon Sep 17 00:00:00 2001 From: JP Date: Wed, 17 Apr 2024 16:56:35 +0200 Subject: [PATCH 9/9] Due to a change in mysql version the way to search with regexps changed... See https://stackoverflow.com/questions/59998409/error-code-3685-illegal-argument-to-a-regular-expression --- DocDB/cgi/SearchAtoms.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);