diff --git a/lam/templates/massBuildAccounts.php b/lam/templates/massBuildAccounts.php index 043943db..96bc9f31 100644 --- a/lam/templates/massBuildAccounts.php +++ b/lam/templates/massBuildAccounts.php @@ -108,7 +108,7 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) { $checkcolumns = array(); $columns = call_user_func_array('array_merge', $columns); for ($i = 0; $i < sizeof($columns); $i++) { - if ($columns[$i]['required'] == true) { + if (isset($columns[$i]['required']) && ($columns[$i]['required'] == true)) { if (isset($ids[$columns[$i]['name']])) $checkcolumns[] = $ids[$columns[$i]['name']]; else $errors[] = array(_("A required column is missing in your CSV file."), $columns[$i]['name']); } @@ -161,7 +161,7 @@ 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(_("Data field for RDN is empty for account $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 else { $account_dn = $data[$i][$ids['dn_rdn']] . "=" . $accounts[$i][$data[$i][$ids['dn_rdn']]] . ","; @@ -170,23 +170,29 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) { $accounts[$i]['dn'] = $account_dn; } } - // store accounts in session - $_SESSION['mass_accounts'] = $_SESSION['ldap']->encrypt(serialize($accounts)); - $_SESSION['mass_counter'] = 0; - $_SESSION['mass_errors'] = array(); - // show links for upload and LDIF export - echo "
\n"; - echo "
\n"; - echo "
\n"; - echo "" . _("Upload accounts to LDAP") . ""; - echo " | \n"; - echo "\n"; - echo "" . _("Show LDIF file") . ""; - echo " | \n"; - echo "
\n"; + echo "
\n"; + echo "
\n"; + echo "" . _("Upload accounts to LDAP") . ""; + echo " | \n"; + echo "\n"; + echo "" . _("Show LDIF file") . ""; + echo " | \n"; + echo "