Se la window viene attivata, e se sono in fase di registrazione, allora controllo se ci sono aggiornamenti ogni 10 secondi, loadSite
Corretto che il link di registrazione se era in minuscolo l'username e venivi registrato in maiuscolo, non lo prendeva. L'immagine di telegram occorre salvare anche la versione SMALL Corretto filtro, se cambiavo Regione, non mi resettava la Provincia e la Città
This commit is contained in:
@@ -70,14 +70,22 @@ MsgTemplateSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
MsgTemplateSchema.statics.getMsgByLang = async function (idapp, typemsg, lang) {
|
||||
MsgTemplateSchema.statics.getMsgByLang = async function (idapp, myuser, typemsg, lang) {
|
||||
const MsgTemplate = this;
|
||||
|
||||
try {
|
||||
const mymsg = await MsgTemplate.findOne({ idapp, typemsg });
|
||||
if (!!mymsg) {
|
||||
if ((!!mymsg["msg_" + lang]) && (!!mymsg["title_" + lang])) {
|
||||
return { body: mymsg["msg_" + lang], title: mymsg["title_" + lang] }
|
||||
let body = mymsg["msg_" + lang]
|
||||
let title = mymsg["title_" + lang]
|
||||
if (!body) {
|
||||
body = mymsg["msg_it"]
|
||||
title = mymsg["title_it"]
|
||||
}
|
||||
body = tools.convertSpecialTags(myuser, body);
|
||||
title = tools.convertSpecialTags(myuser, title);
|
||||
return { body, title }
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -2173,13 +2173,34 @@ UserSchema.statics.getNameSurnameByUsername = async function(
|
||||
UserSchema.statics.getIdByUsername = async function(idapp, username) {
|
||||
const User = this;
|
||||
|
||||
let regexp = new RegExp(`${username}`, 'i')
|
||||
|
||||
return User.findOne({
|
||||
idapp, username,
|
||||
idapp,
|
||||
username :
|
||||
{ $regex: regexp },
|
||||
$or: [{deleted: {$exists: false}}, {deleted: {$exists: true, $eq: false}}],
|
||||
}, {username: 1, _id: 1}).then((rec) => {
|
||||
return (!!rec) ? rec._id.toString() : '';
|
||||
}).catch((e) => {
|
||||
console.error('getNameSurnameByUsername', e);
|
||||
console.error('getIdByUsername', e);
|
||||
});
|
||||
};
|
||||
|
||||
UserSchema.statics.getRealUsernameByUsername = async function(idapp, username) {
|
||||
const User = this;
|
||||
|
||||
let regexp = new RegExp(`${username}`, 'i')
|
||||
|
||||
return User.findOne({
|
||||
idapp,
|
||||
username :
|
||||
{ $regex: regexp },
|
||||
$or: [{deleted: {$exists: false}}, {deleted: {$exists: true, $eq: false}}],
|
||||
}, {username: 1, _id: 1}).then((rec) => {
|
||||
return (!!rec) ? rec.username : '';
|
||||
}).catch((e) => {
|
||||
console.error('getRealUsernameByUsername', e);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user