@@ -74,11 +74,11 @@ public function requestGroup($firstname, $lastname, $email, $org, $send_mail_to_
74
74
}
75
75
76
76
// check if account deletion request already exists
77
- if ($ this ->SQL ->accDeletionRequestExists ($ this ->getOwner ()->getUID () )) {
77
+ if ($ this ->SQL ->accDeletionRequestExists ($ this ->getOwner ()->uid )) {
78
78
return ;
79
79
}
80
80
81
- $ this ->SQL ->addRequest ($ this ->getOwner ()->getUID () , $ firstname , $ lastname , $ email , $ org );
81
+ $ this ->SQL ->addRequest ($ this ->getOwner ()->uid , $ firstname , $ lastname , $ email , $ org );
82
82
83
83
if ($ send_mail ) {
84
84
// send email to requestor
@@ -90,7 +90,7 @@ public function requestGroup($firstname, $lastname, $email, $org, $send_mail_to_
90
90
$ this ->WEBHOOK ->sendWebhook (
91
91
"group_request_admin " ,
92
92
array (
93
- "user " => $ this ->getOwner ()->getUID () ,
93
+ "user " => $ this ->getOwner ()->uid ,
94
94
"org " => $ org ,
95
95
"name " => "$ firstname $ lastname " ,
96
96
"email " => $ email
@@ -102,7 +102,7 @@ public function requestGroup($firstname, $lastname, $email, $org, $send_mail_to_
102
102
"admin " ,
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
"pi_approve " ,
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
@@ -128,7 +128,7 @@ public function requestGroup($firstname, $lastname, $email, $org, $send_mail_to_
128
128
*/
129
129
public function approveGroup ($ operator = null , $ send_mail = true )
130
130
{
131
- $ uid = $ this ->getOwner ()->getUID () ;
131
+ $ uid = $ this ->getOwner ()->uid ;
132
132
$ request = $ this ->SQL ->getRequest ($ uid , UnitySQL::REQUEST_BECOME_PI );
133
133
134
134
// check for edge cases...
@@ -152,15 +152,15 @@ public function approveGroup($operator = null, $send_mail = true)
152
152
153
153
// remove the request from the sql table
154
154
// this will silently fail if the request doesn't exist
155
- $ this ->SQL ->removeRequest ($ this ->getOwner ()->getUID () );
155
+ $ this ->SQL ->removeRequest ($ this ->getOwner ()->uid );
156
156
157
- $ operator = is_null ($ operator ) ? $ this ->getOwner ()->getUID () : $ operator ->getUID () ;
157
+ $ operator = is_null ($ operator ) ? $ this ->getOwner ()->uid : $ operator ->uid ;
158
158
159
159
$ this ->SQL ->addLog (
160
160
$ operator ,
161
161
$ _SERVER ['REMOTE_ADDR ' ],
162
162
"approved_group " ,
163
- $ this ->getOwner ()->getUID ()
163
+ $ this ->getOwner ()->uid
164
164
);
165
165
166
166
// send email to the newly approved PI
@@ -178,19 +178,19 @@ public function approveGroup($operator = null, $send_mail = true)
178
178
public function denyGroup ($ operator = null , $ send_mail = true )
179
179
{
180
180
// remove request - this will fail silently if the request doesn't exist
181
- $ this ->SQL ->removeRequest ($ this ->getOwner ()->getUID () );
181
+ $ this ->SQL ->removeRequest ($ this ->getOwner ()->uid );
182
182
183
183
if ($ this ->exists ()) {
184
184
return ;
185
185
}
186
186
187
- $ operator = is_null ($ operator ) ? $ this ->getOwner ()->getUID () : $ operator ->getUID () ;
187
+ $ operator = is_null ($ operator ) ? $ this ->getOwner ()->uid : $ operator ->uid ;
188
188
189
189
$ this ->SQL ->addLog (
190
190
$ operator ,
191
191
$ _SERVER ['REMOTE_ADDR ' ],
192
192
"denied_group " ,
193
- $ this ->getOwner ()->getUID ()
193
+ $ this ->getOwner ()->uid
194
194
);
195
195
196
196
// send email to the requestor
@@ -204,17 +204,17 @@ public function denyGroup($operator = null, $send_mail = true)
204
204
205
205
public function cancelGroupRequest ($ send_mail = true )
206
206
{
207
- if (!$ this ->SQL ->requestExists ($ this ->getOwner ()->getUID () )) {
207
+ if (!$ this ->SQL ->requestExists ($ this ->getOwner ()->uid )) {
208
208
return ;
209
209
}
210
210
211
- $ this ->SQL ->removeRequest ($ this ->getOwner ()->getUID () );
211
+ $ this ->SQL ->removeRequest ($ this ->getOwner ()->uid );
212
212
213
213
if ($ send_mail ) {
214
214
$ this ->MAILER ->sendMail (
215
215
"admin " ,
216
216
"group_request_cancelled " ,
217
- ["uid " => $ this ->getOwner ()->getUID () ],
217
+ ["uid " => $ this ->getOwner ()->uid ],
218
218
);
219
219
}
220
220
}
@@ -225,14 +225,14 @@ public function cancelGroupJoinRequest($user, $send_mail = true)
225
225
return ;
226
226
}
227
227
228
- $ this ->SQL ->removeRequest ($ user ->getUID () , $ this ->gid );
228
+ $ this ->SQL ->removeRequest ($ user ->uid , $ this ->gid );
229
229
230
230
if ($ send_mail ) {
231
231
// send email to requestor
232
232
$ this ->MAILER ->sendMail (
233
233
$ this ->getOwner ()->getMail (),
234
234
"group_join_request_cancelled " ,
235
- ["uid " => $ user ->getUID () ]
235
+ ["uid " => $ user ->uid ]
236
236
);
237
237
}
238
238
}
@@ -260,7 +260,7 @@ public function cancelGroupJoinRequest($user, $send_mail = true)
260
260
// $ldapPiGroupEntry->delete();
261
261
// $this->REDIS->removeCacheArray("sorted_groups", "", $this->gid);
262
262
// foreach ($users as $user) {
263
- // $this->REDIS->removeCacheArray($user->getUID() , "groups", $this->gid);
263
+ // $this->REDIS->removeCacheArray($user->uid , "groups", $this->gid);
264
264
// }
265
265
// }
266
266
@@ -281,7 +281,7 @@ public function cancelGroupJoinRequest($user, $send_mail = true)
281
281
*/
282
282
public function approveUser ($ new_user , $ send_mail = true )
283
283
{
284
- $ uid = $ new_user ->getUID () ;
284
+ $ uid = $ new_user ->uid ;
285
285
$ request = $ this ->SQL ->getRequest ($ uid , $ this ->gid );
286
286
// check if user exists
287
287
if (!$ new_user ->exists ()) {
@@ -296,7 +296,7 @@ public function approveUser($new_user, $send_mail = true)
296
296
// add user to the LDAP object
297
297
$ this ->addUserToGroup ($ new_user );
298
298
299
- $ this ->SQL ->removeRequest ($ new_user ->getUID () , $ this ->gid );
299
+ $ this ->SQL ->removeRequest ($ new_user ->uid , $ this ->gid );
300
300
301
301
// send email to the requestor
302
302
if ($ send_mail ) {
@@ -312,22 +312,22 @@ public function approveUser($new_user, $send_mail = true)
312
312
"group_user_added_owner " ,
313
313
array (
314
314
"group " => $ this ->gid ,
315
- "user " => $ new_user ->getUID () ,
315
+ "user " => $ new_user ->uid ,
316
316
"name " => $ request ["firstname " ] . " " . $ request ["lastname " ],
317
317
"email " => $ request ["email " ],
318
318
"org " => $ request ["org " ],
319
- )
319
+ )
320
320
);
321
321
}
322
322
}
323
323
324
324
public function denyUser ($ new_user , $ send_mail = true )
325
325
{
326
- $ uid = $ new_user ->getUID () ;
326
+ $ uid = $ new_user ->uid ;
327
327
$ request = $ this ->SQL ->getRequest ($ uid , $ this ->gid );
328
328
329
329
// remove request, this will fail silently if the request doesn't exist
330
- $ this ->SQL ->removeRequest ($ new_user ->getUID () , $ this ->gid );
330
+ $ this ->SQL ->removeRequest ($ new_user ->uid , $ this ->gid );
331
331
332
332
if ($ send_mail ) {
333
333
// send email to the user
@@ -343,11 +343,11 @@ public function denyUser($new_user, $send_mail = true)
343
343
"group_user_denied_owner " ,
344
344
array (
345
345
"group " => $ this ->gid ,
346
- "user " => $ new_user ->getUID () ,
346
+ "user " => $ new_user ->uid ,
347
347
"name " => $ new_user ->getFullName (),
348
348
"email " => $ new_user ->getMail (),
349
349
"org " => $ new_user ->getOrg ()
350
- )
350
+ )
351
351
);
352
352
}
353
353
}
@@ -358,7 +358,7 @@ public function removeUser($new_user, $send_mail = true)
358
358
return ;
359
359
}
360
360
361
- if ($ new_user ->getUID () == $ this ->getOwner ()->getUID () ) {
361
+ if ($ new_user ->uid == $ this ->getOwner ()->uid ) {
362
362
throw new Exception ("Cannot delete group owner from group. Disband group instead " );
363
363
}
364
364
@@ -379,11 +379,11 @@ public function removeUser($new_user, $send_mail = true)
379
379
"group_user_removed_owner " ,
380
380
array (
381
381
"group " => $ this ->gid ,
382
- "user " => $ new_user ->getUID () ,
382
+ "user " => $ new_user ->uid ,
383
383
"name " => $ new_user ->getFullName (),
384
384
"email " => $ new_user ->getMail (),
385
385
"org " => $ new_user ->getOrg ()
386
- )
386
+ )
387
387
);
388
388
}
389
389
}
@@ -400,12 +400,12 @@ public function newUserRequest($new_user, $firstname, $lastname, $email, $org, $
400
400
return ;
401
401
}
402
402
403
- if ($ this ->SQL ->accDeletionRequestExists ($ new_user ->getUID () )) {
403
+ if ($ this ->SQL ->accDeletionRequestExists ($ new_user ->uid )) {
404
404
throw new Exception ("user ' $ new_user' requested account deletion " );
405
405
return ;
406
406
}
407
407
408
- $ this ->addRequest ($ new_user ->getUID () , $ firstname , $ lastname , $ email , $ org );
408
+ $ this ->addRequest ($ new_user ->uid , $ firstname , $ lastname , $ email , $ org );
409
409
410
410
if ($ send_mail ) {
411
411
// send email to user
@@ -421,11 +421,11 @@ public function newUserRequest($new_user, $firstname, $lastname, $email, $org, $
421
421
"group_user_request_owner " ,
422
422
array (
423
423
"group " => $ this ->gid ,
424
- "user " => $ new_user ->getUID () ,
424
+ "user " => $ new_user ->uid ,
425
425
"name " => "$ firstname $ lastname " ,
426
426
"email " => $ email ,
427
427
"org " => $ org ,
428
- )
428
+ )
429
429
);
430
430
}
431
431
}
@@ -464,17 +464,17 @@ public function getGroupMembers($ignorecache = false)
464
464
{
465
465
$ members = $ this ->getGroupMemberUIDs ($ ignorecache );
466
466
$ out = array ();
467
- $ owner_uid = $ this ->getOwner ()->getUID () ;
467
+ $ owner_uid = $ this ->getOwner ()->uid ;
468
468
foreach ($ members as $ member ) {
469
- $ user_obj = new UnityUser (
470
- $ member ,
471
- $ this ->LDAP ,
472
- $ this ->SQL ,
473
- $ this ->MAILER ,
474
- $ this ->REDIS ,
475
- $ this ->WEBHOOK
476
- );
477
- array_push ($ out , $ user_obj );
469
+ $ user_obj = new UnityUser (
470
+ $ member ,
471
+ $ this ->LDAP ,
472
+ $ this ->SQL ,
473
+ $ this ->MAILER ,
474
+ $ this ->REDIS ,
475
+ $ this ->WEBHOOK
476
+ );
477
+ array_push ($ out , $ user_obj );
478
478
}
479
479
return $ out ;
480
480
}
@@ -505,7 +505,7 @@ public function requestExists($user)
505
505
$ requesters = $ this ->getRequests ();
506
506
if (count ($ requesters ) > 0 ) {
507
507
foreach ($ requesters as $ requester ) {
508
- if ($ requester [0 ]->getUID () == $ user ->getUID () ) {
508
+ if ($ requester [0 ]->uid == $ user ->uid ) {
509
509
return true ;
510
510
}
511
511
}
@@ -531,7 +531,7 @@ private function init()
531
531
532
532
$ ldapPiGroupEntry ->setAttribute ("objectclass " , UnityLDAP::POSIX_GROUP_CLASS );
533
533
$ ldapPiGroupEntry ->setAttribute ("gidnumber " , strval ($ nextGID ));
534
- $ ldapPiGroupEntry ->setAttribute ("memberuid " , array ($ owner ->getUID () ));
534
+ $ ldapPiGroupEntry ->setAttribute ("memberuid " , array ($ owner ->uid ));
535
535
$ ldapPiGroupEntry ->write ();
536
536
}
537
537
@@ -544,25 +544,25 @@ private function addUserToGroup($new_user)
544
544
{
545
545
// Add to LDAP Group
546
546
$ pi_group = $ this ->getLDAPPiGroup ();
547
- $ pi_group ->appendAttribute ("memberuid " , $ new_user ->getUID () );
547
+ $ pi_group ->appendAttribute ("memberuid " , $ new_user ->uid );
548
548
$ pi_group ->write ();
549
- $ this ->REDIS ->appendCacheArray ($ this ->gid , "members " , $ new_user ->getUID () );
550
- $ this ->REDIS ->appendCacheArray ($ new_user ->getUID () , "groups " , $ this ->gid );
549
+ $ this ->REDIS ->appendCacheArray ($ this ->gid , "members " , $ new_user ->uid );
550
+ $ this ->REDIS ->appendCacheArray ($ new_user ->uid , "groups " , $ this ->gid );
551
551
}
552
552
553
553
private function removeUserFromGroup ($ old_user )
554
554
{
555
555
// Remove from LDAP Group
556
556
$ pi_group = $ this ->getLDAPPiGroup ();
557
- $ pi_group ->removeAttributeEntryByValue ("memberuid " , $ old_user ->getUID () );
557
+ $ pi_group ->removeAttributeEntryByValue ("memberuid " , $ old_user ->uid );
558
558
$ pi_group ->write ();
559
- $ this ->REDIS ->removeCacheArray ($ this ->gid , "members " , $ old_user ->getUID () );
560
- $ this ->REDIS ->removeCacheArray ($ old_user ->getUID () , "groups " , $ this ->gid );
559
+ $ this ->REDIS ->removeCacheArray ($ this ->gid , "members " , $ old_user ->uid );
560
+ $ this ->REDIS ->removeCacheArray ($ old_user ->uid , "groups " , $ this ->gid );
561
561
}
562
562
563
563
public function userExists ($ user )
564
564
{
565
- return in_array ($ user ->getUID () , $ this ->getGroupMemberUIDs ());
565
+ return in_array ($ user ->uid , $ this ->getGroupMemberUIDs ());
566
566
}
567
567
568
568
private function addRequest ($ uid , $ firstname , $ lastname , $ email , $ org )
0 commit comments