Version 1.0.1 - Fix de WebMetrics et de l'édit utilisateur
All checks were successful
Neutral/pipeline/head This commit looks good
All checks were successful
Neutral/pipeline/head This commit looks good
This commit is contained in:
@ -328,6 +328,9 @@ module.exports.User = class {
|
||||
setPicture(file) {
|
||||
this.#sync()
|
||||
var pictureDir = __glob.USERS_IMAGES + path.sep + uuid.v4().toString() + ".png"
|
||||
if(!fs.existsSync(__glob.USERS_IMAGES)) {
|
||||
fs.mkdirSync(__glob.USERS_IMAGES)
|
||||
}
|
||||
fs.writeFileSync(pictureDir, file)
|
||||
|
||||
this.picture = pictureDir.replace(__glob.USERS_IMAGES + path.sep, "/users/")
|
||||
@ -430,7 +433,7 @@ module.exports.editUser = function(settings) {
|
||||
ulog.step.init("edit_user", "Modification d'un utilisateur dans la base de donnée : " + settings.username)
|
||||
const user = this.fetchUsers().get(settings.username)
|
||||
if(user) {
|
||||
console.log(settings)
|
||||
|
||||
if(settings.newusername && settings.newusername != settings.username) {
|
||||
if(this.getUser(settings.newusername)) {
|
||||
ulog.error("L'utilisateur existe déjà : " + settings.username)
|
||||
@ -466,7 +469,7 @@ module.exports.editUser = function(settings) {
|
||||
}
|
||||
|
||||
module.exports.editMySelf = function (settings, user) {
|
||||
if(user.username == settings.actualUsername) {
|
||||
if(user.username == settings.username) {
|
||||
if(settings.username == '') {
|
||||
ulog.error("Le nom d'utilisateur est manquant")
|
||||
return "USERNAME_MISSING"
|
||||
|
Reference in New Issue
Block a user