Aggiungere Sito internet anche ai gruppi

Pare che quando creo un gruppo compaia il mio username tra gli amministratori !
Il filtro per Categoria in Servizi non filtra bene !
This commit is contained in:
paoloar77
2022-02-28 00:07:47 +01:00
parent 8d98726f1f
commit 12d2eff24a
5 changed files with 12 additions and 16 deletions

View File

@@ -117,6 +117,7 @@ module.exports.executeQueryTable = async function (idapp, params, userreq) {
return await Site.findOne({idapp: extrapar}, {name: 1, manageremail: 1, confsite: 1}).lean(); return await Site.findOne({idapp: extrapar}, {name: 1, manageremail: 1, confsite: 1}).lean();
} }
if (User.isAdmin(userreq.perm)) { if (User.isAdmin(userreq.perm)) {
const myarr = await Site.find({}); const myarr = await Site.find({});

View File

@@ -281,21 +281,14 @@ router.post('/settable', authenticate, (req, res) => {
if (shared_consts.TABLES_USER_INCLUDE_MY.includes(params.table)) { if (shared_consts.TABLES_USER_INCLUDE_MY.includes(params.table)) {
if (!mydata.admins) { if (!mydata.admins) {
// Aggiungi solo se non esistono Admin:
mydata.admins = []; mydata.admins = [];
} else { const indfind = mydata.admins.findIndex(
/*const arrnew = []; (rec) => (rec.username === req.user.username));
for (const username of mydata.admins) {
arrnew.push({username}); if (indfind < 0) {
mydata.admins.push({username: req.user.username});
} }
mydata.admins = arrnew;
*/
}
const indfind = mydata.admins.findIndex(
(rec) => (rec.username === req.user.username));
if (indfind < 0) {
mydata.admins.push({username: req.user.username});
} }
} }
@@ -584,6 +577,7 @@ router.patch('/chval', authenticate, async (req, res) => {
} }
await mytable.findByIdAndUpdate(id, {$set: fieldsvalue}).then(async (rec) => { await mytable.findByIdAndUpdate(id, {$set: fieldsvalue}).then(async (rec) => {
// tools.mylogshow(' REC TO MODIFY: ', rec); // tools.mylogshow(' REC TO MODIFY: ', rec);
if (!rec) { if (!rec) {

View File

@@ -431,7 +431,7 @@ async function faitest() {
// const $vers = tools.getVersionint('1.92.45'); // const $vers = tools.getVersionint('1.92.45');
if (true){ if (false){
const prova = tools.getConfSiteOptionEnabledByIdApp('13', shared_consts.ConfSite.Notif_Reg_Push_Admin) const prova = tools.getConfSiteOptionEnabledByIdApp('13', shared_consts.ConfSite.Notif_Reg_Push_Admin)
console.log('prova', prova); console.log('prova', prova);
} }

View File

@@ -731,7 +731,7 @@ module.exports = {
let text = ''; let text = '';
if (phase === this.phase.REGISTRATION) { if (phase === this.phase.REGISTRATION) {
if (tools.getConfSiteOptionEnabledByIdApp(mylocalsconf.idapp, shared_consts.ConfSite.Notif_Reg_Bot)) { if (tools.getConfSiteOptionEnabledByIdApp(mylocalsconf.idapp, shared_consts.ConfSite.Notif_Reg_Bot_ToManagers)) {
if (userdest) { if (userdest) {
NameFrom = await User.getNameSurnameByUsername(mylocalsconf.idapp, NameFrom = await User.getNameSurnameByUsername(mylocalsconf.idapp,
userdest, true) + aportador; userdest, true) + aportador;

View File

@@ -233,8 +233,9 @@ module.exports = {
CANCELED: 10, CANCELED: 10,
}, },
ConfSite: { ConfSite: {
Notif_Reg_Bot: 1, Notif_Reg_Bot_ToManagers: 1,
Notif_Reg_Push_Admin: 2, Notif_Reg_Push_Admin: 2,
Need_Aportador_On_DataReg_To_Verify_Reg: 4, Need_Aportador_On_DataReg_To_Verify_Reg: 4,
}, },