diff --git a/lam/lib/modules/nisMailAlias.inc b/lam/lib/modules/nisMailAlias.inc index f2d0d82f..c565e037 100644 --- a/lam/lib/modules/nisMailAlias.inc +++ b/lam/lib/modules/nisMailAlias.inc @@ -437,14 +437,8 @@ class nisMailAlias extends baseModule { if (!in_array("nisMailAlias", $partialAccounts[$i]['objectClass'])) $partialAccounts[$i]['objectClass'][] = "nisMailAlias"; // add alias name // check format - if (get_preg($rawAccounts[$i][$ids['nisMailAlias_alias']], 'nis_alias')) { - $partialAccounts[$i]['cn'] = $rawAccounts[$i][$ids['nisMailAlias_alias']]; - } - else { - $errMsg = $this->messages['alias'][1]; - array_push($errMsg, array($i)); - $messages[] = $errMsg; - } + $this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'nisMailAlias_alias', 'cn', + 'nis_alias', $this->messages['alias'][1], $messages); // add recipients if ($rawAccounts[$i][$ids['nisMailAlias_recipients']] != "") { $aliases = explode(',', $rawAccounts[$i][$ids['nisMailAlias_recipients']]); diff --git a/lam/lib/modules/nisnetgroup.inc b/lam/lib/modules/nisnetgroup.inc index 76198487..66933853 100644 --- a/lam/lib/modules/nisnetgroup.inc +++ b/lam/lib/modules/nisnetgroup.inc @@ -526,9 +526,7 @@ class nisnetgroup extends baseModule { // add cn $partialAccounts[$i]['cn'] = $rawAccounts[$i][$ids['nisnetgroup_cn']]; // description (UTF-8, no regex check needed) - if ($rawAccounts[$i][$ids['nisnetgroup_description']] != "") { - $partialAccounts[$i]['description'] = $rawAccounts[$i][$ids['nisnetgroup_description']]; - } + $this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'nisnetgroup_description', 'description'); // additional groups if ($rawAccounts[$i][$ids['nisnetgroup_subgroups']] != "") { $groups = explode(",", $rawAccounts[$i][$ids['nisnetgroup_subgroups']]);