account upload\n";
echo "\n";
// create accounts
$accounts = unserialize($_SESSION['ldap']->decrypt($_SESSION['mass_accounts']));
if ($_SESSION['mass_counter'] < sizeof($accounts)) {
$maxTime = get_cfg_var('max_execution_time') - 5;
$refreshTime = get_cfg_var('max_execution_time') + 1;
$startTime = time();
echo "\n";
echo "\n
\n";
echo "" . _("LDAP upload in progress. Please wait.") . "
\n";
echo "\n";
echo " | ";
echo " |
\n";
echo "
";
flush(); // send HTML to browser
while (($_SESSION['mass_counter'] < sizeof($accounts)) && ($startTime + $maxTime > time())) {
// create accounts as long as max_execution_time is not near
$attrs = $accounts[$_SESSION['mass_counter']];
$dn = $attrs['dn'];
unset($attrs['dn']);
$success = @ldap_add($_SESSION['ldap']->server, $dn, $attrs);
if (!$success) {
$errorMessage = array(
"ERROR",
_("LAM was unable to create account %s! An LDAP error occured."),
ldap_errno($_SESSION[ldap]->server) . ": " . ldap_error($_SESSION[ldap]->server),
array($_SESSION['mass_counter']));
$_SESSION['mass_errors'][] = $errorMessage;
}
$_SESSION['mass_counter']++;
}
echo "