ver 1.0.19
This commit is contained in:
@@ -2,6 +2,8 @@ const tools = require('../tools/general');
|
||||
|
||||
// still in app.js
|
||||
const node_env = process.env.NODE_ENV || 'production';
|
||||
console.log('node_env=', node_env);
|
||||
|
||||
var file = `.env.${node_env}`;
|
||||
|
||||
|
||||
@@ -18,7 +20,10 @@ require('dotenv').config({ path: file });
|
||||
|
||||
process.env.DATABASE = process.env.DATABASE || 'FreePlanet';
|
||||
|
||||
console.log('process.env.DOMAIN:', process.env.DOMAIN);
|
||||
process.env.MONGODB_URI = process.env.DOMAIN + process.env.DATABASE;
|
||||
console.log('process.env.MONGODB_URI:', process.env.MONGODB_URI);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"✅ You have accepted %s' Friendship request!": "✅ Hai accettato la richiesta di Amicizia di %s !",
|
||||
"HANDSHAKE_SET": "<strong>%s</strong> ha comunicato che ti conosce personalmente e ha fiducia in te.",
|
||||
"HANDSHAKE_CONFIRMED": "🤝 Hai contraccambiato la fiducia in <strong>%s</strong>!",
|
||||
"HANDSHAKE_ACCEPTED": "🤝 <strong>%s</strong> ha contraccambiato la fiducia in te !",
|
||||
"HANDSHAKE_ACCEPTED": "🤝 <strong>%s</strong> ha contraccambiato la stretta di mano (fiducia) !",
|
||||
"GROUPS_ACCEPTED": "✅ Sei stato accettato a far parte del Gruppo %s (da parte di %s)",
|
||||
"GROUPS_REFUSED": "❌ Ti è stato rifiutato l'accesso da %s a far parte del Gruppo %s. Se pensi sia un'errore, contatta l'amministratore del Gruppo.",
|
||||
"GROUPS_REMOVED": "❌ l'utente %s è stato rimosso del Gruppo %s (da parte di %s)",
|
||||
|
||||
@@ -232,7 +232,7 @@ module.exports.findAllIdApp = async function (idapp) {
|
||||
rec.email_pwd = '';
|
||||
rec.telegram_key = '';
|
||||
rec.telegram_key_test = '';
|
||||
rec.confsite = {};
|
||||
// rec.confsite = {};
|
||||
|
||||
return rec;
|
||||
}
|
||||
|
||||
@@ -2158,8 +2158,14 @@ UserSchema.statics.setFriendsCmd = async function (req, idapp, usernameOrig, use
|
||||
if (!disablenotif) {
|
||||
const userDest = await User.getRecLangAndIdByUsername(idapp, usernameDest);
|
||||
const user = await User.getRecLangAndIdByUsername(idapp, usernameOrig);
|
||||
const already_stretta = await User.isMyHandShake(idapp, usernameDest, usernameOrig);
|
||||
const msgDest = i18n.__({ phrase: 'HANDSHAKE_CONFIRMED', locale: userDest.lang }, usernameDest);
|
||||
const msgOrig = i18n.__({ phrase: 'HANDSHAKE_ACCEPTED', locale: user.lang }, usernameOrig);
|
||||
let phrase = 'HANDSHAKE_SET';
|
||||
if (already_stretta) {
|
||||
phrase = 'HANDSHAKE_ACCEPTED';
|
||||
}
|
||||
|
||||
const msgOrig = i18n.__({ phrase, locale: user.lang }, usernameOrig);
|
||||
|
||||
await telegrambot.sendMsgTelegram(idapp, usernameOrig, msgDest);
|
||||
await telegrambot.sendMsgTelegram(idapp, usernameDest, msgOrig);
|
||||
@@ -3953,7 +3959,7 @@ UserSchema.statics.getUsersDreams = async function (idapp) {
|
||||
UserSchema.statics.getLastUsers = async function (idapp) {
|
||||
const User = this;
|
||||
|
||||
const lastn = await Settings.getValDbSettings(idapp, 'SHOW_LAST_N_USERS', 5);
|
||||
const lastn = await Settings.getValDbSettings(idapp, 'SHOW_LAST_N_USERS', 10);
|
||||
|
||||
return await User.find(
|
||||
{
|
||||
@@ -3981,7 +3987,7 @@ UserSchema.statics.getLastUsers = async function (idapp) {
|
||||
UserSchema.statics.getLastOnlineUsers = async function (idapp) {
|
||||
const User = this;
|
||||
|
||||
const lastn = await Settings.getValDbSettings(idapp, 'SHOW_LAST_ONLINE_USERS', 10);
|
||||
const lastn = await Settings.getValDbSettings(idapp, 'SHOW_LAST_ONLINE_USERS', 20);
|
||||
|
||||
return await User.find(
|
||||
{
|
||||
@@ -4523,7 +4529,7 @@ UserSchema.statics.calcnumRegUntilDay = async function (idapp) {
|
||||
UserSchema.statics.calcRegDaily = async function (idapp) {
|
||||
const User = this;
|
||||
|
||||
return await User.aggregate(User.getUsersRegDaily(idapp, 60)).then(ris => {
|
||||
return await User.aggregate(User.getUsersRegDaily(idapp, 90)).then(ris => {
|
||||
// console.table(ris);
|
||||
return ris;
|
||||
});
|
||||
|
||||
@@ -614,7 +614,7 @@ router.post('/gettable', authenticate, (req, res) => {
|
||||
const params = req.body;
|
||||
let idapp = req.user ? req.user.idapp : params.idapp;
|
||||
const mytable = globalTables.getTableByTableName(params.table);
|
||||
// console.log('mytable', mytable);
|
||||
//console.log('mytable', mytable);
|
||||
if (!mytable) {
|
||||
console.log(`Table ${params.table} not found`);
|
||||
return res.status(400).send({});
|
||||
@@ -628,6 +628,7 @@ router.post('/gettable', authenticate, (req, res) => {
|
||||
|
||||
|
||||
return mytable.executeQueryTable(idapp, params, req.user).then(ris => {
|
||||
// console.log('ris=', ris);
|
||||
return res.send(ris);
|
||||
|
||||
}).catch((e) => {
|
||||
|
||||
@@ -3,8 +3,8 @@ const tools = require('../tools/general');
|
||||
const appTelegram = [tools.FREEPLANET, tools.RISO];
|
||||
|
||||
const appTelegram_TEST = [tools.FREEPLANET, tools.RISO];
|
||||
// const appTelegram_DEVELOP = [tools.RISO];
|
||||
const appTelegram_DEVELOP = [tools.FIOREDELLAVITA];
|
||||
const appTelegram_DEVELOP = [tools.RISO];
|
||||
// const appTelegram_DEVELOP = [tools.FIOREDELLAVITA];
|
||||
|
||||
const appTelegramFinti = ['2', tools.CNM];
|
||||
const appTelegramDest = [tools.FREEPLANET, tools.FREEPLANET];
|
||||
|
||||
@@ -2941,8 +2941,9 @@ module.exports = {
|
||||
);
|
||||
|
||||
if (this.testing()) {
|
||||
// console.log('query', query);
|
||||
console.log('query', query);
|
||||
}
|
||||
// console.log('query', query);
|
||||
|
||||
return query;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user