Fix forms

This commit is contained in:
Matteo Gheza 2020-07-02 19:12:42 +02:00
parent a082447acf
commit 790685e7c4
3 changed files with 5 additions and 7 deletions

View File

@ -33,11 +33,9 @@ if($tools->validate_form_data('$post-mod', true, "add")) {
}
}
} else {
$length = 32;
//unset($_SESSION['token']);
//$_SESSION['token'] = substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $length) . "-bfwp64GGbdm";
// 1 hour = 60 seconds * 60 minutes = 3600
//$_SESSION['token-expire'] = time() + 3600;
if(isset($_GET["add"])||isset($_GET["modifica"])||isset($_GET["elimina"])||isset($_GET["mod"])){
$_SESSION["token"] = bin2hex(random_bytes(64));
}
$personale = $database->exec("SELECT * FROM `%PREFIX%_profiles` ORDER BY name ASC;", true); // Pesco i dati della table e li ordino in base al name
$modalità = (isset($_GET["add"])) ? "add" : ((isset($_GET["modifica"])) ? "modifica" : ((isset($_GET["elimina"])) ? "elimina" : "add"));
bdump($modalità, "modalità");

View File

@ -33,7 +33,7 @@ if($tools->validate_form_data('$post-mod', true, "add")) {
}
}
} else {
if(isset($_GET["mod"])){
if(isset($_GET["add"])||isset($_GET["modifica"])||isset($_GET["elimina"])||isset($_GET["mod"])){
$_SESSION["token"] = bin2hex(random_bytes(64));
}
$personale = $database->exec("SELECT * FROM `%PREFIX%_profiles` ORDER BY name ASC;", true); // Pesco i dati della table e li ordino in base al name

View File

@ -38,7 +38,7 @@ if($tools->validate_form_data('$post-mod', true, "add")) {
}
}
} else {
if(isset($_GET["mod"])){
if(isset($_GET["add"])||isset($_GET["modifica"])||isset($_GET["elimina"])||isset($_GET["mod"])){
$_SESSION["token"] = bin2hex(random_bytes(64));
}
$modalità = (isset($_GET["add"])) ? "add" : ((isset($_GET["modifica"])) ? "modifica" : ((isset($_GET["elimina"])) ? "elimina" : "add"));