summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2021-09-22 14:24:37 +0200
committerAleksander Machniak <machniak@kolabsys.com>2021-09-22 14:24:37 +0200
commit80be13093571b40f057afaac31105236dcd0e5b2 (patch)
tree1dc6ed38e4432d32c674091aa077341ba45aaffb /lib
parent3705bf348699e7bc8785ca174d9f4b3cf66fc165 (diff)
downloadwebadmin-80be13093571b40f057afaac31105236dcd0e5b2.tar.gz
Make email address domain check case-insensitive
Diffstat (limited to 'lib')
-rw-r--r--lib/api/kolab_api_service_form_value.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index 2edee57..568c3b2 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -1654,6 +1654,7 @@ class kolab_api_service_form_value extends kolab_api_service
}
}
+ $domains = array_map('strtolower', $domains);
$domains = array_unique($domains);
Log::trace("_get_valid_domains result: " . var_export($domains, true));
@@ -1666,10 +1667,11 @@ class kolab_api_service_form_value extends kolab_api_service
$at_index = strrpos($mail_address, "@");
if (is_bool($at_index) && !$at_index) {
throw new Exception("Invalid email address: No domain name space", 235);
- } else {
- $email_domain = substr($mail_address, $at_index+1);
}
+ $email_domain = substr($mail_address, $at_index + 1);
+ $email_domain = strtolower($email_domain);
+
$my_primary_domain = $_SESSION['user']->get_domain();
if ($email_domain == $my_primary_domain) {
@@ -1677,7 +1679,7 @@ class kolab_api_service_form_value extends kolab_api_service
return true;
}
- $valid = false;
+ $valid = false;
Log::trace("_validate_email_address_in_any_of_mydomains(\$mail_address = " . var_export($mail_address, TRUE) . ")");
if (in_array($email_domain, $this->_get_valid_domains($my_primary_domain))) {
@@ -1692,5 +1694,4 @@ class kolab_api_service_form_value extends kolab_api_service
return $valid;
}
-
}