From 0060963927d992e06410aad4bf088b246f970a04 Mon Sep 17 00:00:00 2001 From: thomasb Date: Thu, 12 May 2011 20:18:19 +0000 Subject: 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 --- roundcubemail/program/include/rcube_ldap.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'roundcubemail/program/include/rcube_ldap.php') 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 @@ -609,6 +609,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 * -- cgit v1.2.3