'.$row.' | '.
$_SESSION['accounts'][$row]->general_surname.' | '.
$_SESSION['accounts'][$row]->general_givenname.' | '.
$_SESSION['accounts'][$row]->general_username.' | '.
$_SESSION['accounts'][$row]->general_group.' |
'._('Show Details.').' | ';
for ($i=$row+1; $igeneral_username == $_SESSION['accounts'][$i]->general_username) { // Found user with same name
// Set Info
$_SESSION['errors'][$i][] = array('INFO', _('Warning'), _('Username in use. Selected next free username'));
// get last character of username
$lastchar = substr($_SESSION['accounts'][$i]->general_username, strlen($_SESSION['accounts'][$i]->general_username)-1, 1);
// Last character is no number
if ( !ereg('^([0-9])+$', $lastchar))
$_SESSION['accounts'][$i]->general_username = $_SESSION['accounts'][$i]->general_username . '2';
else {
$j=strlen($_SESSION['accounts'][$i]->general_username)-1;
$mark = false;
while (!$mark) {
if (ereg('^([0-9])+$',substr($_SESSION['accounts'][$i]->general_username, $j, strlen($_SESSION['accounts'][$i]->general_username)-$j))) $j--;
else $mark=true;
}
// increase last number with one
$firstchars = substr($_SESSION['accounts'][$i]->general_username, 0, $j+1);
$lastchars = substr($_SESSION['accounts'][$i]->general_username, $j+1, strlen($_SESSION['accounts'][$i]->general_username)-$j);
$_SESSION['accounts'][$i]->general_username = $firstchars . (intval($lastchars)+1);
}
while ($temp = ldapexists($_SESSION['accounts'][$i], 'user')) {
// get last character of username
$lastchar = substr($_SESSION['accounts'][$i]->general_username, strlen($_SESSION['accounts'][$i]->general_username)-1, 1);
// Last character is no number
if ( !ereg('^([0-9])+$', $lastchar))
$_SESSION['accounts'][$i]->general_username = $_SESSION['accounts'][$i]->general_username . '2';
else {
$j=strlen($_SESSION['accounts'][$i]->general_username)-1;
$mark = false;
while (!$mark) {
if (ereg('^([0-9])+$',substr($_SESSION['accounts'][$i]->general_username, $j, strlen($_SESSION['accounts'][$i]->general_username)-$j))) $i--;
else $mark=true;
}
// increase last number with one
$firstchars = substr($_SESSION['accounts'][$i]->general_username, 0, $j+1);
$lastchars = substr($_SESSION['accounts'][$i]->general_username, $j+1, strlen($_SESSION['accounts'][$i]->general_username)-$j);
$_SESSION['accounts'][$i]->general_username = $firstchars . (intval($lastchars)+1);
}
}
}
}
if ($values->general_username != $return->general_username) $errors[] = array('WARN', _('Username'), _('Username allready in use. Selected next free username.'));
$found=false;
for ($i=0; $i'._('Show Warnings.').'';
echo ' | ';
$found=false;
for ($i=0; $i'._('Show Errors.').'';
echo ' | ';
}
$noerrors=true;
for ($i=0; $i';
if (!$noerrors) { echo ''. _('There are some errors!!') . ' |
'; }
if (!$nowarn) { echo ''. _('There are some warnings.') . ' |
'; }
echo '