File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments