added warning if local address is already in use

This commit is contained in:
Roland Gruber 2006-07-17 17:45:53 +00:00
parent 48cbd62917
commit 014c4e53e4
2 changed files with 17 additions and 1 deletions

View File

@ -1,4 +1,10 @@
04.07.2006 1.0.3
??? 1.0.4
- added Russian translation
- inetLocalMailRecipient: print warning if local address is already in use
- fixed bugs:
05.07.2006 1.0.3
- fixed bugs:
-> Kolab: fixed problem with message about missing password
-> Unix groups: fixed auto GID

View File

@ -221,6 +221,16 @@ class inetLocalMailRecipient extends baseModule {
if (isset($post['localAdr']) && ($post['localAdr'] != "")) {
// check if address has correct format
if (get_preg($post['localAdr'], 'mailLocalAddress')) {
// check if new address is not already in database
$data = $_SESSION['cache']->get_cache('mailLocalAddress', 'inetLocalMailRecipient', 'user');
$keys = array_keys($data);
for ($i = 0; $i < sizeof($keys); $i++) {
$adrList = $data[$keys[$i]];
if (in_array_ignore_case($post['localAdr'], $adrList)) {
$errors['localAdr'][] = array('WARN', _('This mail address is already in use:') . " " . $post['localAdr'], $keys[$i]);
break;
}
}
$this->attributes['mailLocalAddress'][] = $post['localAdr'];
}
else {