summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-20 11:03:35 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-20 12:21:02 +0200
commit9c9a7b3e782386e50933006221a26de54748c170 (patch)
tree6c52e2c2de2f00eafa42157b004abc45fa81066e
parent2cf72fefc2d987f4b97b376cdc13d96998e730db (diff)
downloadwebadmin-9c9a7b3e782386e50933006221a26de54748c170.tar.gz
Ensure any primary email addresses are not included in the result for secondary email addresses
-rw-r--r--lib/kolab_recipient_policy.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/kolab_recipient_policy.php b/lib/kolab_recipient_policy.php
index 492df0b..6667631 100644
--- a/lib/kolab_recipient_policy.php
+++ b/lib/kolab_recipient_policy.php
@@ -175,6 +175,9 @@ class kolab_recipient_policy {
);
$userdata = self::normalize_userdata($userdata);
+ if (!array_key_exists('mail', $userdata)) {
+ $userdata['mail'] = self::primary_mail($userdata);
+ }
$conf = Conf::get_instance();
@@ -234,6 +237,13 @@ class kolab_recipient_policy {
eval("\$result = sprintf('" . $format . "', '" . implode("', '", array_values($result)) . "');");
if ($result = self::parse_email($result)) {
+ // See if the equivalent is already in the 'mail' attribute value(s)
+ if (!empty($userdata['mail'])) {
+ if (strtolower($userdata['mail']) == strtolower($result)) {
+ continue;
+ }
+ }
+
$secondary_mail_addresses[] = $result;
}
}