From 915135b3ce46d3ee2730ac6e16678eceb5b73601 Mon Sep 17 00:00:00 2001
From: Roland Gruber
Date: Mon, 27 Sep 2004 19:13:06 +0000
Subject: [PATCH] fixed error output
---
lam/templates/massBuildAccounts.php | 46 ++++++++++++++---------------
1 file changed, 22 insertions(+), 24 deletions(-)
diff --git a/lam/templates/massBuildAccounts.php b/lam/templates/massBuildAccounts.php
index c337bfa3..a58758f3 100644
--- a/lam/templates/massBuildAccounts.php
+++ b/lam/templates/massBuildAccounts.php
@@ -130,8 +130,12 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
for ($i = 0; $i < sizeof($invalidColumns); $i++) {
$errors[] = array(_("One or more values of the required column \"$invalidColumns[$i]\" are missing."), "");
}
+ // if input data is invalid just display error messages (max 50)
+ if (sizeof($errors) > 0) {
+ for ($i = 0; $i < sizeof($errors); $i++) StatusMessage("ERROR", $errors[$i][0], $errors[$i][1]);
+ }
// let modules build accounts
- if (sizeof($errors) < 1) {
+ else {
$accounts = buildUploadAccounts($_POST['scope'], $data, $ids);
if ($accounts != false) {
// set DN
@@ -145,31 +149,25 @@ 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 "" . _("LAM has checked your input and is now ready to create the accounts.") . "
\n";
+ echo "
\n";
+ echo "\n";
+ echo "
\n";
+ echo "
\n";
}
}
- // if input data is invalid just display error messages (max 50)
- if (sizeof($errors) > 0) {
- for ($i = 0; (($i < sizeof($errors)) || ($i > 49)); $i++) StatusMessage("ERROR", $errors[$i][0], $errors[$i][1]);
- }
- else {
- // 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 "" . _("LAM has checked your input and is now ready to create the accounts.") . "
\n";
- echo "
\n";
- echo "\n";
- echo "
\n";
- echo "\n";
- }
}
echo "