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
if($_SERVER['REQUEST_TYPE'] == 'POST')
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
if(isset($_POST['remove'])) {
include '../app/FormValidator.php';
include 'app/FormValidator.php';
$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}/')
));

View File

@ -1,8 +1,8 @@
<?php
if($_SERVER['REQUEST_TYPE'] == 'POST')
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
if(isset($_POST['leave'])) {
include '../app/FormValidator.php';
include 'app/FormValidator.php';
$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}/')
));

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->execute();
if($_SERVER['REQUEST_TYPE'] == 'POST') {
include '../app/FormValidator.php';
if($_SERVER['REQUEST_METHOD'] == 'POST') {
include 'app/FormValidator.php';
if(isset($_POST['enableIdent'])) {
$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}/')

View File

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

View File

@ -11,8 +11,8 @@
die();
}
if($_SERVER['REQUEST_TYPE'] == 'POST') {
include '../app/FormValidator.php';
if($_SERVER['REQUEST_METHOD'] == 'POST') {
include 'app/FormValidator.php';
if(isset($_POST['genpw'])) {
$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}/')