1
0
Fork 0

Fix POST request handling in dashboard forms

master
Anonymous Contributor 2023-08-23 18:16:35 +02:00
parent 1df2182bae
commit e192d3fd04
5 changed files with 10 additions and 10 deletions

View File

@ -1,8 +1,8 @@
<?php <?php
if($_SERVER['REQUEST_TYPE'] == 'POST') if($_SERVER['REQUEST_METHOD'] == 'POST')
{ {
if(isset($_POST['remove'])) { if(isset($_POST['remove'])) {
include '../app/FormValidator.php'; include 'app/FormValidator.php';
$validator = new FormValidator(array( $validator = new FormValidator(array(
'uuid' => array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/') 'uuid' => array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/')
)); ));

View File

@ -1,8 +1,8 @@
<?php <?php
if($_SERVER['REQUEST_TYPE'] == 'POST') if($_SERVER['REQUEST_METHOD'] == 'POST')
{ {
if(isset($_POST['leave'])) { if(isset($_POST['leave'])) {
include '../app/FormValidator.php'; include 'app/FormValidator.php';
$validator = new FormValidator(array( $validator = new FormValidator(array(
'group' => array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/') 'group' => array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/')
)); ));

View File

@ -2,8 +2,8 @@
$statementCreateTable = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `UserIdentitys` (`PrincipalID` VARCHAR(38) NOT NULL, `IdentityID` VARCHAR(38) NOT NULL, PRIMARY KEY (`IdentityID`))"); $statementCreateTable = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `UserIdentitys` (`PrincipalID` VARCHAR(38) NOT NULL, `IdentityID` VARCHAR(38) NOT NULL, PRIMARY KEY (`IdentityID`))");
$statementCreateTable->execute(); $statementCreateTable->execute();
if($_SERVER['REQUEST_TYPE'] == 'POST') { if($_SERVER['REQUEST_METHOD'] == 'POST') {
include '../app/FormValidator.php'; include 'app/FormValidator.php';
if(isset($_POST['enableIdent'])) { if(isset($_POST['enableIdent'])) {
$validator = new FormValidator(array( $validator = new FormValidator(array(
'newuuid' => array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/') 'newuuid' => array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/')

View File

@ -1,11 +1,11 @@
<?php <?php
if($_SERVER['REQUEST_TYPE'] == 'POST') { if($_SERVER['REQUEST_METHOD'] == 'POST') {
if(!isset($_SESSION['LOGIN']) || !isset($_SESSION['UUID'])) { if(!isset($_SESSION['LOGIN']) || !isset($_SESSION['UUID'])) {
header('Location: index.php'); header('Location: index.php');
die(); die();
} }
include '../app/FormValidator.php'; include 'app/FormValidator.php';
$validator = new FormValidator(array( $validator = new FormValidator(array(
'oldPassword' => array('required' => true, 'regex' => '.{1,1000}'), 'oldPassword' => array('required' => true, 'regex' => '.{1,1000}'),
'newPassword' => array('required' => true, 'regex' => '.{1,1000}'), 'newPassword' => array('required' => true, 'regex' => '.{1,1000}'),

View File

@ -11,8 +11,8 @@
die(); die();
} }
if($_SERVER['REQUEST_TYPE'] == 'POST') { if($_SERVER['REQUEST_METHOD'] == 'POST') {
include '../app/FormValidator.php'; include 'app/FormValidator.php';
if(isset($_POST['genpw'])) { if(isset($_POST['genpw'])) {
$validator = new FormValidator(array( $validator = new FormValidator(array(
'userid' => array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/') 'userid' => array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/')