From 63c3c096d236ebe92b24c24b611e4f8b41117443 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Fri, 3 Jun 2005 11:54:08 +0000 Subject: [PATCH] check if RDN is in list of valid RDN values --- lam/templates/massBuildAccounts.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lam/templates/massBuildAccounts.php b/lam/templates/massBuildAccounts.php index 37b7b5c0..0c8b3e57 100644 --- a/lam/templates/massBuildAccounts.php +++ b/lam/templates/massBuildAccounts.php @@ -161,8 +161,10 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) { if ($accounts != false) { // set DN for ($i = 0; $i < sizeof($accounts); $i++) { - if (!isset($accounts[$i][$data[$i][$ids['dn_rdn']]])) $errors[] = array(_('Account %s:') . ' dn_rdn', _("Data field for RDN is empty!"), array($i)); - // TODO check against list of possible RDN attributes + // check against list of possible RDN attributes + if (!in_array($data[$i][$ids['dn_rdn']], getRDNAttributes($_POST['scope']))) { + $errors[] = array(_('Account %s:') . ' dn_rdn' . $accounts[$i][$data[$i][$ids['dn_rdn']]], _("Invalid RDN attribute!"), array($i)); + } else { $account_dn = $data[$i][$ids['dn_rdn']] . "=" . $accounts[$i][$data[$i][$ids['dn_rdn']]] . ","; if ($data[$i][$ids['dn_suffix']] == "") $account_dn = $account_dn . $_SESSION['config']->get_Suffix($_POST['scope']);