mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
closes #935
This commit is contained in:
@@ -31,10 +31,23 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
|
||||
$('#user-current-picture').attr('src', data.picture);
|
||||
$('#user_label img').attr('src', data.picture);
|
||||
}
|
||||
|
||||
if (data.gravatarpicture) {
|
||||
$('#user-gravatar-picture').attr('src', data.gravatarpicture);
|
||||
gravatarPicture = data.gravatarpicture;
|
||||
}
|
||||
|
||||
if(data.userslug) {
|
||||
var oldslug = $('.account-username-box').attr('data-userslug');
|
||||
$('.account-username-box a').each(function(index) {
|
||||
$(this).attr('href', $(this).attr('href').replace(oldslug, data.userslug));
|
||||
});
|
||||
$('.account-username a:first-child').html(userData.username);
|
||||
$('.account-username-box').attr('data-userslug', data.userslug);
|
||||
|
||||
$('#user-profile-link').attr('href', config.relative_path + '/user/' + data.userslug);
|
||||
$('#user-profile-link span').html(' ' + userData.username);
|
||||
}
|
||||
} else {
|
||||
app.alertError('There was an error updating your profile! ' + err.message);
|
||||
}
|
||||
|
||||
@@ -312,6 +312,7 @@ var bcrypt = require('bcryptjs'),
|
||||
User.setUserField(uid, 'userslug', userslug);
|
||||
db.deleteObjectField('userslug:uid', userData.userslug);
|
||||
db.setObjectField('userslug:uid', userslug, uid);
|
||||
returnData.userslug = userslug;
|
||||
}
|
||||
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user