Skip to content

Commit

Permalink
feat: standard groups
Browse files Browse the repository at this point in the history
  • Loading branch information
GoliathLabs committed Oct 19, 2024
1 parent dcddc48 commit 2383302
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion backend/src/routes/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,22 @@ app.post('/status', zValidator('json', UpdateApplicationStatus), async (c) => {
}
: userEntry
)

// Nutzer zu Standardgruppen hinzufügen
const groups = ['cn=team,ou=services', 'cn=Mitglied,ou=group'];

for (const groupDn of groups) {
try {
await ldap.modify(groupDn + `,${ldapConfig.baseDn}`, {
operation: 'add',
modification: {
memberUid: uid,
},
});
console.log(`User ${uid} added to group ${groupDn}`);
} catch (error) {
console.error(`Failed to add user ${uid} to group ${groupDn}:`, error);
}
}
console.info(`User ${cn} with password ${pass} added`)
await sendEmail(rawApplication.email, uid, pass);

Expand Down

0 comments on commit 2383302

Please sign in to comment.