mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
closes #3585
This commit is contained in:
@@ -374,6 +374,8 @@ accountsController.accountEdit = function(req, res, callback) {
|
|||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userData['username:disableEdit'] = parseInt(meta.config['username:disableEdit'], 10) === 1;
|
||||||
|
|
||||||
userData.hasPassword = !!password;
|
userData.hasPassword = !!password;
|
||||||
userData.title = '[[pages:account/edit, ' + userData.username + ']]';
|
userData.title = '[[pages:account/edit, ' + userData.username + ']]';
|
||||||
userData.breadcrumbs = helpers.buildBreadcrumbs([{text: userData.username, url: '/user/' + userData.userslug}, {text: '[[user:edit]]'}]);
|
userData.breadcrumbs = helpers.buildBreadcrumbs([{text: userData.username, url: '/user/' + userData.userslug}, {text: '[[user:edit]]'}]);
|
||||||
|
|||||||
@@ -231,6 +231,10 @@ SocketUser.updateProfile = function(socket, data, callback) {
|
|||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parseInt(meta.config['username:disableEdit'], 10) === 1) {
|
||||||
|
data.username = oldUserData.username;
|
||||||
|
}
|
||||||
|
|
||||||
update(oldUserData, callback);
|
update(oldUserData, callback);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,6 +44,12 @@
|
|||||||
<div class="col-sm-2 col-xs-12 settings-header">Account Settings</div>
|
<div class="col-sm-2 col-xs-12 settings-header">Account Settings</div>
|
||||||
<div class="col-sm-10 col-xs-12">
|
<div class="col-sm-10 col-xs-12">
|
||||||
<form>
|
<form>
|
||||||
|
<div class="checkbox">
|
||||||
|
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
|
<input class="mdl-switch__input" type="checkbox" data-field="username:disableEdit">
|
||||||
|
<span class="mdl-switch__label"><strong>Disable username changes</strong></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
<input class="mdl-switch__input" type="checkbox" data-field="allowAccountDelete" checked>
|
<input class="mdl-switch__input" type="checkbox" data-field="allowAccountDelete" checked>
|
||||||
|
|||||||
Reference in New Issue
Block a user