v1.18.x
psychobunny 10 years ago
parent faae98892d
commit ae1043543d

@ -374,6 +374,8 @@ accountsController.accountEdit = function(req, res, callback) {
return callback(err);
}
userData['username:disableEdit'] = parseInt(meta.config['username:disableEdit'], 10) === 1;
userData.hasPassword = !!password;
userData.title = '[[pages:account/edit, ' + userData.username + ']]';
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);
}
if (parseInt(meta.config['username:disableEdit'], 10) === 1) {
data.username = oldUserData.username;
}
update(oldUserData, callback);
});
};

@ -44,6 +44,12 @@
<div class="col-sm-2 col-xs-12 settings-header">Account Settings</div>
<div class="col-sm-10 col-xs-12">
<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">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" data-field="allowAccountDelete" checked>

Loading…
Cancel
Save