- Billettera
- Lista Ingressi - Send a Tutti la propria Lavagna.
This commit is contained in:
@@ -77,7 +77,7 @@ router.post(process.env.LINKVERIF_REG, (req, res) => {
|
||||
user.lasttimeonline = new Date();
|
||||
user.save().then(() => {
|
||||
//console.log("TROVATOOOOOO!");
|
||||
res.send({ code: server_constants.RIS_CODE_EMAIL_VERIFIED, msg: tools.getres__('EMAIL_VERIF', res) });
|
||||
res.send({ code: server_constants.RIS_CODE_EMAIL_VERIFIED, msg: tools.getres__('EMAIL', res) + ' ' + tools.getres__('VERIF', res) });
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ router.post(process.env.LINK_UPDATE_PWD, (req, res) => {
|
||||
const msg = "Richiesta Nuova Password: idapp= " + idapp + " email = " + email;
|
||||
console.log(msg);
|
||||
|
||||
telegrambot.sendMsgTelegramToTheManagers(body.idapp, msg);
|
||||
// telegrambot.sendMsgTelegramToTheManagers(body.idapp, msg);
|
||||
|
||||
User.findByLinkTokenforgot(idapp, email, tokenforgot).then((user) => {
|
||||
if (!user) {
|
||||
|
||||
@@ -29,6 +29,9 @@ router.post('/load', async (req, res) => {
|
||||
email_non_verif: await User.getEmailNotVerified(idapp),
|
||||
num_teleg_attivo: await User.getUsersTelegramAttivo(idapp),
|
||||
num_teleg_pending: await User.getUsersTelegramPending(idapp),
|
||||
num_qualificati: await User.getNumUsersQualified(idapp, 2),
|
||||
num_requisiti: await User.getNumUsersQualified(idapp, 0),
|
||||
num_modalita_pagamento: await User.getnumPaymentOk(idapp),
|
||||
num_part_zoom: await User.getUsersZoom(idapp),
|
||||
num_part_accepted: await User.getSaw_and_Accepted(idapp),
|
||||
num_users_dream: await User.getUsersDreams(idapp),
|
||||
|
||||
@@ -49,6 +49,8 @@ router.post('/', async (req, res) => {
|
||||
const body = _.pick(req.body, ['email', 'password', 'username', 'name', 'surname', 'idapp', 'keyappid', 'lang', 'profile', 'aportador_solidario']);
|
||||
const user = new User(body);
|
||||
|
||||
body.email = body.email.toLowerCase();
|
||||
|
||||
// tools.mylog("LANG PASSATO = " + user.lang, "IDAPP", user.idapp);
|
||||
|
||||
user.linkreg = reg.getlinkregByEmail(body.idapp, body.email, body.username);
|
||||
@@ -104,16 +106,13 @@ router.post('/', async (req, res) => {
|
||||
|
||||
let recextra = null;
|
||||
|
||||
recextra = await ExtraList.findByCellAndNameSurname(user.idapp, user.profile.cell, user.name, user.surname);
|
||||
let nomeaportador_corretto = "";
|
||||
if (recextra) {
|
||||
nomeaportador_corretto = recextra.aportador_solidario_name_surname;
|
||||
if (nomeaportador_corretto === '')
|
||||
nomeaportador_corretto = recextra.aportador_solidario_originale_name_surname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// recextra = await ExtraList.findByCellAndNameSurname(user.idapp, user.profile.cell, user.name, user.surname);
|
||||
// let nomeaportador_corretto = "";
|
||||
// if (recextra) {
|
||||
// nomeaportador_corretto = recextra.aportador_solidario_name_surname;
|
||||
// if (nomeaportador_corretto === '')
|
||||
// nomeaportador_corretto = recextra.aportador_solidario_originale_name_surname;
|
||||
// }
|
||||
|
||||
const lastuser = await User.getLastUser(user.idapp);
|
||||
const lastextra = await ExtraList.getLastUser(user.idapp);
|
||||
@@ -130,6 +129,27 @@ router.post('/', async (req, res) => {
|
||||
if (lastindorder > 0)
|
||||
user.ind_order = lastindorder + 1;
|
||||
|
||||
const numero = user.name.slice(-1);
|
||||
if ((numero === '2') || (numero === '3') || (numero === '4')) {
|
||||
recorig = await User.findByCellAndNameSurname(user.idapp, user.profile.cell, user.name.slice(0, -1), user.surname);
|
||||
if (!!recorig) {
|
||||
user.profile.teleg_id = recorig.profile.teleg_id;
|
||||
user.profile.saw_zoom_presentation = recorig.profile.saw_zoom_presentation;
|
||||
user.profile.saw_and_accepted = recorig.profile.saw_and_accepted;
|
||||
user.profile.email_paypal = recorig.profile.email_paypal;
|
||||
user.profile.paymenttypes = recorig.profile.paymenttypes;
|
||||
let msgseconda = '!!! REGISTRATA ';
|
||||
if (numero === '2')
|
||||
msgseconda += 'SECONDA';
|
||||
else if (numero === '3')
|
||||
msgseconda += 'TERZA';
|
||||
else if (numero === '4')
|
||||
msgseconda += 'QUARTA';
|
||||
|
||||
msgseconda += ' UTENZA di ' + recorig.name + ' ' + recorig.surname + ' (' + recorig.username + ') : ' + user.name + ' ' + user.surname + ' (' + user.username + ') ';
|
||||
telegrambot.sendMsgTelegramToTheManagers(user.idapp, msgseconda);
|
||||
}
|
||||
}
|
||||
|
||||
namesurname_aportador_reg = await User.getNameSurnameByUsername(user.idapp, user.aportador_solidario);
|
||||
|
||||
@@ -184,7 +204,7 @@ router.post('/', async (req, res) => {
|
||||
|
||||
return await user.save()
|
||||
.then(async () => {
|
||||
return await User.findByUsername(user.idapp, user.username)
|
||||
return await User.findByUsername(user.idapp, user.username, false)
|
||||
.then((usertrovato) => {
|
||||
|
||||
// tools.mylog("TROVATO USERNAME ? ", user.username, usertrovato);
|
||||
@@ -228,7 +248,7 @@ router.get('/:idapp/:username', (req, res) => {
|
||||
var username = req.params.username;
|
||||
const idapp = req.params.idapp;
|
||||
|
||||
User.findByUsername(idapp, username).then((user) => {
|
||||
User.findByUsername(idapp, username, false).then((user) => {
|
||||
if (!user) {
|
||||
return res.status(404).send();
|
||||
}
|
||||
@@ -331,6 +351,7 @@ router.post('/login', (req, res) => {
|
||||
code: server_constants.RIS_CODE_OK,
|
||||
subsExistonDb: myris.subsExistonDb
|
||||
});
|
||||
|
||||
// tools.mylog("TROVATOOO!");
|
||||
|
||||
// tools.mylog('FINE LOGIN')
|
||||
|
||||
Reference in New Issue
Block a user