diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-09-25 00:56:04 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-09-25 00:56:04 +0300 |
commit | 1dd66fdac26e66d329e329c80d6f64d771e6a550 (patch) | |
tree | 926ac94a893570e5aa4c7fc1a97adad0632692d7 | |
parent | 6addc3c217290419f56da2c8ffac0fe31a715370 (diff) | |
parent | d4d20d2a43a8062f419a33f4ba85977d8c1dd3a0 (diff) | |
download | wekan-1dd66fdac26e66d329e329c80d6f64d771e6a550.tar.gz wekan-1dd66fdac26e66d329e329c80d6f64d771e6a550.tar.bz2 wekan-1dd66fdac26e66d329e329c80d6f64d771e6a550.zip |
Merge branch 'soohwa-admin-create-user' into devel
REST API: Create user despite disabling registration.
Thanks to soohwa ! Closes #1232
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | models/users.js | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 27470c6e..8e02ecbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,15 @@ This release adds the following new features: * [Add translations (en/de/fi) for email notifications regarding checklists and checklist items](https://github.com/wekan/wekan/pull/1238); -* [Added plus button to add card on top of the list](https://github.com/wekan/wekan/pull/1244). +* [Added plus button to add card on top of the list](https://github.com/wekan/wekan/pull/1244); +* [REST API: Create user despite disabling registration](https://github.com/wekan/wekan/issues/1232). and fixes the following bugs: * [Checklist items are lost when moving items to another checklist](https://github.com/wekan/wekan/pull/1240); * [Keep state of checklist items when moved to another checklist](https://github.com/wekan/wekan/pull/1242). -Thanks to GitHub users GhassenRjab, mario-orlicky, umbertooo and xet7 for their contributions. +Thanks to GitHub users GhassenRjab, mario-orlicky, soohwa, umbertooo and xet7 for their contributions. # v0.39 2017-09-18 Wekan release diff --git a/models/users.js b/models/users.js index c2238cde..505ed93e 100644 --- a/models/users.js +++ b/models/users.js @@ -108,6 +108,10 @@ Users.attachSchema(new SimpleSchema({ type: Boolean, optional: true, }, + fromAdmin: { + type: Boolean, + optional: false, + }, })); // Search a user in the complete server database by its name or username. This @@ -435,6 +439,12 @@ if (Meteor.isServer) { user.isAdmin = true; return user; } + + if (options.from === 'admin') { + user.fromAdmin = true; + return user; + } + const disableRegistration = Settings.findOne().disableRegistration; if (!disableRegistration) { return user; @@ -524,6 +534,9 @@ if (Meteor.isServer) { Users.after.insert((userId, doc) => { + if (doc.fromAdmin) + return; + //invite user to corresponding boards const disableRegistration = Settings.findOne().disableRegistration; if (disableRegistration) { @@ -582,6 +595,7 @@ if (Meteor.isServer) { username: req.body.username, email: req.body.email, password: 'default', + from: 'admin', }); JsonRoutes.sendResult(res, { |