diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-05-12 20:18:19 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-05-12 20:18:19 +0000 |
| commit | 0060963927d992e06410aad4bf088b246f970a04 (patch) | |
| tree | ed4fd9bc466a12e6a6e0e81906c4426ed335e032 /roundcubemail/program/include/rcube_ldap.php | |
| parent | 61d95b9ca704b8306c99febb363fb0df8b1748d1 (diff) | |
Improve display name composition when saving contacts (#1487143), with plugin-support; allow empty names in sql address book, fall back to e-mail address in listing and vcard export
git-svn-id: https://svn.roundcube.net/trunk@4752 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_ldap.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_ldap.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/roundcubemail/program/include/rcube_ldap.php b/roundcubemail/program/include/rcube_ldap.php index d9f5a104f..f166fd23a 100644 --- a/roundcubemail/program/include/rcube_ldap.php +++ b/roundcubemail/program/include/rcube_ldap.php @@ -610,6 +610,26 @@ class rcube_ldap extends rcube_addressbook /** + * Check the given data before saving. + * If input not valid, the message to display can be fetched using get_error() + * + * @param array Assoziative array with data to save + * @return boolean True if input is valid, False if not. + */ + public function validate($save_data) + { + // check for name input + if (empty($save_data['name'])) { + $this->set_error('warning', 'nonamewarning'); + return false; + } + + // validate e-mail addresses + return parent::validate($save_data); + } + + + /** * Create a new contact record * * @param array Hash array with save data |
