fix Registrazione data
fix linkref fix controllo login
This commit is contained in:
@@ -101,7 +101,7 @@ router.post('/', async (req, res) => {
|
||||
|
||||
namesurname_aportador_reg = await User.getNameSurnameByUsername(user.idapp, user.aportador_solidario);
|
||||
|
||||
if (namesurname_aportador_reg !== '' && namesurname_aportador_reg !== nomeaportador_corretto) {
|
||||
if (recextra && namesurname_aportador_reg !== '' && namesurname_aportador_reg !== nomeaportador_corretto) {
|
||||
// Si sta tentando di registrare una persona sotto che non corrisponde!
|
||||
let msg = 'L\'utente ' + user.name + ' ' + user.surname + ' si sta registrando con il link di ' + user.aportador_solidario + ' (' + namesurname_aportador_reg + ') ' +
|
||||
'invece è assegnato a ' + nomeaportador_corretto;
|
||||
|
||||
@@ -172,7 +172,7 @@ module.exports = {
|
||||
// Send to the Admin an Email
|
||||
this.sendEmail_base('admin/registration/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||
|
||||
telegrambot.notifyToTelegram(telegrambot.phase.REGISTRATION, mylocalsconf);
|
||||
await telegrambot.notifyToTelegram(telegrambot.phase.REGISTRATION, mylocalsconf);
|
||||
|
||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||
this.sendEmail_base('admin/registration/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||
|
||||
@@ -108,7 +108,7 @@ const txt = {
|
||||
MSG_VERIFY_OK: emoji.get('grinning') + ' Benvenuto %s. Ora sei correttamente verificato!',
|
||||
MSG_ERR_UNKNOWN_VERIFY_CODE: 'Errore durante il salvataggio sul Server. Riprovare piú tardi',
|
||||
MSG_EXIT_TELEGRAM: 'L\'account è stato ora scollegato da questo Telegram BOT.',
|
||||
MSG_APORTADOR_USER_REGISTERED: emoji.get('heart_eyes') + ' Si è appena Registrato con il tuo link:\n%s',
|
||||
MSG_APORTADOR_USER_REGISTERED: emoji.get('heart_eyes') + ' Si è appena Registrato %s\n(Invitato da %s)',
|
||||
MSG_MSG_SENT: emoji.get('envelope') + ' Messaggi Inviati !',
|
||||
};
|
||||
|
||||
@@ -129,22 +129,30 @@ module.exports = {
|
||||
let NameFrom = `${mylocalsconf.user.name} ${mylocalsconf.user.surname}`;
|
||||
|
||||
let aportador = '';
|
||||
if (userdest)
|
||||
if (userdest) {
|
||||
aportador = ` (${userdest})`;
|
||||
NameFrom += aportador;
|
||||
} else {
|
||||
aportador = mylocalsconf.user.aportador_solidario_nome_completo;
|
||||
}
|
||||
|
||||
NameFrom += aportador;
|
||||
let text = '';
|
||||
if (phase === this.phase.REGISTRATION) {
|
||||
if (userdest) {
|
||||
NameFrom = await User.getNameSurnameByUsername(mylocalsconf.idapp, userdest) + aportador;
|
||||
aportador = NameFrom;
|
||||
}
|
||||
text = printf(txt.MSG_APORTADOR_USER_REGISTERED, `${mylocalsconf.user.name} ${mylocalsconf.user.surname} (${mylocalsconf.user.username})`);
|
||||
text = printf(txt.MSG_APORTADOR_USER_REGISTERED, `${mylocalsconf.user.name} ${mylocalsconf.user.surname} (${mylocalsconf.user.username})`, aportador);
|
||||
}
|
||||
|
||||
if (!!mylocalsconf.user.aportador_solidario)
|
||||
await this.sendMsgTelegram(mylocalsconf.idapp, userdest, text);
|
||||
let addtext = "";
|
||||
|
||||
await this.sendMsgTelegramToTheManagers(mylocalsconf.idapp, '[Inviato a ' + NameFrom + ']:' + '\n' + text);
|
||||
if (!!mylocalsconf.user.aportador_solidario) {
|
||||
addtext = '[Inviato a ' + NameFrom + ']:' + '\n';
|
||||
await this.sendMsgTelegram(mylocalsconf.idapp, userdest, text);
|
||||
}
|
||||
|
||||
await this.sendMsgTelegramToTheManagers(mylocalsconf.idapp, addtext + text);
|
||||
},
|
||||
|
||||
|
||||
@@ -153,9 +161,9 @@ module.exports = {
|
||||
// console.log('usersmanagers', usersmanagers);
|
||||
|
||||
if (usersmanagers) {
|
||||
usersmanagers.forEach((rec) => {
|
||||
for (const rec of usersmanagers) {
|
||||
this.sendMsgTelegramByIdTelegram(idapp, rec.profile.teleg_id, text)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user