Registrazione: scegliere se Telegram o Email

This commit is contained in:
Surya Paolo
2022-12-12 18:25:13 +01:00
parent 1d7a98fc3f
commit 71e49c31c3
5 changed files with 73 additions and 17 deletions

View File

@@ -278,6 +278,10 @@ router.post('/settable', authenticate, async (req, res) => {
mydata.idapp = req.user.idapp;
const idapp = mydata.idapp;
if (req.user && req.user.username) {
User.setOnLine(req.user.idapp, req.user.username);
}
let consentito = false;
try {
@@ -564,6 +568,10 @@ router.post('/gettable', authenticate, (req, res) => {
try {
if (req.user && req.user.username) {
User.setOnLine(req.user.idapp, req.user.username);
}
return mytable.executeQueryTable(idapp, params, req.user).then(ris => {
return res.send(ris);

View File

@@ -31,6 +31,10 @@ router.post('/', authenticate, (req, res) => {
tools.mylog('crea SendMsg');
const myrecmsg = new SendMsg(body);
if (req.user && req.user.username) {
User.setOnLine(req.user.idapp, req.user.username);
}
const check = tools.checkUserOk(myrecmsg.origin.username, req.user.username, res);
if (check.exit) return check.ret;
@@ -74,6 +78,10 @@ router.get('/:username/:lastdataread/:idapp', authenticate, (req, res) => {
const idapp = req.params.idapp;
// var category = req.params.category;
if (req.user && req.user.username) {
User.setOnLine(req.user.idapp, req.user.username);
}
if (req.user.idapp !== idapp) {
// I'm trying to get something not mine!
return res.status(404).send({ code: server_constants.RIS_CODE_NOT_MY_USERNAME });

View File

@@ -48,6 +48,7 @@ router.post('/load', async (req, res) => {
reg_weekly: await User.calcRegWeekly(idapp),
lastsreg: await User.getLastUsers(idapp),
lastsonline: await User.getLastOnlineUsers(idapp),
lastssharedlink: await User.getLastSharedLink(idapp),
diffusorilist: await User.getDiffusoriUsers(idapp),
checkuser: await User.checkUser(idapp, username),
// navi_partite: await Nave.getNaviPartite(idapp),

View File

@@ -248,7 +248,7 @@ router.post('/', async (req, res) => {
user.aportador_solidario = await User.getRealUsernameByUsername(user.idapp, user.aportador_solidario);
}
/*if (!id_aportador && tools.getAskToVerifyReg(body.idapp)) {
if (!id_aportador && tools.getAskToVerifyReg(body.idapp)) {
// Si sta tentando di registrare una persona sotto che non corrisponde!
let msg = 'Il link di registrazione non sembra risultare valido.<br>invitante: ' +
user.aportador_solidario + '<br>username: ' + user.username;
@@ -260,7 +260,7 @@ router.post('/', async (req, res) => {
msg: '',
});
return 1;
}*/
}
if (utentenonancoraVerificato) {
if (id_aportador) {