File tree Expand file tree Collapse file tree 3 files changed +15
-12
lines changed
Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 1212class PosixGroup
1313{
1414 protected LDAPEntry $ entry ;
15- public string $ gid ;
1615
17- public function __construct (LDAPEntry $ entry, string $ gid )
16+ public function __construct (LDAPEntry $ entry )
1817 {
19- $ this ->gid = $ gid ;
2018 $ this ->entry = $ entry ;
2119 }
2220
@@ -37,11 +35,6 @@ public function equals(PosixGroup $other_group): bool
3735 return $ this ->getDN () == $ other_group ->getDN ();
3836 }
3937
40- public function __toString (): string
41- {
42- return $ this ->gid ;
43- }
44-
4538 public function exists (): bool
4639 {
4740 return $ this ->entry ->exists ();
Original file line number Diff line number Diff line change 1111class UnityGroup extends PosixGroup
1212{
1313 public const string PI_PREFIX = "pi_ " ;
14+ public string $ gid ;
1415 private UnityLDAP $ LDAP ;
1516 private UnitySQL $ SQL ;
1617 private UnityMailer $ MAILER ;
@@ -23,14 +24,18 @@ public function __construct(
2324 UnityMailer $ MAILER ,
2425 UnityWebhook $ WEBHOOK ,
2526 ) {
26- $ gid = trim ($ gid );
27- parent ::__construct ($ LDAP ->getPIGroupEntry ($ gid ), $ gid );
27+ parent ::__construct ($ LDAP ->getPIGroupEntry (trim ($ gid )));
2828 $ this ->LDAP = $ LDAP ;
2929 $ this ->SQL = $ SQL ;
3030 $ this ->MAILER = $ MAILER ;
3131 $ this ->WEBHOOK = $ WEBHOOK ;
3232 }
3333
34+ public function __toString (): string
35+ {
36+ return $ this ->gid ;
37+ }
38+
3439 public function requestGroup (bool $ send_mail_to_admins , bool $ send_mail = true ): void
3540 {
3641 if ($ this ->exists ()) {
Original file line number Diff line number Diff line change 55
66class UnityOrg extends PosixGroup
77{
8+ public string $ gid ;
89 private UnityLDAP $ LDAP ;
910 private UnitySQL $ SQL ;
1011 private UnityMailer $ MAILER ;
@@ -17,14 +18,18 @@ public function __construct(
1718 UnityMailer $ MAILER ,
1819 UnityWebhook $ WEBHOOK ,
1920 ) {
20- $ gid = trim ($ gid );
21- parent ::__construct ($ LDAP ->getOrgGroupEntry ($ gid ), $ gid );
21+ parent ::__construct ($ LDAP ->getOrgGroupEntry (trim ($ gid )));
2222 $ this ->LDAP = $ LDAP ;
2323 $ this ->SQL = $ SQL ;
2424 $ this ->MAILER = $ MAILER ;
2525 $ this ->WEBHOOK = $ WEBHOOK ;
2626 }
2727
28+ public function __toString (): string
29+ {
30+ return $ this ->gid ;
31+ }
32+
2833 public function init (): void
2934 {
3035 \ensure (!$ this ->entry ->exists ());
You can’t perform that action at this time.
0 commit comments