- Nella Lavagna, cliccando sul nome dell'invitato, compaiono le sue informazioni sugli step rimasti, in dettaglio.
- Ogni utente puo' cosi scegliere di regalare un proprio invitato, cliccando sull'invitato, scrivendo l'username del destinatario e premendo il bottone 'Regala Invitato'. Al destinatario gli arriverà un messaggio sul Bot Telegram che indica che gli è stato regalato un'invitato.
This commit is contained in:
@@ -12,8 +12,6 @@ span Cellulare:
|
|||||||
strong #{user.profile.intcode_cell} #{user.profile.cell}<br>
|
strong #{user.profile.intcode_cell} #{user.profile.cell}<br>
|
||||||
span Nazionalità:
|
span Nazionalità:
|
||||||
strong #{user.profile.nationality}<br>
|
strong #{user.profile.nationality}<br>
|
||||||
span Username di chi lo ha Invitato:
|
|
||||||
strong #{user.aportador_solidario}<br>
|
|
||||||
p <br>Saluti
|
p <br>Saluti
|
||||||
|
|
||||||
style(type="text/css").
|
style(type="text/css").
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ var ExtraListSchema = new mongoose.Schema({
|
|||||||
note: {
|
note: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
contacted: {
|
||||||
|
type: Boolean,
|
||||||
|
},
|
||||||
col_b: {
|
col_b: {
|
||||||
type: Number,
|
type: Number,
|
||||||
},
|
},
|
||||||
@@ -87,17 +90,17 @@ var ExtraListSchema = new mongoose.Schema({
|
|||||||
registered: {
|
registered: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
}
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ExtraListSchema.methods.toJSON = function () {
|
// ExtraListSchema.methods.toJSON = function () {
|
||||||
const extralist = this;
|
// const extralist = this;
|
||||||
const userObject = extralist.toObject();
|
// const userObject = extralist.toObject();
|
||||||
|
//
|
||||||
return _.pick(userObject, ['_id', ...shared_consts.fieldsUserToChange()]);
|
// return _.pick(userObject, ['_id', ...shared_consts.fieldsUserToChange()]);
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
ExtraListSchema.statics.findByUsername = function (idapp, username) {
|
ExtraListSchema.statics.findByUsername = function (idapp, username) {
|
||||||
const ExtraList = this;
|
const ExtraList = this;
|
||||||
|
|
||||||
@@ -174,16 +177,30 @@ ExtraListSchema.statics.getDownlineNotRegisteredByNameSurname = function (idapp,
|
|||||||
'aportador_solidario_name_surname': nameandsurname,
|
'aportador_solidario_name_surname': nameandsurname,
|
||||||
registered: false,
|
registered: false,
|
||||||
}, {
|
}, {
|
||||||
username: 1,
|
ind_order: 1,
|
||||||
name: 1,
|
name: 1,
|
||||||
surname: 1,
|
surname: 1,
|
||||||
verified_email: 1,
|
cell_complete: 1,
|
||||||
'profile.teleg_id': 1,
|
num_invitati: 1,
|
||||||
'profile.saw_zoom_presentation': 1,
|
nationality: 1,
|
||||||
made_gift: 1,
|
}, (err, arrrec) => {
|
||||||
email: 1,
|
return arrrec
|
||||||
date_reg: 1,
|
});
|
||||||
img: 1
|
};
|
||||||
|
|
||||||
|
ExtraListSchema.statics.getUserNotRegisteredByNameSurname = function (idapp, nameandsurname) {
|
||||||
|
const ExtraList = this;
|
||||||
|
|
||||||
|
return ExtraList.findOne({
|
||||||
|
name_complete: nameandsurname,
|
||||||
|
registered: false,
|
||||||
|
}, {
|
||||||
|
ind_order: 1,
|
||||||
|
name: 1,
|
||||||
|
surname: 1,
|
||||||
|
cell_complete: 1,
|
||||||
|
num_invitati: 1,
|
||||||
|
nationality: 1,
|
||||||
}, (err, arrrec) => {
|
}, (err, arrrec) => {
|
||||||
return arrrec
|
return arrrec
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const _ = require('lodash');
|
|||||||
const tools = require('../tools/general');
|
const tools = require('../tools/general');
|
||||||
|
|
||||||
const { Settings } = require('../models/settings');
|
const { Settings } = require('../models/settings');
|
||||||
|
const { ExtraList } = require('../models/extralist');
|
||||||
|
|
||||||
const shared_consts = require('../tools/shared_nodejs');
|
const shared_consts = require('../tools/shared_nodejs');
|
||||||
const queryclass = require('../classes/queryclass');
|
const queryclass = require('../classes/queryclass');
|
||||||
@@ -328,6 +329,7 @@ UserSchema.statics.getUserShortDataByUsername = function (idapp, username) {
|
|||||||
'idapp': idapp,
|
'idapp': idapp,
|
||||||
'username': username,
|
'username': username,
|
||||||
}, {
|
}, {
|
||||||
|
ind_order: 1,
|
||||||
username: 1,
|
username: 1,
|
||||||
name: 1,
|
name: 1,
|
||||||
surname: 1,
|
surname: 1,
|
||||||
@@ -355,6 +357,8 @@ UserSchema.statics.getDownlineByUsername = function (idapp, username) {
|
|||||||
'idapp': idapp,
|
'idapp': idapp,
|
||||||
'aportador_solidario': username,
|
'aportador_solidario': username,
|
||||||
}, {
|
}, {
|
||||||
|
aportador_solidario: 1,
|
||||||
|
ind_order: 1,
|
||||||
username: 1,
|
username: 1,
|
||||||
name: 1,
|
name: 1,
|
||||||
surname: 1,
|
surname: 1,
|
||||||
@@ -700,7 +704,7 @@ UserSchema.statics.DuplicateAllRecords = async function (idapporig, idappdest) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, username) {
|
UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, username, aportador_solidario_nome_completo) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// DATA: username, name, surname, email, intcode_cell, cell
|
// DATA: username, name, surname, email, intcode_cell, cell
|
||||||
@@ -709,14 +713,21 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
|||||||
downline: []
|
downline: []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dashboard.myself = await User.getUserShortDataByUsername(idapp, username);
|
||||||
// Data of my Aportador
|
// Data of my Aportador
|
||||||
dashboard.aportador = await User.getUserShortDataByUsername(idapp, aportador_solidario);
|
dashboard.aportador = await User.getUserShortDataByUsername(idapp, aportador_solidario);
|
||||||
|
if (dashboard.aportador === undefined ) {
|
||||||
|
dashboard.aportador = await ExtraList.getUserNotRegisteredByNameSurname(idapp, aportador_solidario_nome_completo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Data of my Downline
|
// Data of my Downline
|
||||||
const arrap = await User.getDownlineByUsername(idapp, aportador_solidario);
|
const arrap = await User.getDownlineByUsername(idapp, aportador_solidario);
|
||||||
dashboard.numpeople_aportador = arrap.length;
|
dashboard.numpeople_aportador = arrap.length;
|
||||||
|
|
||||||
dashboard.downline = await User.getDownlineByUsername(idapp, username);
|
dashboard.downline = await User.getDownlineByUsername(idapp, username);
|
||||||
|
dashboard.downnotreg = await ExtraList.getDownlineNotRegisteredByNameSurname(idapp, dashboard.myself.name + ' ' + dashboard.myself.surname);
|
||||||
|
|
||||||
dashboard.downbyuser = {};
|
dashboard.downbyuser = {};
|
||||||
|
|
||||||
for (const down of dashboard.downline) {
|
for (const down of dashboard.downline) {
|
||||||
|
|||||||
@@ -25,14 +25,23 @@ router.post('/', authenticate, async (req, res) => {
|
|||||||
return res.status(404).send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
|
return res.status(404).send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
|
||||||
}
|
}
|
||||||
let aportador_solidario = req.user.aportador_solidario;
|
let aportador_solidario = req.user.aportador_solidario;
|
||||||
|
let aportador_solidario_nome_completo = req.user.aportador_solidario_nome_completo;
|
||||||
|
|
||||||
|
// if (User.isAdmin(req.user.perm) || User.isManager(req.user.perm)) {
|
||||||
|
// const recuser = await User.findByUsername(idapp, username);
|
||||||
|
// if (recuser) {
|
||||||
|
// aportador_solidario_nome_completo = recuser.name + ' ' + recuser.surname;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if (username) {
|
if (username) {
|
||||||
aportador_solidario = await User.getAportadorSolidarioByUsername(idapp, username)
|
aportador_solidario = await User.getAportadorSolidarioByUsername(idapp, username);
|
||||||
|
aportador_solidario_nome_completo = await User.getNameSurnameByUsername(idapp, username);
|
||||||
} else {
|
} else {
|
||||||
username = req.user.username;
|
username = req.user.username;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dashboard = await User.getDashboard(idapp, aportador_solidario, username);
|
const dashboard = await User.getDashboard(idapp, aportador_solidario, username, aportador_solidario_nome_completo);
|
||||||
if (dashboard)
|
if (dashboard)
|
||||||
res.send({ dashboard });
|
res.send({ dashboard });
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ router.post('/gettable', authenticate, (req, res) => {
|
|||||||
router.patch('/chval', authenticate, (req, res) => {
|
router.patch('/chval', authenticate, (req, res) => {
|
||||||
// const idapp = req.body.idapp;
|
// const idapp = req.body.idapp;
|
||||||
const id = req.body.data.id;
|
const id = req.body.data.id;
|
||||||
|
const idapp = req.body.idapp;
|
||||||
const mydata = req.body.data;
|
const mydata = req.body.data;
|
||||||
|
|
||||||
const mytable = getTableByTableName(mydata.table);
|
const mytable = getTableByTableName(mydata.table);
|
||||||
@@ -276,7 +277,12 @@ router.patch('/chval', authenticate, (req, res) => {
|
|||||||
if (!rec) {
|
if (!rec) {
|
||||||
return res.status(404).send();
|
return res.status(404).send();
|
||||||
} else {
|
} else {
|
||||||
|
if (mydata.notifBot) {
|
||||||
|
// Send Notification to the BOT
|
||||||
|
telegrambot.sendMsgTelegram(idapp, mydata.notifBot.un, mydata.notifBot.txt)
|
||||||
|
}
|
||||||
res.send({ code: server_constants.RIS_CODE_OK, msg: '' });
|
res.send({ code: server_constants.RIS_CODE_OK, msg: '' });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
@@ -625,7 +631,8 @@ router.post('/upload/:dir', authenticate, (req, res) => {
|
|||||||
|
|
||||||
// Move in the folder application !
|
// Move in the folder application !
|
||||||
tools.move(file.path, newname, (err) => {
|
tools.move(file.path, newname, (err) => {
|
||||||
console.log('err:', err);
|
if (err)
|
||||||
|
console.log('err:', err);
|
||||||
res.end();
|
res.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ router.post('/login', (req, res) => {
|
|||||||
await tools.snooze(3000);
|
await tools.snooze(3000);
|
||||||
const msg = "Tentativo di Login ERRATO [" + body.username + ' , ' + body.password + ']\n' + '[IP: ' + tools.getiPAddressUser(req) + ']';
|
const msg = "Tentativo di Login ERRATO [" + body.username + ' , ' + body.password + ']\n' + '[IP: ' + tools.getiPAddressUser(req) + ']';
|
||||||
tools.mylogshow(msg);
|
tools.mylogshow(msg);
|
||||||
telegrambot.sendMsgTelegramToTheManagers(body.idapp, msg);
|
// telegrambot.sendMsgTelegramToTheManagers(body.idapp, msg);
|
||||||
res.status(404).send({ code: server_constants.RIS_CODE_LOGIN_ERR });
|
res.status(404).send({ code: server_constants.RIS_CODE_LOGIN_ERR });
|
||||||
}
|
}
|
||||||
return user
|
return user
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ class Telegram {
|
|||||||
let mystr = '';
|
let mystr = '';
|
||||||
if (rec.user) {
|
if (rec.user) {
|
||||||
|
|
||||||
const dashboard = await User.getDashboard(this.idapp, rec.user.aportador_solidario, rec.user.username);
|
const dashboard = await User.getDashboard(this.idapp, rec.user.aportador_solidario, rec.user.username, rec.user.aportador_solidario_name_surname);
|
||||||
|
|
||||||
let numpersone = (dashboard.downline) ? dashboard.downline.length : 0;
|
let numpersone = (dashboard.downline) ? dashboard.downline.length : 0;
|
||||||
mystr = "";
|
mystr = "";
|
||||||
@@ -336,12 +336,24 @@ class Telegram {
|
|||||||
if (numpersone > 0) {
|
if (numpersone > 0) {
|
||||||
let index = 1;
|
let index = 1;
|
||||||
dashboard.downline.forEach((user) => {
|
dashboard.downline.forEach((user) => {
|
||||||
mystr += emoji.get('star-struck') + ` ${index}°: ${user.username} (${user.name} ${user.surname})\n`;
|
mystr += emoji.get('star-struck') + ` ${index}°: ${user.name} ${user.surname} (${user.username})\n`;
|
||||||
index++;
|
index++;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (dashboard.downnotreg) {
|
||||||
|
if (dashboard.downnotreg.length > 0) {
|
||||||
|
mystr += '\n' + emo.QUESTION_MARK + ' ' + tools.get__('NONREG', msg) + ':' + emo.QUESTION_MARK + '\n';
|
||||||
|
let index = 1;
|
||||||
|
dashboard.downnotreg.forEach((user) => {
|
||||||
|
mystr += ` - ${index}°: ${user.name} ${user.surname} (tel: ${user.cell_complete})\n`;
|
||||||
|
index++;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!!mystr)
|
if (!!mystr)
|
||||||
await this.sendMsg(msg.chat.id, mystr);
|
await this.sendMsg(msg.chat.id, mystr);
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ const Url = require('url-parse');
|
|||||||
|
|
||||||
const { ObjectID } = require('mongodb');
|
const { ObjectID } = require('mongodb');
|
||||||
|
|
||||||
|
const shared_consts = require('../tools/shared_nodejs');
|
||||||
|
|
||||||
const mongoose = require('mongoose');
|
const mongoose = require('mongoose');
|
||||||
const Subscription = mongoose.model('subscribers');
|
const Subscription = mongoose.model('subscribers');
|
||||||
|
|
||||||
@@ -43,7 +45,7 @@ textlang = {
|
|||||||
"Nuova Registrazione": "Nuova Registrazione",
|
"Nuova Registrazione": "Nuova Registrazione",
|
||||||
"Effettuata una Nuova Registrazione": "Effettuata una Nuova Registrazione",
|
"Effettuata una Nuova Registrazione": "Effettuata una Nuova Registrazione",
|
||||||
"partecipanti": "partecipanti",
|
"partecipanti": "partecipanti",
|
||||||
'TESTO_ASSISTENZA': "Per entrare nel Sito AYNI:\nhttps://ayni.gifteconomy.app\n\nHai dimenticato la Password per accedere al sito?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (questa):\nhttps://t.me/notevoleaynibot\n\nChat AYNI-BiblioBacheca: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat di Aiuto e Supporto: 'AYNI Help & Support'\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Poni il tuo quesito, chiedi assistenza.\n2 - Terminata l\'assistenza, uscirete da quella Chat.\nPotrete rientrare tutte le volte che ce ne sia necessità." ,
|
'TESTO_ASSISTENZA': "Per entrare nel Sito AYNI:\nhttps://ayni.gifteconomy.app\n\nHai dimenticato la Password per accedere al sito?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (questa):\nhttps://t.me/notevoleaynibot\n\nChat AYNI-BiblioBacheca: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat di Aiuto e Supporto: 'AYNI Help & Support'\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Poni il tuo quesito, chiedi assistenza.\n2 - Terminata l\'assistenza, uscirete da quella Chat.\nPotrete rientrare tutte le volte che ce ne sia necessità.",
|
||||||
'BENVENUTO': "Benvenuto",
|
'BENVENUTO': "Benvenuto",
|
||||||
'EMAIL_VERIF': "Email Verificata",
|
'EMAIL_VERIF': "Email Verificata",
|
||||||
'EMAIL_NON_VERIF': "Email Non Verificata\nleggi la tua casella email e trova **\"Confermare la Registrazione a Ayni\"**<br>e clicca sul bottone **\"Verifica Registrazione\"**",
|
'EMAIL_NON_VERIF': "Email Non Verificata\nleggi la tua casella email e trova **\"Confermare la Registrazione a Ayni\"**<br>e clicca sul bottone **\"Verifica Registrazione\"**",
|
||||||
@@ -52,6 +54,7 @@ textlang = {
|
|||||||
'ZOOM_PARTECIPATO': 'Partecipazione ad almeno 1 Conferenza (Zoom)',
|
'ZOOM_PARTECIPATO': 'Partecipazione ad almeno 1 Conferenza (Zoom)',
|
||||||
'SCRITTO_SOGNO': 'Hai scritto il tuo Sogno',
|
'SCRITTO_SOGNO': 'Hai scritto il tuo Sogno',
|
||||||
'INVITATI': 'persone registrate che hai invitato',
|
'INVITATI': 'persone registrate che hai invitato',
|
||||||
|
'NONREG': 'Invitati non Registrati',
|
||||||
},
|
},
|
||||||
es: {
|
es: {
|
||||||
"L'Email è già stata Verificata": "L'Email è già stata Verificata",
|
"L'Email è già stata Verificata": "L'Email è già stata Verificata",
|
||||||
@@ -59,7 +62,7 @@ textlang = {
|
|||||||
"Effettuata una Nuova Registrazione": "Se ha realizado un nuevo registro",
|
"Effettuata una Nuova Registrazione": "Se ha realizado un nuevo registro",
|
||||||
"partecipanti": "participantes",
|
"partecipanti": "participantes",
|
||||||
|
|
||||||
'TESTO_ASSISTENZA': "Per entrare nel Sito AYNI:\nhttps://ayni.gifteconomy.app\n\nHai dimenticato la Password per accedere al sito?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (questa):\nhttps://t.me/notevoleaynibot\n\nChat AYNI-BiblioBacheca: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat di Aiuto e Supporto: 'AYNI Help & Support'\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Poni il tuo quesito, chiedi assistenza.\n2 - Terminata l\'assistenza, uscirete da quella Chat.\nPotrete rientrare tutte le volte che ce ne sia necessità." ,
|
'TESTO_ASSISTENZA': "Per entrare nel Sito AYNI:\nhttps://ayni.gifteconomy.app\n\nHai dimenticato la Password per accedere al sito?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (questa):\nhttps://t.me/notevoleaynibot\n\nChat AYNI-BiblioBacheca: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat di Aiuto e Supporto: 'AYNI Help & Support'\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Poni il tuo quesito, chiedi assistenza.\n2 - Terminata l\'assistenza, uscirete da quella Chat.\nPotrete rientrare tutte le volte che ce ne sia necessità.",
|
||||||
'BENVENUTO': "Benvenuto",
|
'BENVENUTO': "Benvenuto",
|
||||||
'EMAIL_VERIF': "Email Verificata",
|
'EMAIL_VERIF': "Email Verificata",
|
||||||
'EMAIL_NON_VERIF': "Email Non Verificata\nleggi la tua casella email e trova **\"Confermare la Registrazione a Ayni\"**<br>e clicca sul bottone **\"Verifica Registrazione\"**",
|
'EMAIL_NON_VERIF': "Email Non Verificata\nleggi la tua casella email e trova **\"Confermare la Registrazione a Ayni\"**<br>e clicca sul bottone **\"Verifica Registrazione\"**",
|
||||||
@@ -68,10 +71,11 @@ textlang = {
|
|||||||
'ZOOM_PARTECIPATO': 'Partecipazione ad almeno 1 Conferenza (Zoom)',
|
'ZOOM_PARTECIPATO': 'Partecipazione ad almeno 1 Conferenza (Zoom)',
|
||||||
'SCRITTO_SOGNO': 'Hai scritto il tuo Sogno',
|
'SCRITTO_SOGNO': 'Hai scritto il tuo Sogno',
|
||||||
'INVITATI': 'persone registrate che hai invitato',
|
'INVITATI': 'persone registrate che hai invitato',
|
||||||
|
'NONREG': 'Invitati non Registrati',
|
||||||
},
|
},
|
||||||
us: {
|
us: {
|
||||||
"partecipanti": "participants",
|
"partecipanti": "participants",
|
||||||
'TESTO_ASSISTENZA': "Per entrare nel Sito AYNI:\nhttps://ayni.gifteconomy.app\n\nHai dimenticato la Password per accedere al sito?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (questa):\nhttps://t.me/notevoleaynibot\n\nChat AYNI-BiblioBacheca: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat di Aiuto e Supporto: 'AYNI Help & Support'\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Poni il tuo quesito, chiedi assistenza.\n2 - Terminata l\'assistenza, uscirete da quella Chat.\nPotrete rientrare tutte le volte che ce ne sia necessità." ,
|
'TESTO_ASSISTENZA': "Per entrare nel Sito AYNI:\nhttps://ayni.gifteconomy.app\n\nHai dimenticato la Password per accedere al sito?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (questa):\nhttps://t.me/notevoleaynibot\n\nChat AYNI-BiblioBacheca: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat di Aiuto e Supporto: 'AYNI Help & Support'\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Poni il tuo quesito, chiedi assistenza.\n2 - Terminata l\'assistenza, uscirete da quella Chat.\nPotrete rientrare tutte le volte che ce ne sia necessità.",
|
||||||
'BENVENUTO': "Benvenuto",
|
'BENVENUTO': "Benvenuto",
|
||||||
'EMAIL_VERIF': "Email Verificata",
|
'EMAIL_VERIF': "Email Verificata",
|
||||||
'EMAIL_NON_VERIF': "Email Non Verificata\nleggi la tua casella email e trova **\"Confermare la Registrazione a Ayni\"**<br>e clicca sul bottone **\"Verifica Registrazione\"**",
|
'EMAIL_NON_VERIF': "Email Non Verificata\nleggi la tua casella email e trova **\"Confermare la Registrazione a Ayni\"**<br>e clicca sul bottone **\"Verifica Registrazione\"**",
|
||||||
@@ -80,6 +84,7 @@ textlang = {
|
|||||||
'ZOOM_PARTECIPATO': 'Partecipazione ad almeno 1 Conferenza (Zoom)',
|
'ZOOM_PARTECIPATO': 'Partecipazione ad almeno 1 Conferenza (Zoom)',
|
||||||
'SCRITTO_SOGNO': 'Hai scritto il tuo Sogno',
|
'SCRITTO_SOGNO': 'Hai scritto il tuo Sogno',
|
||||||
'INVITATI': 'persone registrate che hai invitato',
|
'INVITATI': 'persone registrate che hai invitato',
|
||||||
|
'NONREG': 'Invitati non Registrati',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -517,7 +522,7 @@ module.exports = {
|
|||||||
let query = [];
|
let query = [];
|
||||||
if (params.filter && params.fieldsearch) {
|
if (params.filter && params.fieldsearch) {
|
||||||
let myregexp = {};
|
let myregexp = {};
|
||||||
myregexp = new RegExp(params.filter.replace(' ', '|'), "ig");
|
myregexp = new RegExp(params.filter.trim().replace(' ', '|'), "ig");
|
||||||
|
|
||||||
const myfilters = [];
|
const myfilters = [];
|
||||||
params.fieldsearch.forEach((field) => {
|
params.fieldsearch.forEach((field) => {
|
||||||
@@ -530,6 +535,54 @@ module.exports = {
|
|||||||
{ $match: { $or: myfilters } },
|
{ $match: { $or: myfilters } },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let filtriadded = [];
|
||||||
|
|
||||||
|
// if (params.table === 'extralist') {
|
||||||
|
// if (params.filterand.includes(shared_consts.FILTER_EXTRALIST_DELETED))
|
||||||
|
// filtriadded.push({ deleted: true });
|
||||||
|
// else
|
||||||
|
// filtriadded.push({ deleted: { $exists: false } });
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (params.filterand) {
|
||||||
|
|
||||||
|
if (params.filterand.includes(shared_consts.FILTER_EXTRALIST_NOT_REGISTERED))
|
||||||
|
filtriadded.push({ registered: false });
|
||||||
|
|
||||||
|
if (params.filterand.includes(shared_consts.FILTER_EXTRALIST_NOT_CONTACTED)) {
|
||||||
|
filtriadded.push({ contacted: { $exists: false } });
|
||||||
|
}
|
||||||
|
if (params.filterand.includes(shared_consts.FILTER_EXTRALIST_WITH_NOTE))
|
||||||
|
filtriadded.push({
|
||||||
|
'note': { $exists: true },
|
||||||
|
"$expr": { "$gt": [{ "$strLenCP": "$note" }, 1] }
|
||||||
|
});
|
||||||
|
if (params.filterand.includes(shared_consts.FILTER_USER_NO_ZOOM))
|
||||||
|
filtriadded.push({ 'profile.saw_zoom_presentation': false });
|
||||||
|
if (params.filterand.includes(shared_consts.FILTER_USER_NO_INVITANTE))
|
||||||
|
filtriadded.push({
|
||||||
|
aportador_solidario: { $exists: false }
|
||||||
|
});
|
||||||
|
if (params.filterand.includes(shared_consts.FILTER_USER_NO_TELEGRAM_ID))
|
||||||
|
filtriadded.push({ 'profile.teleg_id': { $lt: 1 } });
|
||||||
|
if (params.filterand.includes(shared_consts.FILTER_USER_CODICE_AUTH_TELEGRAM))
|
||||||
|
filtriadded.push({ 'profile.teleg_checkcode': { $gt: 1 } });
|
||||||
|
if (params.filterand.includes(shared_consts.FILTER_USER_NO_EMAIL_VERIFICATA))
|
||||||
|
filtriadded.push({ verified_email: false });
|
||||||
|
if (params.filterand.includes(shared_consts.FILTER_USER_NO_DREAM))
|
||||||
|
filtriadded.push({
|
||||||
|
'profile.my_dream': {
|
||||||
|
$exists: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (filtriadded.length > 0)
|
||||||
|
query.push({ $match: { $and: filtriadded } });
|
||||||
|
|
||||||
if (idapp > 0) {
|
if (idapp > 0) {
|
||||||
query.push({ $match: { idapp } });
|
query.push({ $match: { idapp } });
|
||||||
}
|
}
|
||||||
@@ -837,10 +890,10 @@ module.exports = {
|
|||||||
return namesurname
|
return namesurname
|
||||||
},
|
},
|
||||||
|
|
||||||
getiPAddressUser (req) {
|
getiPAddressUser(req) {
|
||||||
try {
|
try {
|
||||||
const striniziale = '::ffff:';
|
const striniziale = '::ffff:';
|
||||||
if (req.ip.indexOf(striniziale) >= 0){
|
if (req.ip.indexOf(striniziale) >= 0) {
|
||||||
return req.ip.substring(striniziale.length)
|
return req.ip.substring(striniziale.length)
|
||||||
} else {
|
} else {
|
||||||
return req.ip; // Express
|
return req.ip; // Express
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
|
FILTER_EXTRALIST_NOT_REGISTERED: 1,
|
||||||
|
FILTER_EXTRALIST_NOT_CONTACTED: 2,
|
||||||
|
FILTER_EXTRALIST_WITH_NOTE: 4,
|
||||||
|
FILTER_USER_NO_ZOOM: 8,
|
||||||
|
FILTER_USER_NO_INVITANTE: 16,
|
||||||
|
FILTER_USER_NO_TELEGRAM_ID: 32,
|
||||||
|
FILTER_USER_CODICE_AUTH_TELEGRAM: 64,
|
||||||
|
FILTER_USER_NO_EMAIL_VERIFICATA: 128,
|
||||||
|
FILTER_USER_NO_DREAM: 256,
|
||||||
|
FILTER_EXTRALIST_DELETED: 512,
|
||||||
|
|
||||||
Permissions: {
|
Permissions: {
|
||||||
Admin: 1,
|
Admin: 1,
|
||||||
Manager: 2,
|
Manager: 2,
|
||||||
@@ -12,7 +23,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
fieldsUserToChange() {
|
fieldsUserToChange() {
|
||||||
return ['_id', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'date_temp_reg', 'verified_email', 'ipaddr', 'lasttimeonline', 'profile', 'calcstat', 'news_on', 'aportador_solidario', 'made_gift']
|
return ['_id', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'date_temp_reg', 'verified_email', 'ipaddr', 'lasttimeonline', 'profile', 'calcstat', 'news_on', 'aportador_solidario', 'made_gift', 'ind_order']
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user