@@ -86,11 +86,11 @@ public function requestGroup($firstname, $lastname, $email, $org, $send_mail_to_
86
86
}
87
87
88
88
// check if account deletion request already exists
89
- if ($ this ->SQL ->accDeletionRequestExists ($ this ->getOwner ()->getUID () )) {
89
+ if ($ this ->SQL ->accDeletionRequestExists ($ this ->getOwner ()->uid )) {
90
90
return ;
91
91
}
92
92
93
- $ this ->SQL ->addRequest ($ this ->getOwner ()->getUID () , $ firstname , $ lastname , $ email , $ org );
93
+ $ this ->SQL ->addRequest ($ this ->getOwner ()->uid , $ firstname , $ lastname , $ email , $ org );
94
94
95
95
if ($ send_mail ) {
96
96
// send email to requestor
@@ -102,7 +102,7 @@ public function requestGroup($firstname, $lastname, $email, $org, $send_mail_to_
102
102
$ this ->WEBHOOK ->sendWebhook (
103
103
"group_request_admin " ,
104
104
array (
105
- "user " => $ this ->getOwner ()->getUID () ,
105
+ "user " => $ this ->getOwner ()->uid ,
106
106
"org " => $ org ,
107
107
"name " => "$ firstname $ lastname " ,
108
108
"email " => $ email
@@ -114,7 +114,7 @@ public function requestGroup($firstname, $lastname, $email, $org, $send_mail_to_
114
114
"admin " ,
115
115
"group_request_admin " ,
116
116
array (
117
- "user " => $ this ->getOwner ()->getUID () ,
117
+ "user " => $ this ->getOwner ()->uid ,
118
118
"org " => $ org ,
119
119
"name " => "$ firstname $ lastname " ,
120
120
"email " => $ email
@@ -126,7 +126,7 @@ public function requestGroup($firstname, $lastname, $email, $org, $send_mail_to_
126
126
"pi_approve " ,
127
127
"group_request_admin " ,
128
128
array (
129
- "user " => $ this ->getOwner ()->getUID () ,
129
+ "user " => $ this ->getOwner ()->uid ,
130
130
"org " => $ org ,
131
131
"name " => "$ firstname $ lastname " ,
132
132
"email " => $ email
@@ -140,7 +140,7 @@ public function requestGroup($firstname, $lastname, $email, $org, $send_mail_to_
140
140
*/
141
141
public function approveGroup ($ operator = null , $ send_mail = true )
142
142
{
143
- $ uid = $ this ->getOwner ()->getUID () ;
143
+ $ uid = $ this ->getOwner ()->uid ;
144
144
$ request = $ this ->SQL ->getRequest ($ uid , UnitySQL::REQUEST_BECOME_PI );
145
145
146
146
// check for edge cases...
@@ -164,15 +164,15 @@ public function approveGroup($operator = null, $send_mail = true)
164
164
165
165
// remove the request from the sql table
166
166
// this will silently fail if the request doesn't exist
167
- $ this ->SQL ->removeRequest ($ this ->getOwner ()->getUID () );
167
+ $ this ->SQL ->removeRequest ($ this ->getOwner ()->uid );
168
168
169
- $ operator = is_null ($ operator ) ? $ this ->getOwner ()->getUID () : $ operator ->getUID () ;
169
+ $ operator = is_null ($ operator ) ? $ this ->getOwner ()->uid : $ operator ->uid ;
170
170
171
171
$ this ->SQL ->addLog (
172
172
$ operator ,
173
173
$ _SERVER ['REMOTE_ADDR ' ],
174
174
"approved_group " ,
175
- $ this ->getOwner ()->getUID ()
175
+ $ this ->getOwner ()->uid
176
176
);
177
177
178
178
// send email to the newly approved PI
@@ -190,19 +190,19 @@ public function approveGroup($operator = null, $send_mail = true)
190
190
public function denyGroup ($ operator = null , $ send_mail = true )
191
191
{
192
192
// remove request - this will fail silently if the request doesn't exist
193
- $ this ->SQL ->removeRequest ($ this ->getOwner ()->getUID () );
193
+ $ this ->SQL ->removeRequest ($ this ->getOwner ()->uid );
194
194
195
195
if ($ this ->exists ()) {
196
196
return ;
197
197
}
198
198
199
- $ operator = is_null ($ operator ) ? $ this ->getOwner ()->getUID () : $ operator ->getUID () ;
199
+ $ operator = is_null ($ operator ) ? $ this ->getOwner ()->uid : $ operator ->uid ;
200
200
201
201
$ this ->SQL ->addLog (
202
202
$ operator ,
203
203
$ _SERVER ['REMOTE_ADDR ' ],
204
204
"denied_group " ,
205
- $ this ->getOwner ()->getUID ()
205
+ $ this ->getOwner ()->uid
206
206
);
207
207
208
208
// send email to the requestor
@@ -216,17 +216,17 @@ public function denyGroup($operator = null, $send_mail = true)
216
216
217
217
public function cancelGroupRequest ($ send_mail = true )
218
218
{
219
- if (!$ this ->SQL ->requestExists ($ this ->getOwner ()->getUID () )) {
219
+ if (!$ this ->SQL ->requestExists ($ this ->getOwner ()->uid )) {
220
220
return ;
221
221
}
222
222
223
- $ this ->SQL ->removeRequest ($ this ->getOwner ()->getUID () );
223
+ $ this ->SQL ->removeRequest ($ this ->getOwner ()->uid );
224
224
225
225
if ($ send_mail ) {
226
226
$ this ->MAILER ->sendMail (
227
227
"admin " ,
228
228
"group_request_cancelled " ,
229
- ["uid " => $ this ->getOwner ()->getUID () ],
229
+ ["uid " => $ this ->getOwner ()->uid ],
230
230
);
231
231
}
232
232
}
@@ -237,14 +237,14 @@ public function cancelGroupJoinRequest($user, $send_mail = true)
237
237
return ;
238
238
}
239
239
240
- $ this ->SQL ->removeRequest ($ user ->getUID () , $ this ->pi_uid );
240
+ $ this ->SQL ->removeRequest ($ user ->uid , $ this ->pi_uid );
241
241
242
242
if ($ send_mail ) {
243
243
// send email to requestor
244
244
$ this ->MAILER ->sendMail (
245
245
$ this ->getOwner ()->getMail (),
246
246
"group_join_request_cancelled " ,
247
- ["uid " => $ user ->getUID () ]
247
+ ["uid " => $ user ->uid ]
248
248
);
249
249
}
250
250
}
@@ -271,7 +271,7 @@ public function cancelGroupJoinRequest($user, $send_mail = true)
271
271
// $this->entry->delete();
272
272
// $this->REDIS->removeCacheArray("sorted_groups", "", $this->getPIUID());
273
273
// foreach ($users as $user) {
274
- // $this->REDIS->removeCacheArray($user->getUID() , "groups", $this->getPIUID());
274
+ // $this->REDIS->removeCacheArray($user->uid , "groups", $this->getPIUID());
275
275
// }
276
276
// }
277
277
@@ -292,7 +292,7 @@ public function cancelGroupJoinRequest($user, $send_mail = true)
292
292
*/
293
293
public function approveUser ($ new_user , $ send_mail = true )
294
294
{
295
- $ uid = $ new_user ->getUID () ;
295
+ $ uid = $ new_user ->uid ;
296
296
$ gid = $ this ->getPIUID ();
297
297
$ request = $ this ->SQL ->getRequest ($ uid , $ gid );
298
298
// check if user exists
@@ -308,7 +308,7 @@ public function approveUser($new_user, $send_mail = true)
308
308
// add user to the LDAP object
309
309
$ this ->addUserToGroup ($ new_user );
310
310
311
- $ this ->SQL ->removeRequest ($ new_user ->getUID () , $ this ->pi_uid );
311
+ $ this ->SQL ->removeRequest ($ new_user ->uid , $ this ->pi_uid );
312
312
313
313
// send email to the requestor
314
314
if ($ send_mail ) {
@@ -324,7 +324,7 @@ public function approveUser($new_user, $send_mail = true)
324
324
"group_user_added_owner " ,
325
325
array (
326
326
"group " => $ this ->pi_uid ,
327
- "user " => $ new_user ->getUID () ,
327
+ "user " => $ new_user ->uid ,
328
328
"name " => $ request ["firstname " ] . " " . $ request ["lastname " ],
329
329
"email " => $ request ["email " ],
330
330
"org " => $ request ["org " ],
@@ -335,12 +335,12 @@ public function approveUser($new_user, $send_mail = true)
335
335
336
336
public function denyUser ($ new_user , $ send_mail = true )
337
337
{
338
- $ uid = $ new_user ->getUID () ;
338
+ $ uid = $ new_user ->uid ;
339
339
$ gid = $ this ->getPIUID ();
340
340
$ request = $ this ->SQL ->getRequest ($ uid , $ gid );
341
341
342
342
// remove request, this will fail silently if the request doesn't exist
343
- $ this ->SQL ->removeRequest ($ new_user ->getUID () , $ this ->pi_uid );
343
+ $ this ->SQL ->removeRequest ($ new_user ->uid , $ this ->pi_uid );
344
344
345
345
if ($ send_mail ) {
346
346
// send email to the user
@@ -356,7 +356,7 @@ public function denyUser($new_user, $send_mail = true)
356
356
"group_user_denied_owner " ,
357
357
array (
358
358
"group " => $ this ->pi_uid ,
359
- "user " => $ new_user ->getUID () ,
359
+ "user " => $ new_user ->uid ,
360
360
"name " => $ new_user ->getFullName (),
361
361
"email " => $ new_user ->getMail (),
362
362
"org " => $ new_user ->getOrg ()
@@ -371,7 +371,7 @@ public function removeUser($new_user, $send_mail = true)
371
371
return ;
372
372
}
373
373
374
- if ($ new_user ->getUID () == $ this ->getOwner ()->getUID () ) {
374
+ if ($ new_user ->uid == $ this ->getOwner ()->uid ) {
375
375
throw new Exception ("Cannot delete group owner from group. Disband group instead " );
376
376
}
377
377
@@ -392,7 +392,7 @@ public function removeUser($new_user, $send_mail = true)
392
392
"group_user_removed_owner " ,
393
393
array (
394
394
"group " => $ this ->pi_uid ,
395
- "user " => $ new_user ->getUID () ,
395
+ "user " => $ new_user ->uid ,
396
396
"name " => $ new_user ->getFullName (),
397
397
"email " => $ new_user ->getMail (),
398
398
"org " => $ new_user ->getOrg ()
@@ -413,12 +413,12 @@ public function newUserRequest($new_user, $firstname, $lastname, $email, $org, $
413
413
return ;
414
414
}
415
415
416
- if ($ this ->SQL ->accDeletionRequestExists ($ new_user ->getUID () )) {
416
+ if ($ this ->SQL ->accDeletionRequestExists ($ new_user ->uid )) {
417
417
throw new Exception ("user ' $ new_user' requested account deletion " );
418
418
return ;
419
419
}
420
420
421
- $ this ->addRequest ($ new_user ->getUID () , $ firstname , $ lastname , $ email , $ org );
421
+ $ this ->addRequest ($ new_user ->uid , $ firstname , $ lastname , $ email , $ org );
422
422
423
423
if ($ send_mail ) {
424
424
// send email to user
@@ -434,7 +434,7 @@ public function newUserRequest($new_user, $firstname, $lastname, $email, $org, $
434
434
"group_user_request_owner " ,
435
435
array (
436
436
"group " => $ this ->pi_uid ,
437
- "user " => $ new_user ->getUID () ,
437
+ "user " => $ new_user ->uid ,
438
438
"name " => "$ firstname $ lastname " ,
439
439
"email " => $ email ,
440
440
"org " => $ org ,
@@ -477,7 +477,7 @@ public function getGroupMembers($ignorecache = false)
477
477
{
478
478
$ members = $ this ->getGroupMemberUIDs ($ ignorecache );
479
479
$ out = array ();
480
- $ owner_uid = $ this ->getOwner ()->getUID () ;
480
+ $ owner_uid = $ this ->getOwner ()->uid ;
481
481
foreach ($ members as $ member ) {
482
482
$ user_obj = new UnityUser (
483
483
$ member ,
@@ -517,7 +517,7 @@ public function requestExists($user)
517
517
$ requesters = $ this ->getRequests ();
518
518
if (count ($ requesters ) > 0 ) {
519
519
foreach ($ requesters as $ requester ) {
520
- if ($ requester [0 ]->getUID () == $ user ->getUID () ) {
520
+ if ($ requester [0 ]->uid == $ user ->uid ) {
521
521
return true ;
522
522
}
523
523
}
@@ -540,7 +540,7 @@ private function init()
540
540
541
541
$ this ->entry ->setAttribute ("objectclass " , UnityLDAP::POSIX_GROUP_CLASS );
542
542
$ this ->entry ->setAttribute ("gidnumber " , strval ($ nextGID ));
543
- $ this ->entry ->setAttribute ("memberuid " , array ($ owner ->getUID () ));
543
+ $ this ->entry ->setAttribute ("memberuid " , array ($ owner ->uid ));
544
544
$ this ->entry ->write ();
545
545
}
546
546
@@ -552,24 +552,24 @@ private function init()
552
552
private function addUserToGroup ($ new_user )
553
553
{
554
554
// Add to LDAP Group
555
- $ this ->entry ->appendAttribute ("memberuid " , $ new_user ->getUID () );
555
+ $ this ->entry ->appendAttribute ("memberuid " , $ new_user ->uid );
556
556
$ this ->entry ->write ();
557
- $ this ->REDIS ->appendCacheArray ($ this ->getPIUID (), "members " , $ new_user ->getUID () );
558
- $ this ->REDIS ->appendCacheArray ($ new_user ->getUID () , "groups " , $ this ->getPIUID ());
557
+ $ this ->REDIS ->appendCacheArray ($ this ->getPIUID (), "members " , $ new_user ->uid );
558
+ $ this ->REDIS ->appendCacheArray ($ new_user ->uid , "groups " , $ this ->getPIUID ());
559
559
}
560
560
561
561
private function removeUserFromGroup ($ old_user )
562
562
{
563
563
// Remove from LDAP Group
564
- $ this ->entry ->removeAttributeEntryByValue ("memberuid " , $ old_user ->getUID () );
564
+ $ this ->entry ->removeAttributeEntryByValue ("memberuid " , $ old_user ->uid );
565
565
$ this ->entry ->write ();
566
- $ this ->REDIS ->removeCacheArray ($ this ->getPIUID (), "members " , $ old_user ->getUID () );
567
- $ this ->REDIS ->removeCacheArray ($ old_user ->getUID () , "groups " , $ this ->getPIUID ());
566
+ $ this ->REDIS ->removeCacheArray ($ this ->getPIUID (), "members " , $ old_user ->uid );
567
+ $ this ->REDIS ->removeCacheArray ($ old_user ->uid , "groups " , $ this ->getPIUID ());
568
568
}
569
569
570
570
public function userExists ($ user )
571
571
{
572
- return in_array ($ user ->getUID () , $ this ->getGroupMemberUIDs ());
572
+ return in_array ($ user ->uid , $ this ->getGroupMemberUIDs ());
573
573
}
574
574
575
575
private function addRequest ($ uid , $ firstname , $ lastname , $ email , $ org )
0 commit comments