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:
@@ -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({});
|
||||||
|
|
||||||
|
|||||||
@@ -281,16 +281,8 @@ 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 arrnew = [];
|
|
||||||
for (const username of mydata.admins) {
|
|
||||||
arrnew.push({username});
|
|
||||||
}
|
|
||||||
mydata.admins = arrnew;
|
|
||||||
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
const indfind = mydata.admins.findIndex(
|
const indfind = mydata.admins.findIndex(
|
||||||
(rec) => (rec.username === req.user.username));
|
(rec) => (rec.username === req.user.username));
|
||||||
|
|
||||||
@@ -298,6 +290,7 @@ router.post('/settable', authenticate, (req, res) => {
|
|||||||
mydata.admins.push({username: req.user.username});
|
mydata.admins.push({username: req.user.username});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delete mydata['__v'];
|
delete mydata['__v'];
|
||||||
delete mydata['__proto__'];
|
delete mydata['__proto__'];
|
||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user