Aggiornamento Ore
This commit is contained in:
@@ -94,15 +94,17 @@ router.post('/', async (req, res) => {
|
||||
// Controlla se anche l'ultimo record era dallo stesso IP:
|
||||
const lastrec = await User.getLastRec(body.idapp);
|
||||
if (!!lastrec) {
|
||||
if (lastrec.ipaddr === user.ipaddr) {
|
||||
// Se l'ha fatto troppo ravvicinato
|
||||
if (lastrec.date_reg) {
|
||||
let ris = tools.isdiffSecDateLess(lastrec.date_reg, 120);
|
||||
if (ris) {
|
||||
tools.writeIPToBan(user.ipaddr + ': [' + user.username + '] ' + user.name + ' ' + user.surname);
|
||||
await tools.snooze(10000);
|
||||
res.status(400).send({ code: server_constants.RIS_CODE_BANIP, msg: '' });
|
||||
return 1;
|
||||
if (process.env.LOCALE !== "1") {
|
||||
if (lastrec.ipaddr === user.ipaddr) {
|
||||
// Se l'ha fatto troppo ravvicinato
|
||||
if (lastrec.date_reg) {
|
||||
let ris = tools.isdiffSecDateLess(lastrec.date_reg, 120);
|
||||
if (ris) {
|
||||
tools.writeIPToBan(user.ipaddr + ': [' + user.username + '] ' + user.name + ' ' + user.surname);
|
||||
await tools.snooze(10000);
|
||||
res.status(400).send({ code: server_constants.RIS_CODE_BANIP, msg: '' });
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -279,9 +281,9 @@ router.post('/', async (req, res) => {
|
||||
// Invia un'email all'utente
|
||||
// tools.mylog('process.env.TESTING_ON', process.env.TESTING_ON);
|
||||
console.log('res.locale', res.locale);
|
||||
if (!tools.testing()) {
|
||||
// if (!tools.testing()) {
|
||||
await sendemail.sendEmail_Registration(user.lang, user.email, user, user.idapp, user.linkreg);
|
||||
}
|
||||
// }
|
||||
res.header('x-auth', token).send(user);
|
||||
return true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user