Browse Source

Merge branch 'edge' into meteor-1.8

Lauri Ojansivu 6 years ago
parent
commit
e38988126a
5 changed files with 32 additions and 4 deletions
  1. 10 0
      CHANGELOG.md
  2. 1 1
      Stackerfile.yml
  3. 1 1
      package.json
  4. 18 0
      packages/wekan-ldap/server/loginHandler.js
  5. 2 2
      sandstorm-pkgdef.capnp

+ 10 - 0
CHANGELOG.md

@@ -1,3 +1,13 @@
+# v2.74 2019-05-14 Wekan release
+
+This release fixes the following bugs:
+
+- Add missing [wekan-ldap#40](https://github.com/wekan/wekan-ldap/pull/40) code about
+  [LDAP_SYNC_ADMIN_STATUS](https://github.com/wekan/wekan/commit/0fe40ad9ec82ef2045578f4cc1e2ebb6cc80d47a).
+  Thanks to JulianJacobi, n-st, chirrut2 and xet7.
+
+Thanks to above GitHub users for their contributions and translators for their translations.
+
 # v2.73 2019-05-14 Wekan release
 
 This release fixes the following bugs with Apache I-CLA:

+ 1 - 1
Stackerfile.yml

@@ -1,5 +1,5 @@
 appId: wekan-public/apps/77b94f60-dec9-0136-304e-16ff53095928
-appVersion: "v2.73.0"
+appVersion: "v2.74.0"
 files:
   userUploads:
     - README.md

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "wekan",
-  "version": "v2.73.0",
+  "version": "v2.74.0",
   "description": "Open-Source kanban",
   "private": true,
   "scripts": {

+ 18 - 0
packages/wekan-ldap/server/loginHandler.js

@@ -179,6 +179,15 @@ Accounts.registerLoginHandler('ldap', function(loginRequest) {
       },
     };
 
+    if (LDAP.settings_get('LDAP_SYNC_ADMIN_STATUS') === true) {
+      log_debug('Updating admin status');
+      const targetGroups = LDAP.settings_get('LDAP_SYNC_ADMIN_GROUPS').split(',');
+      const groups = ldap.getUserGroups(username, ldapUser).filter((value) => targetGroups.includes(value));
+
+      user.isAdmin = groups.length > 0;
+      Meteor.users.update({_id: user._id}, {$set: {isAdmin: user.isAdmin}});
+    }
+
     if( LDAP.settings_get('LDAP_SYNC_GROUP_ROLES') === true ) {
       log_debug('Updating Groups/Roles');
       const groups = ldap.getUserGroups(username, ldapUser);
@@ -217,6 +226,15 @@ Accounts.registerLoginHandler('ldap', function(loginRequest) {
 
   const result = addLdapUser(ldapUser, username, loginRequest.ldapPass);
 
+  if (LDAP.settings_get('LDAP_SYNC_ADMIN_STATUS') === true) {
+    log_debug('Updating admin status');
+    const targetGroups = LDAP.settings_get('LDAP_SYNC_ADMIN_GROUPS').split(',');
+    const groups = ldap.getUserGroups(username, ldapUser).filter((value) => targetGroups.includes(value));
+
+    result.isAdmin = groups.length > 0;
+    Meteor.users.update({_id: result.userId}, {$set: {isAdmin: result.isAdmin}});
+  }
+
   if( LDAP.settings_get('LDAP_SYNC_GROUP_ROLES') === true ) {
     const groups = ldap.getUserGroups(username, ldapUser);
     if( groups.length > 0 ) {

+ 2 - 2
sandstorm-pkgdef.capnp

@@ -22,10 +22,10 @@ const pkgdef :Spk.PackageDefinition = (
     appTitle = (defaultText = "Wekan"),
     # The name of the app as it is displayed to the user.
 
-    appVersion = 275,
+    appVersion = 276,
     # Increment this for every release.
 
-    appMarketingVersion = (defaultText = "2.73.0~2019-05-14"),
+    appMarketingVersion = (defaultText = "2.74.0~2019-05-14"),
     # Human-readable presentation of the app version.
 
     minUpgradableAppVersion = 0,