fixed error output

This commit is contained in:
Roland Gruber 2004-09-27 19:13:06 +00:00
parent d4710f6141
commit 915135b3ce
1 changed files with 22 additions and 24 deletions

View File

@ -130,8 +130,12 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
for ($i = 0; $i < sizeof($invalidColumns); $i++) { for ($i = 0; $i < sizeof($invalidColumns); $i++) {
$errors[] = array(_("One or more values of the required column \"$invalidColumns[$i]\" are missing."), ""); $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 // let modules build accounts
if (sizeof($errors) < 1) { else {
$accounts = buildUploadAccounts($_POST['scope'], $data, $ids); $accounts = buildUploadAccounts($_POST['scope'], $data, $ids);
if ($accounts != false) { if ($accounts != false) {
// set DN // set DN
@ -145,31 +149,25 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
$accounts[$i]['dn'] = $account_dn; $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 "<h1 align=\"center\">" . _("LAM has checked your input and is now ready to create the accounts.") . "</h1>\n";
echo "<p>&nbsp;</p>\n";
echo "<p align=\"center\">\n";
echo "<table align=\"center\" width=\"80%\"><tr>\n";
echo "<td align=\"center\" width=\"50%\">\n";
echo "<a href=\"massDoUpload.php\"><b>" . _("Upload accounts to LDAP") . "</b></a>";
echo "</td>\n";
echo "<td align=\"center\" width=\"50%\">\n";
echo "<a href=\"massBuildAccounts.php?showldif=true\"><b>" . _("Show LDIF file") . "</b></a>";
echo "</td>\n";
echo "</tr></table>\n";
echo "</p>\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 "<h1 align=\"center\">" . _("LAM has checked your input and is now ready to create the accounts.") . "</h1>\n";
echo "<p>&nbsp;</p>\n";
echo "<p align=\"center\">\n";
echo "<table align=\"center\" width=\"80%\"><tr>\n";
echo "<td align=\"center\" width=\"50%\">\n";
echo "<a href=\"massDoUpload.php\"><b>" . _("Upload accounts to LDAP") . "</b></a>";
echo "</td>\n";
echo "<td align=\"center\" width=\"50%\">\n";
echo "<a href=\"massBuildAccounts.php?showldif=true\"><b>" . _("Show LDIF file") . "</b></a>";
echo "</td>\n";
echo "</tr></table>\n";
echo "</p>\n";
}
} }
echo "</body>\n"; echo "</body>\n";