summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f81294d)
raw | patch | inline | side by side (parent: f81294d)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 Dec 2009 14:34:28 +0000 (14:34 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 Dec 2009 14:34:28 +0000 (14:34 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14860 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/mail/personal/mail/class_mailAccount.inc | patch | blob | history |
diff --git a/gosa-plugins/mail/personal/mail/class_mailAccount.inc b/gosa-plugins/mail/personal/mail/class_mailAccount.inc
index d193a91a3f44c793fbc40702ecb3adfa4d6a6927..3dcc585ea3111b22cf3076aca1decf5509478f5c 100644 (file)
}
if ($valid && ($user= $this->addAlternate ($_POST['alternate_address'])) != ""){
$ui= get_userinfo();
- 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"))."<br><br><i>".
+ "$addon</i>", ERROR_DIALOG);
}
}
if (isset($_POST['delete_alternate']) && isset($_POST['alternates_list'])){
/* Is this address already assigned in LDAP? */
$ldap->cd ($this->config->current['BASE']);
$ldap->search ("(&(!(objectClass=gosaUserTemplate))(objectClass=gosaMailAccount)(|(mail=$address)".
- "(alias=$address)(gosaMailAlternateAddress=$address)))", array("uid"));
+ "(alias=$address)(gosaMailAlternateAddress=$address)))", array("uid", "cn"));
if ($ldap->count() > 0){
$attrs= $ldap->fetch ();
+ if (!isset($attrs["uid"])) {
+ return ("!".$attrs["cn"][0]);
+ }
return ($attrs["uid"][0]);
}
if (!in_array($address, $this->gosaMailAlternateAddress)){
}
}
}else{
- @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__,
- "User uses an own sieve script, skipping sieve update.".$str."</b>","");
- $this->sieve_management->save();
+ if ($this->sieve_management) {
+ @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__,
+ "User uses an own sieve script, skipping sieve update.".$str."</b>","");
+ $this->sieve_management->save();
+ }
}
}
}
$filter = "(&(!(objectClass=gosaUserTemplate))(!(uid=".$this->uid."))".
"(objectClass=gosaMailAccount)".
"(|(mail=".$mail.")(alias=".$mail.")(gosaMailAlternateAddress=".$mail.")))";
- $ldap->search($filter,array("uid"));
+ $ldap->search($filter,array("uid", "cn"));
if ($ldap->count() != 0){
- $message[]= msgPool::duplicated(_("Mail address"));
+ $entry= $ldap->fetch();
+ $addon= "";
+ if (!isset($entry['uid'])) {
+ $addon= sprintf(_("Address is already in use by group '%s'."), $entry['cn'][0]);
+ } else {
+ $addon= sprintf(_("Address is already in use by user '%s'."), $entry['uid'][0]);
+ }
+ $message[]= msgPool::duplicated(_("Mail address"))."<br><br><i>$addon</i>";
}
}