mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 16:05:49 +01:00
closes #3469
This commit is contained in:
@@ -347,16 +347,20 @@ function createAdmin(callback) {
|
|||||||
winston.warn("Passwords did not match, please try again");
|
winston.warn("Passwords did not match, please try again");
|
||||||
return retryPassword(results);
|
return retryPassword(results);
|
||||||
}
|
}
|
||||||
|
var adminUid;
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function(next) {
|
function(next) {
|
||||||
User.create({username: results.username, password: results.password, email: results.email}, next);
|
User.create({username: results.username, password: results.password, email: results.email}, next);
|
||||||
},
|
},
|
||||||
function(uid, next) {
|
function(uid, next) {
|
||||||
|
adminUid = uid;
|
||||||
Groups.join('administrators', uid, next);
|
Groups.join('administrators', uid, next);
|
||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
Groups.show('administrators', next);
|
Groups.show('administrators', next);
|
||||||
|
},
|
||||||
|
function(next) {
|
||||||
|
Groups.ownership.grant(adminUid, 'administrators', next);
|
||||||
}
|
}
|
||||||
], function(err) {
|
], function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user