function generate_newuid_js() { $tpl = new templates(); header("content-type: application/x-javascript"); $LastUidNumber = LastUidNumber(); $uid = $_GET["userid"]; $user = new user($uid); $user->uidNumber = $LastUidNumber; if (!$user->edit_system()) { echo "alert('" . $tpl->javascript_parse_text("{failed}") . "')"; return; } echo "alert('" . $tpl->javascript_parse_text("{succes}: N: {$LastUidNumber}") . "');\nRefreshTab('container-users-tabs');"; }
$uid = $result[$i]['uid'][0]; if ($GLOBALS["VERBOSE"]) { echo "[{$id}] = {$uid}\n"; } if (isset($ALR[$id])) { echo "Duplicate entry found for {$uid} = {$id}\n"; $ERROR[$uid] = true; continue; } $ALR[$id] = true; if (count($ERROR) > 0) { if ($GLOBALS["VERBOSE"]) { echo count($ERROR) . " duplicates found...\n"; } while (list($uid, $ligne) = each($ERROR)) { $LastUidNumber = LastUidNumber(); if ($GLOBALS["VERBOSE"]) { echo "fix uid {$uid} with uidNumber={$LastUidNumber}\n"; } $user = new user($uid); $user->uidNumber = $LastUidNumber; $user->edit_system(); } } } function LastUidNumber() { $ldap = new clladp(); $r = @ldap_search($ldap->ldap_connection, $ldap->suffix, '(uidnumber=*)', array("uidnumber", "uid")); if (!$r) { die;