-
Notifications
You must be signed in to change notification settings - Fork 0
Gestione autoparco #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| /public/images/intestazione_certificato.png | ||
| /public/images/intestazione_certificato.png | ||
|
|
||
| vendor/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Se fai un git pull origin master per tirare le ultime modifiche da master dentro il tuo branch, troverai che nell'ultima versione del .gitignore (dopo le mie modifiche) è presente la cartella .idea/ (generata automaticamente da PhpStorm), così che non venga accidentalmente inclusa automaticamente nei commit.
|
|
||
| require_once('../db-connessione-include.php'); | ||
|
|
||
| class Tipologia_veicolo{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ti suggerirei di usare una nomenclatura CamelCase per le classi, per consistenza con il resto del codice, i.e. TipologiaVeicolo. PhpStorm ti permette di rinominare facilmente una classe, andando a cambiare tutte le occorrenze del nome automaticamente per te (click destro > refactor > rename).
| } | ||
|
|
||
| return null; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XmlHttpObject e' davvero vecchio e deprecato. Tutto il tuo codice in questo file puo' essere sostituito con una versione equivalente, ma piu' moderna e breve, come segue:
async function showResult(str, num) {
var risposta = await fetch(`livesearch-autoparco-tipologie.php?q=${str}&num=${num}`);
var html = await risposta.text();
document.getElementById("livesearch").innerHTML = html;
}| include '../db-connessione-include.php'; | ||
| include 'maledetti-apici-centro-include.php'; //ATTIVA O DISATTIVA IL MAGIC QUOTE PER GLI APICI | ||
|
|
||
| function __autoload ($class_name) { //funzione predefinita che si occupa di caricare dinamicamente tutti gli oggetti esterni quando vengono richiamati |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fai git pull origin master per tirarti le ultime modifiche che sono già in master, e rimuovi poi del tutto la funzione __autoload (righe 12-14), perché non è più necessaria e rompe tutto il nuovo codice, come @biagiosaitta ha già sperimentato (AWS).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tieni presente che il file db-connessione-include.php si chiama ora core.php (perché non contiene solamente roba relativa al database). Dopo aver tirato le ultime modifiche, dovrai cambiare tutte le occorrenze da
include '../db-connessione-include.php';a
include '../core.php';| $ogg = $_GET['q']; | ||
| $num = $_GET['num']; | ||
|
|
||
| $query = $connessione->query("SELECT * FROM aut_tipologie WHERE descrizione LIKE '%$ogg%' ORDER BY descrizione ASC LIMIT $num"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questo codice è vulnerabile ad attacchi di tipo SQL injection.
Non usare mai variabili direttamente in una query. Piuttosto, usa sempre i prepared statements di PDO, come segue:
$query = $connessione->prepare("SELECT * FROM aut_tipologie WHERE descrizione LIKE :descrizione ORDER BY descrizione ASC LIMIT :num");
$query->bindValue(":descrizione", "%" . $ogg . "%");
$query->bindValue(":num", $num, PDO::PARAM_INT);
$query->execute();Inserimento ruoli Op CO e Resp CO, creazione pagina di gestione volontari autorizzati
…, creazione pulsante aggiunta autorizzati
Implementazione dell'autoparco: