mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
Added back WeKan lockout, ldap, oidc, cas.
Thanks to xet7 !
This commit is contained in:
parent
a73a4c1e5b
commit
00768b4392
45 changed files with 3966 additions and 0 deletions
29
packages/wekan-ldap/server/syncUser.js
Normal file
29
packages/wekan-ldap/server/syncUser.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import {importNewUsers} from './sync';
|
||||
import LDAP from './ldap';
|
||||
|
||||
Meteor.methods({
|
||||
ldap_sync_now() {
|
||||
const user = Meteor.user();
|
||||
if (!user) {
|
||||
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'ldap_sync_users' });
|
||||
}
|
||||
|
||||
//TODO: This needs to be fixed - security issue -> alanning:meteor-roles
|
||||
//if (!RocketChat.authz.hasRole(user._id, 'admin')) {
|
||||
// throw new Meteor.Error('error-not-authorized', 'Not authorized', { method: 'ldap_sync_users' });
|
||||
//}
|
||||
|
||||
if (LDAP.settings_get('LDAP_ENABLE') !== true) {
|
||||
throw new Meteor.Error('LDAP_disabled');
|
||||
}
|
||||
|
||||
this.unblock();
|
||||
|
||||
importNewUsers();
|
||||
|
||||
return {
|
||||
message: 'Sync_in_progress',
|
||||
params: [],
|
||||
};
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue