lib/api

Aleksander Machniak machniak at kolabsys.com
Fri Sep 20 15:40:55 CEST 2013


 lib/api/kolab_api_service_form_value.php |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 2b8f477c86f56cb23cced480779a40ff5443433d
Author: Aleksander Machniak <alec at alec.pl>
Date:   Fri Sep 20 15:39:42 2013 +0200

    Email address validation for field with validate=simple validates
    only address syntax, domain checks are skipped (Bug #1138)

diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index 1e4b044..bd8256d 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -1103,6 +1103,10 @@ class kolab_api_service_form_value extends kolab_api_service
                 throw new Exception("Invalid email address '$mail_address'", 692);
             }
 
+            if ($validation_type == self::VALIDATE_BASIC) {
+                continue;
+            }
+
             // Only validate the 'alias' attribute is in any of my domain name
             // spaces if indeed it is listed as a mail attribute.
             if (in_array('alias', $conf->get_list('mail_attributes'))) {
@@ -1111,7 +1115,6 @@ class kolab_api_service_form_value extends kolab_api_service
                 }
             }
         }
-
     }
 
     private function validate_associateddomain($value, $postdata = array(), $validation_type = null)
@@ -1160,6 +1163,10 @@ class kolab_api_service_form_value extends kolab_api_service
                 throw new Exception("Invalid email address '$mail_address'", 692);
             }
 
+            if ($validation_type == self::VALIDATE_BASIC) {
+                continue;
+            }
+
             // Only validate the 'mail' attribute is in any of my domain name
             // spaces if indeed it is listed as a mail attribute.
             if (in_array('mail', $conf->get_list('mail_attributes'))) {
@@ -1197,6 +1204,10 @@ class kolab_api_service_form_value extends kolab_api_service
                 throw new Exception("Invalid email address '$mail_address'", 692);
             }
 
+            if ($validation_type == self::VALIDATE_BASIC) {
+                continue;
+            }
+
             // Only validate the 'mailalternateaddress' attribute is in any of my domain name
             // spaces if indeed it is listed as a mail attribute.
             if (in_array('mailalternateaddress', $conf->get_list('mail_attributes'))) {




More information about the commits mailing list