Skip to content

Commit 3d41d58

Browse files
committed
more similar to original
1 parent 74709a0 commit 3d41d58

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

resources/lib/UnityLDAP.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,35 +115,43 @@ public function getDefUserShell()
115115
//
116116
// ID Number selection functions
117117
//
118-
public function getNextUIDNumber(UnitySQL $UnitySQL): int
118+
public function getNextUIDNumber($UnitySQL)
119119
{
120-
$new_id = $UnitySQL->getSiteVar('MAX_UID') + 1;
121-
while ($this->IDNumInUse($new_id)) {
122-
$new_id++;
120+
$max_uid = $UnitySQL->getSiteVar('MAX_UID');
121+
$new_uid = $max_uid + 1;
122+
123+
while ($this->UIDNumInUse($new_uid)) {
124+
$new_uid++;
123125
}
126+
124127
$UnitySQL->updateSiteVar('MAX_UID', $new_id);
128+
125129
return $new_id;
126130
}
127131

128-
public function getNextPiGIDNumber(UnitySQL $UnitySQL): int
132+
public function getNextPiGIDNumber($UnitySQL)
129133
{
130134
$max_pigid = $UnitySQL->getSiteVar('MAX_PIGID');
131135
$new_pigid = $max_pigid + 1;
132-
while ($this->IDNumInUse($new_pigid)) {
136+
137+
while ($this->PIGIDNumInUse($new_pigid)) {
133138
$new_pigid++;
134139
}
135140
$UnitySQL->updateSiteVar('MAX_PIGID', $new_pigid);
136141
return $new_pigid;
137142
}
138143

139-
public function getNextOrgGIDNumber(UnitySQL $UnitySQL): int
144+
public function getNextOrgGIDNumber($UnitySQL)
140145
{
141146
$max_gid = $UnitySQL->getSiteVar('MAX_GID');
142147
$new_gid = $max_gid + 1;
148+
143149
while ($this->IDNumInUse($new_gid)) {
144150
$new_gid++;
145151
}
152+
146153
$UnitySQL->updateSiteVar('MAX_GID', $new_gid);
154+
147155
return $new_gid;
148156
}
149157

0 commit comments

Comments
 (0)