You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2021/06/21 23:02:03 UTC

[whimsy] branch master updated: Drop specials that may terminate names

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new a242cb6  Drop specials that may terminate names
a242cb6 is described below

commit a242cb6d9ca4e5680024f2629decf534b19a8b1f
Author: Sebb <se...@apache.org>
AuthorDate: Tue Jun 22 00:01:54 2021 +0100

    Drop specials that may terminate names
---
 www/members/ldap-namecheck.cgi | 7 +++++--
 www/secretary/ldap-names.cgi   | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/www/members/ldap-namecheck.cgi b/www/members/ldap-namecheck.cgi
index c201606..dcc43c1 100755
--- a/www/members/ldap-namecheck.cgi
+++ b/www/members/ldap-namecheck.cgi
@@ -88,7 +88,7 @@ _html do
       next unless public_name # Don't check entries not in iclas.txt
 
       cnOK = (public_name == p.cn)
-      pnames=public_name.gsub(',', '').split
+      pnames=public_name.gsub(%r{[(),]}, '').split # drop special characters that may terminate names
       missingGiven = given.split.any? {|one| ! (one == p.uid or pnames.include?(one) or pnames.any? {|pn| ASF::Person.names_equivalent?(pn, one)})}
       missingsn = p.sn.split.any? {|one| ! (one == p.uid or pnames.include? one or pnames.any? {|pn| ASF::Person.names_equivalent?(pn, one)})}
       if givenOK and snOK and cnOK and ! missingGiven and ! missingsn # all checks OK
@@ -114,7 +114,10 @@ _html do
           elsif new_given == ''
             _del given # entry should be removed
           else
-            _em given
+            _em given.inspect
+          end
+          if missingGiven
+            _ [pnames,given.split]
           end
         end
         _td! copyAble: 'true' do
diff --git a/www/secretary/ldap-names.cgi b/www/secretary/ldap-names.cgi
index 84abfe8..d1b4825 100755
--- a/www/secretary/ldap-names.cgi
+++ b/www/secretary/ldap-names.cgi
@@ -141,7 +141,7 @@ _html do
       next unless public_name # Don't check entries not in iclas.txt
 
       cnOK = (public_name == p.cn)
-      pnames=public_name.gsub(',', '').split
+      pnames=public_name.gsub(%r{[(),]}, '').split # drop special characters that may terminate names
       missingGiven = given.split.any? {|one| ! (one == p.uid or pnames.include?(one) or pnames.any? {|pn| ASF::Person.names_equivalent?(pn, one)})}
       missingsn = p.sn.split.any? {|one| ! (one == p.uid or pnames.include? one or pnames.any? {|pn| ASF::Person.names_equivalent?(pn, one)})}
       if givenOK and snOK and cnOK and ! missingGiven and ! missingsn # all checks OK