|
@@ -677,73 +677,6 @@ module.exports = function(crowi) {
|
|
|
|
|
|
|
|
await Promise.all(emailList.map((email) => { return createUser(email) }));
|
|
await Promise.all(emailList.map((email) => { return createUser(email) }));
|
|
|
|
|
|
|
|
- // async.each(
|
|
|
|
|
- // emailList,
|
|
|
|
|
- // (email, next) => {
|
|
|
|
|
- // const newUser = new User();
|
|
|
|
|
- // let tmpUsername;
|
|
|
|
|
- // let password;
|
|
|
|
|
-
|
|
|
|
|
- // // eslint-disable-next-line no-param-reassign
|
|
|
|
|
- // email = email.trim();
|
|
|
|
|
-
|
|
|
|
|
- // // email check
|
|
|
|
|
- // // TODO: 削除済みはチェック対象から外そう〜
|
|
|
|
|
- // User.findOne({ email }, (err, userData) => {
|
|
|
|
|
- // // The user is exists
|
|
|
|
|
- // if (userData) {
|
|
|
|
|
- // createdUserList.push({
|
|
|
|
|
- // email,
|
|
|
|
|
- // password: null,
|
|
|
|
|
- // user: null,
|
|
|
|
|
- // });
|
|
|
|
|
-
|
|
|
|
|
- // return next();
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // /* eslint-disable newline-per-chained-call */
|
|
|
|
|
- // tmpUsername = `temp_${Math.random().toString(36).slice(-16)}`;
|
|
|
|
|
- // password = Math.random().toString(36).slice(-16);
|
|
|
|
|
- // /* eslint-enable newline-per-chained-call */
|
|
|
|
|
-
|
|
|
|
|
- // newUser.username = tmpUsername;
|
|
|
|
|
- // newUser.email = email;
|
|
|
|
|
- // newUser.setPassword(password);
|
|
|
|
|
- // newUser.createdAt = Date.now();
|
|
|
|
|
- // newUser.status = STATUS_INVITED;
|
|
|
|
|
-
|
|
|
|
|
- // const globalLang = configManager.getConfig('crowi', 'app:globalLang');
|
|
|
|
|
- // if (globalLang != null) {
|
|
|
|
|
- // newUser.lang = globalLang;
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // newUser.save((err, userData) => {
|
|
|
|
|
- // if (err) {
|
|
|
|
|
- // createdUserList.push({
|
|
|
|
|
- // email,
|
|
|
|
|
- // password: null,
|
|
|
|
|
- // user: null,
|
|
|
|
|
- // });
|
|
|
|
|
- // debug('save failed!! ', err);
|
|
|
|
|
- // }
|
|
|
|
|
- // else {
|
|
|
|
|
- // createdUserList.push({
|
|
|
|
|
- // email,
|
|
|
|
|
- // password,
|
|
|
|
|
- // user: userData,
|
|
|
|
|
- // });
|
|
|
|
|
- // debug('saved!', email);
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // next();
|
|
|
|
|
- // });
|
|
|
|
|
- // });
|
|
|
|
|
- // },
|
|
|
|
|
- // (err) => {
|
|
|
|
|
- // if (err) {
|
|
|
|
|
- // debug('error occured while iterate email list');
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
// if (toSendEmail) {
|
|
// if (toSendEmail) {
|
|
|
// // TODO: メール送信部分のロジックをサービス化する
|
|
// // TODO: メール送信部分のロジックをサービス化する
|
|
|
// async.each(
|
|
// async.each(
|