diff --git "a/\t\n/Users/suryapaolo/myproject/newfreeplanet/public/upload/pages/home/raduno.jpg" "b/\t\n/Users/suryapaolo/myproject/newfreeplanet/public/upload/pages/home/raduno.jpg" new file mode 100644 index 0000000..2a576c1 Binary files /dev/null and "b/\t\n/Users/suryapaolo/myproject/newfreeplanet/public/upload/pages/home/raduno.jpg" differ diff --git "a/\t\n/Users/suryapaolo/myproject/newfreeplanet/public/upload/pages/home/sm_raduno.jpg" "b/\t\n/Users/suryapaolo/myproject/newfreeplanet/public/upload/pages/home/sm_raduno.jpg" new file mode 100644 index 0000000..0c8ae9b Binary files /dev/null and "b/\t\n/Users/suryapaolo/myproject/newfreeplanet/public/upload/pages/home/sm_raduno.jpg" differ diff --git a/emails/admin/registration/it/html.pug b/emails/admin/registration/it/html.pug index 71d941a..727a1a2 100755 --- a/emails/admin/registration/it/html.pug +++ b/emails/admin/registration/it/html.pug @@ -14,6 +14,8 @@ span Cellulare:  strong #{user.profile.intcode_cell} #{user.profile.cell}
span Nazionalità:  strong #{user.profile.nationality}
+span Gruppo:  + strong #{idMyGroup}
p
Saluti style(type="text/css"). diff --git a/emails/registration/it/html.pug b/emails/registration/it/html.pug index 6304c9d..538e1ee 100755 --- a/emails/registration/it/html.pug +++ b/emails/registration/it/html.pug @@ -6,7 +6,7 @@ span hai dimenticato la Password? :  strong Trovala qui
span Email:  strong #{emailto}
-p Per confermare la registrazione clicca sul bottone, oppure CLICCA QUI +p Per confermare la registrazione clicca sul bottone, oppure su questo link: #{strlinkreg} div.divbtn button.btn.btn-lg Verifica Registrazione diff --git a/src/server/router/index_router.js b/src/server/router/index_router.js index 256946b..4336509 100755 --- a/src/server/router/index_router.js +++ b/src/server/router/index_router.js @@ -658,11 +658,15 @@ router.post('/setsubrec', authenticate, (req, res) => { }); -router.post('/gettable', authenticate, (req, res) => { +router.post('/gettable', authenticate_noerror, (req, res) => { let params = req.body; params.table = sanitizeHtml(params.table); + if (!shared_consts.TABLES_ENABLE_GETTABLE_FOR_NOT_LOGGED.includes(params.table) && !req.user) { + return res.status(403).send({}); + } + let idapp = req.user ? req.user.idapp : sanitizeHtml(params.idapp); const mytable = globalTables.getTableByTableName(params.table); //console.log('mytable', mytable); @@ -1909,15 +1913,19 @@ function uploadFile(req, res, version) { if (!tools.sulServer()) { + // Se faccio eseguire questo in Locale, lui mi fa l'aggiornamento della pagina, quindi poi non posso salvare! + // allora mi conviene che lo faccio dopo, manualmente. + console.log('Dovresti copiare fromfile', fromfile, 'tofile', tofile); - await tools.execScriptNoOutput('sudo cp -R ' + fromfile + ' ' + tofile) + 'sudo cp -R ' + fromfile + ' ' + tofile + // await tools.execScriptNoOutput('sudo cp -R ' + fromfile + ' ' + tofile) res.end(); return; } // Move in the folder application ! - tools.move(fromfile, tofile, (err) => { + await tools.move(fromfile, tofile, (err) => { if (err) { console.log('err uploadDir:', err); res.status(400).send(); diff --git a/src/server/router/users_router.js b/src/server/router/users_router.js index 39e3e32..b336379 100755 --- a/src/server/router/users_router.js +++ b/src/server/router/users_router.js @@ -117,7 +117,7 @@ router.post('/', async (req, res) => { if (!tools.isAlphaNumericAndSpecialCharacter(body.username) || body.email.length < 6 || - body.username.length < 5 || body.password.length < 5) { + body.username.length < 4 || body.password.length < 5) { await tools.snooze(5000); console.log('Username non valido in Registrazione: ' + body.username); res.status(400). diff --git a/src/server/sendemail.js b/src/server/sendemail.js index 29791ef..d1428ac 100755 --- a/src/server/sendemail.js +++ b/src/server/sendemail.js @@ -741,6 +741,7 @@ module.exports = { mylocalsconf.name = user.name; mylocalsconf.surname = user.surname; mylocalsconf.aportador_solidario = user.aportador_solidario ? user.aportador_solidario : ''; + mylocalsconf.idMyGroup = user.idMyGroup; mylocalsconf.emailto = user.email; mylocalsconf.hashemail = tools.getHash(user.email); mylocalsconf.user = user; diff --git a/src/server/tools/general.js b/src/server/tools/general.js index 9ddf00e..e6a41a1 100755 --- a/src/server/tools/general.js +++ b/src/server/tools/general.js @@ -3877,36 +3877,45 @@ module.exports = { this.writelogfile(mystr, FILENAVE); }, - move(oldPath, newPath, callback) { - - fs.rename(oldPath, newPath, function (err) { - if (err) { - if (err.code === 'EXDEV') { - copy(); - } else { - callback(err); - } - return; + async move(oldPath, newPath, callback) { + try { + const ris = await fs.promises.rename(oldPath, newPath); + console.log('... File Rinominato:', oldPath, 'in:', newPath, 'ris', ris); + callback(); // Chiamare il callback senza errori + } catch (err) { + if (err.code === 'EXDEV') { + await copy(); // Se EXDEV, utilizza la funzione copy } else { - console.log(' ... File Rinominato', oldPath, 'in:', newPath); + console.error('Errore durante lo spostamento:', err); + callback(err); // Passa l'errore al callback } + } - callback(); - }); - - function copy() { + async function copy() { const readStream = fs.createReadStream(oldPath); const writeStream = fs.createWriteStream(newPath); - readStream.on('error', callback); - writeStream.on('error', callback); - - readStream.on('close', function () { - console.log('cancella file già copiato', oldPath); - fs.unlink(oldPath, callback); + readStream.on('error', (err) => { + console.error('Errore nella lettura del file:', err); + callback(err); // Passa l'errore al callback + }); + writeStream.on('error', (err) => { + console.error('Errore nella scrittura del file:', err); + callback(err); // Passa l'errore al callback }); readStream.pipe(writeStream); + + writeStream.on('finish', async () => { + console.log('File copiato, ora rimuovo il file di origine:', oldPath); + try { + await fs.promises.unlink(oldPath); // Rimuovi il file originale + callback(); // Chiama il callback al termine + } catch (err) { + console.error('Errore nella rimozione del file originale:', err); + callback(err); // Passa l'errore al callback + } + }); } }, diff --git a/src/server/tools/shared_nodejs.js b/src/server/tools/shared_nodejs.js index d2354e4..842962d 100755 --- a/src/server/tools/shared_nodejs.js +++ b/src/server/tools/shared_nodejs.js @@ -203,6 +203,7 @@ module.exports = { TABLES_GROUPS_NOTIFICATION: ['mygroups'], TABLES_CIRCUITS_NOTIFICATION: ['circuits'], + TABLES_ENABLE_GETTABLE_FOR_NOT_LOGGED: ['attivitas'], TABLES_NUM_AS_ID_NUMBER: [], diff --git a/src/server/version.txt b/src/server/version.txt index 4ded4f9..633e893 100644 --- a/src/server/version.txt +++ b/src/server/version.txt @@ -1 +1 @@ -1.0.58 \ No newline at end of file +1.0.60 \ No newline at end of file