@@ -97,31 +97,33 @@ public function init(
9797 $ this ->SQL ->addLog ($ this ->uid , $ _SERVER ["REMOTE_ADDR " ], "user_added " , $ this ->uid );
9898 }
9999
100- public function isQualified ( ): bool
100+ public function getModifier ( $ modifier ): bool
101101 {
102- return $ this ->LDAP ->qualifiedUserGroup ->memberUIDExists ($ this ->uid );
102+ return $ this ->LDAP ->userModifierGroups [ $ modifier ] ->memberUIDExists ($ this ->uid );
103103 }
104104
105- public function setIsQualified ( bool $ newIsQualified , bool $ doSendMail = true ): void
105+ public function setModifier ( $ modifier , bool $ newValue , bool $ doSendMail = true ): void
106106 {
107- $ oldIsQualified = $ this ->isQualified ( );
108- if ($ oldIsQualified == $ newIsQualified ) {
107+ $ oldValue = $ this ->getModifier ( $ modifier );
108+ if ($ oldValue == $ newValue ) {
109109 return ;
110110 }
111- if ($ newIsQualified ) {
112- $ this ->LDAP ->qualifiedUserGroup ->addMemberUID ($ this ->uid );
111+ if ($ newValue ) {
112+ $ this ->LDAP ->userModifierGroups [ $ modifier ] ->addMemberUID ($ this ->uid );
113113 if ($ doSendMail ) {
114- $ this ->MAILER ->sendMail ($ this ->getMail (), "user_qualified " , [
114+ $ this ->MAILER ->sendMail ($ this ->getMail (), "user_modifier_added " , [
115115 "user " => $ this ->uid ,
116116 "org " => $ this ->getOrg (),
117+ "modifier " => $ modifier ,
117118 ]);
118119 }
119120 } else {
120- $ this ->LDAP ->qualifiedUserGroup ->removeMemberUID ($ this ->uid );
121+ $ this ->LDAP ->userModifierGroups [ $ modifier ] ->removeMemberUID ($ this ->uid );
121122 if ($ doSendMail ) {
122- $ this ->MAILER ->sendMail ($ this ->getMail (), "user_dequalified " , [
123+ $ this ->MAILER ->sendMail ($ this ->getMail (), "user_modifier_removed " , [
123124 "user " => $ this ->uid ,
124125 "org " => $ this ->getOrg (),
126+ "modifier " => $ modifier ,
125127 ]);
126128 }
127129 }
@@ -315,14 +317,6 @@ public function getHomeDir(): string
315317 return $ this ->entry ->getAttribute ("homedirectory " );
316318 }
317319
318- /**
319- * Checks if the current account is an admin
320- */
321- public function isAdmin (): bool
322- {
323- return $ this ->LDAP ->adminGroup ->memberUIDExists ($ this ->uid );
324- }
325-
326320 /**
327321 * Checks if current user is a PI
328322 */
0 commit comments