fixed a bug during ldap import from openldap when a user has email aliases, too

This commit is contained in:
SJ 2012-12-11 22:13:52 +01:00
parent 49cc33aa34
commit 83224cd9d3

View File

@ -50,7 +50,7 @@ class ModelUserImport extends Model {
for($i = 0; $i < $result[$__mail_attr]['count']; $i++) { for($i = 0; $i < $result[$__mail_attr]['count']; $i++) {
LOGGER("found email entry: " . $result['dn'] . " => $__mail_attr:" . $result[$__mail_attr][$i]); LOGGER("found email entry: " . $result['dn'] . " => $__mail_attr:" . $result[$__mail_attr][$i]);
if(preg_match("/^smtp\:/i", $result[$__mail_attr][$i])) { if(preg_match("/^smtp\:/i", $result[$__mail_attr][$i]) || strchr($result[$__mail_attr][$i], '@') ) {
$emails .= strtolower(preg_replace("/^smtp\:/i", "", $result[$__mail_attr][$i])) . "\n"; $emails .= strtolower(preg_replace("/^smtp\:/i", "", $result[$__mail_attr][$i])) . "\n";
} }
} }