Skip to content

Commit c676140

Browse files
committed
rename confusing variables
1 parent c655d77 commit c676140

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Diff for: resources/lib/UnityLDAP.php

+6-7
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ private function GIDNumInUse($id)
193193
return false;
194194
}
195195

196-
public function getUnassignedID($uid, $UnitySQL)
196+
public function getUnassignedIDNum($uid, $UnitySQL)
197197
{
198198
$netid = strtok($uid, "_"); // extract netid
199199
// scrape all files in custom folder
@@ -203,13 +203,12 @@ public function getUnassignedID($uid, $UnitySQL)
203203
// found csv file
204204
$handle = fopen($fileinfo->getPathname(), "r");
205205
while (($data = fgetcsv($handle, 1000, ",")) !== false) {
206-
$netid_match = $data[0];
207-
$uid_match = $data[1];
208-
209-
if ($uid == $netid_match || $netid == $netid_match) {
206+
$customMappingNetID = $data[0];
207+
$customMappingIDNumber = $data[1];
208+
if ($uid == $customMappingNetID || $netid == $customMappingNetID) {
210209
// found a match
211-
if (!$this->UIDNumInUse($uid_match) && !$this->GIDNumInUse($uid_match)) {
212-
return $uid_match;
210+
if (!$this->UIDNumInUse($customMappingIDNumber) && !$this->GIDNumInUse($customMappingIDNumber)) {
211+
return $CustomMappingIDNumber;
213212
}
214213
}
215214
}

Diff for: resources/lib/UnityUser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function init($send_mail = true)
5353
// Create LDAP group
5454
//
5555
$ldapGroupEntry = $this->getLDAPGroup();
56-
$id = $this->LDAP->getUnassignedID($this->getUID(), $this->SQL);
56+
$id = $this->LDAP->getUnassignedIDNum($this->getUID(), $this->SQL);
5757

5858
if (!$ldapGroupEntry->exists()) {
5959
$ldapGroupEntry->setAttribute("objectclass", UnityLDAP::POSIX_GROUP_CLASS);

0 commit comments

Comments
 (0)