From: cajus Date: Wed, 2 Dec 2009 14:39:28 +0000 (+0000) Subject: Add mail hint, too. Remove the $user == $ui->username check. What is it for? X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c9600cf6ec9fa6ec9f90060d730f7c93e3ad0e76;p=gosa.git Add mail hint, too. Remove the $user == $ui->username check. What is it for? git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14861 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc index a456ea1fc..0f898504f 100644 --- a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc +++ b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc @@ -408,10 +408,14 @@ class mailgroup extends plugin } if ($valid && ($user= $this->addAlternate ($_POST['alternate_address'])) != ""){ $ui= get_userinfo(); - if ($user != $ui->username){ - msg_dialog::display(_("Error"), msgPool::duplicated(_("Mail address"))." ". - sprintf(_("Address is already in use by user '%s'."), $user), ERROR_DIALOG); + $addon= ""; + if ($user[0] == "!") { + $addon= sprintf(_("Address is already in use by group '%s'."), mb_substr($user, 1)); + } else { + $addon= sprintf(_("Address is already in use by user '%s'."), $user); } + msg_dialog::display(_("Error"), msgPool::duplicated(_("Mail address"))."

". + "$addon", ERROR_DIALOG); } } if (isset($_POST['delete_alternate']) && isset($_POST['alternates_list'])){ @@ -1238,10 +1242,13 @@ class mailgroup extends plugin /* Is this address already assigned in LDAP? */ $ldap->cd ($this->config->current['BASE']); $ldap->search ("(&(objectClass=gosaMailAccount)(|(mail=$address)". - "(gosaMailAlternateAddress=$address)))"); + "(gosaMailAlternateAddress=$address)))", array("cn", "uid")); if ($ldap->count() > 0){ $attrs= $ldap->fetch (); + if (!isset($attrs["uid"])) { + return ("!".$attrs["cn"][0]); + } return ($attrs["uid"][0]); }