Fix case-sensitivity issues in mailing lists
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 9 Nov 2006 15:02:03 +0000 (15:02 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 9 Nov 2006 15:02:03 +0000 (15:02 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1066 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
bin/lists.rpc.py
modules/xnetgrp.php
modules/xnetlists.php

index 46feb82..424ae23 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@ Bug/Wish:
 
     * Lists:
         - #485: Can moderate pure-HTML mails                               -FRU
+        - #532: Fix case sensitivity issues in emails processing           -FRU
 
     * Profile:
         - #451: vCard are RFC compliant                                    -FRU
index a804005..36245de 100755 (executable)
@@ -191,7 +191,7 @@ def to_forlife(email):
             return res
         else:
             return (None, None)
-    return (email, mbox)
+    return (email.lower(), mbox)
 
 ##
 # see /usr/lib/mailman/bin/rmlist
@@ -295,7 +295,7 @@ def get_lists(userdesc, perms, vhost, email=None):
     if email is None:
         udesc = userdesc
     else:
-        udesc = UserDesc(email, email, None, 0)
+        udesc = UserDesc(email.lower(), email.lower(), None, 0)
     prefix = vhost.lower()+VHOST_SEP
     names = Utils.list_names()
     names.sort()
@@ -401,7 +401,7 @@ def replace_email(userdesc, perms, vhost, listname, from_email, to_email):
             return 0
 
         mlist.Lock()
-        mlist.ApprovedChangeMemberAddress(from_email, to_email, 0)
+        mlist.ApprovedChangeMemberAddress(from_email.lower(), to_email.lower(), 0)
         mlist.Save()
         mlist.Unlock()
         return 1
index 5091835..ab4b9b2 100644 (file)
@@ -756,7 +756,7 @@ class XnetGrpModule extends PLModule
                              $globals->asso('mail_domain'));
 
         if (Post::has('change')) {
-            $email_changed = ($user['origine'] != 'X' && $user['email'] != Post::v('email'));
+            $email_changed = ($user['origine'] != 'X' && strtolower($user['email']) != strtolower(Post::v('email')));
             $from_email = $user['email'];
             if ($user['origine'] != 'X') {
                 XDB::query('UPDATE groupex.membres
index cbadb49..47e325b 100644 (file)
@@ -198,7 +198,7 @@ class XnetListsModule extends ListsModule
 
         list(,$members) = $this->client->get_members($liste);
         $mails = array_map(create_function('$arr', 'return $arr[1];'), $members);
-        $subscribers = array_unique(array_merge($subscribers, $mails));
+        $subscribers = array_unique($mails);
 
         $not_in_group_x = array();
         $not_in_group_ext = array();
@@ -219,7 +219,7 @@ class XnetListsModule extends ListsModule
         $not_in_list = array();
 
         while ($tmp = $ann->next()) {
-            if (!in_array($tmp['email'], $subscribers)) {
+            if (!in_array(strtolower($tmp['email']), $subscribers)) {
                 $not_in_list[] = $tmp;
             }
         }