- aggiornato l'Editor HTML

This commit is contained in:
Surya Paolo
2024-09-13 19:42:48 +02:00
parent f25e1f3992
commit dcc2a0ec08
10 changed files with 48 additions and 27 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@@ -14,6 +14,8 @@ span Cellulare: 
strong #{user.profile.intcode_cell} #{user.profile.cell}<br> strong #{user.profile.intcode_cell} #{user.profile.cell}<br>
span Nazionalità:&nbsp; span Nazionalità:&nbsp;
strong #{user.profile.nationality}<br> strong #{user.profile.nationality}<br>
span Gruppo:&nbsp;
strong #{idMyGroup}<br>
p <br>Saluti p <br>Saluti
style(type="text/css"). style(type="text/css").

View File

@@ -6,7 +6,7 @@ span hai dimenticato la Password? :&nbsp;
strong <a href=#{forgetpwd} target="_blank">Trovala qui</a><br> strong <a href=#{forgetpwd} target="_blank">Trovala qui</a><br>
span Email:&nbsp; span Email:&nbsp;
strong #{emailto}<br> strong #{emailto}<br>
p Per confermare la registrazione clicca sul bottone, oppure <a href=#{strlinkreg} target="_blank">CLICCA QUI</a> p Per confermare la registrazione clicca sul bottone, oppure su questo link: #{strlinkreg}
div.divbtn <a href=#{strlinkreg} target="_blank"> div.divbtn <a href=#{strlinkreg} target="_blank">
button.btn.btn-lg Verifica Registrazione</a> button.btn.btn-lg Verifica Registrazione</a>

View File

@@ -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; let params = req.body;
params.table = sanitizeHtml(params.table); 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); let idapp = req.user ? req.user.idapp : sanitizeHtml(params.idapp);
const mytable = globalTables.getTableByTableName(params.table); const mytable = globalTables.getTableByTableName(params.table);
//console.log('mytable', mytable); //console.log('mytable', mytable);
@@ -1909,15 +1913,19 @@ function uploadFile(req, res, version) {
if (!tools.sulServer()) { 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); 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(); res.end();
return; return;
} }
// Move in the folder application ! // Move in the folder application !
tools.move(fromfile, tofile, (err) => { await tools.move(fromfile, tofile, (err) => {
if (err) { if (err) {
console.log('err uploadDir:', err); console.log('err uploadDir:', err);
res.status(400).send(); res.status(400).send();

View File

@@ -117,7 +117,7 @@ router.post('/', async (req, res) => {
if (!tools.isAlphaNumericAndSpecialCharacter(body.username) || if (!tools.isAlphaNumericAndSpecialCharacter(body.username) ||
body.email.length < 6 || body.email.length < 6 ||
body.username.length < 5 || body.password.length < 5) { body.username.length < 4 || body.password.length < 5) {
await tools.snooze(5000); await tools.snooze(5000);
console.log('Username non valido in Registrazione: ' + body.username); console.log('Username non valido in Registrazione: ' + body.username);
res.status(400). res.status(400).

View File

@@ -741,6 +741,7 @@ module.exports = {
mylocalsconf.name = user.name; mylocalsconf.name = user.name;
mylocalsconf.surname = user.surname; mylocalsconf.surname = user.surname;
mylocalsconf.aportador_solidario = user.aportador_solidario ? user.aportador_solidario : ''; mylocalsconf.aportador_solidario = user.aportador_solidario ? user.aportador_solidario : '';
mylocalsconf.idMyGroup = user.idMyGroup;
mylocalsconf.emailto = user.email; mylocalsconf.emailto = user.email;
mylocalsconf.hashemail = tools.getHash(user.email); mylocalsconf.hashemail = tools.getHash(user.email);
mylocalsconf.user = user; mylocalsconf.user = user;

View File

@@ -3877,36 +3877,45 @@ module.exports = {
this.writelogfile(mystr, FILENAVE); this.writelogfile(mystr, FILENAVE);
}, },
move(oldPath, newPath, callback) { async move(oldPath, newPath, callback) {
try {
fs.rename(oldPath, newPath, function (err) { const ris = await fs.promises.rename(oldPath, newPath);
if (err) { console.log('... File Rinominato:', oldPath, 'in:', newPath, 'ris', ris);
if (err.code === 'EXDEV') { callback(); // Chiamare il callback senza errori
copy(); } catch (err) {
} else { if (err.code === 'EXDEV') {
callback(err); await copy(); // Se EXDEV, utilizza la funzione copy
}
return;
} else { } else {
console.log(' ... File Rinominato', oldPath, 'in:', newPath); console.error('Errore durante lo spostamento:', err);
callback(err); // Passa l'errore al callback
} }
}
callback(); async function copy() {
});
function copy() {
const readStream = fs.createReadStream(oldPath); const readStream = fs.createReadStream(oldPath);
const writeStream = fs.createWriteStream(newPath); const writeStream = fs.createWriteStream(newPath);
readStream.on('error', callback); readStream.on('error', (err) => {
writeStream.on('error', callback); console.error('Errore nella lettura del file:', err);
callback(err); // Passa l'errore al callback
readStream.on('close', function () { });
console.log('cancella file già copiato', oldPath); writeStream.on('error', (err) => {
fs.unlink(oldPath, callback); console.error('Errore nella scrittura del file:', err);
callback(err); // Passa l'errore al callback
}); });
readStream.pipe(writeStream); 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
}
});
} }
}, },

View File

@@ -203,6 +203,7 @@ module.exports = {
TABLES_GROUPS_NOTIFICATION: ['mygroups'], TABLES_GROUPS_NOTIFICATION: ['mygroups'],
TABLES_CIRCUITS_NOTIFICATION: ['circuits'], TABLES_CIRCUITS_NOTIFICATION: ['circuits'],
TABLES_ENABLE_GETTABLE_FOR_NOT_LOGGED: ['attivitas'],
TABLES_NUM_AS_ID_NUMBER: [], TABLES_NUM_AS_ID_NUMBER: [],

View File

@@ -1 +1 @@
1.0.58 1.0.60