Überarbeitete Version der 1. Version. Es bestehen noch grosse Feher in einzelnen Skripten.
This commit is contained in:
@@ -2,24 +2,6 @@
|
||||
|
||||
use Dotenv\Dotenv;
|
||||
|
||||
if (!isset($token)){
|
||||
http_response_code(403);
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => 'security check failed: ERROR 01'
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($token !== 'QQa2UMbEYW8oOL7wz9DjtqECVCikSZsDuSdmzxiadEXFsKyujEUyQOW1AYMD2OqU8VXxClIRweRuWLzvBrZpPYL41e89Rs96tM7Lq1KpjA5E2mg2UfgvztheGRV'){
|
||||
http_response_code(403);
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => 'security check failed: ERROR 02'
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../composer/vendor/autoload.php';
|
||||
|
||||
$envFile = realpath(__DIR__ . '/../../config/.env.db-guest');
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
use Dotenv\Dotenv;
|
||||
|
||||
if(session_status() !== PHP_SESSION_ACTIVE) session_start();
|
||||
require_once __DIR__ . '/../session_functions.php';
|
||||
|
||||
ini_wkvs_session();
|
||||
|
||||
if (!isset($type)){
|
||||
return [
|
||||
@@ -12,22 +14,13 @@ if (!isset($type)){
|
||||
}
|
||||
|
||||
if ($type === 'kr'){
|
||||
if (empty($_SESSION['access_granted_kampfrichter']) || $_SESSION['access_granted_kampfrichter'] !== true || empty($_SESSION['passcodekampfrichter_id']) || $_SESSION['passcodekampfrichter_id'] < 1) {
|
||||
http_response_code(403);
|
||||
exit;
|
||||
}
|
||||
check_user_permission('kampfrichter');
|
||||
} elseif ($type === 'tr'){
|
||||
if (empty($_SESSION['access_granted_trainer']) || $_SESSION['access_granted_trainer'] !== true || empty($_SESSION['passcodetrainer_id']) || $_SESSION['passcodetrainer_id'] < 1) {
|
||||
http_response_code(403);
|
||||
exit;
|
||||
}
|
||||
check_user_permission('trainer');
|
||||
} elseif ($type === 'wkl') {
|
||||
if (empty($_SESSION['access_granted_wk_leitung']) || $_SESSION['access_granted_wk_leitung'] !== true || empty($_SESSION['passcodewk_leitung_id']) || intval($_SESSION['passcodewk_leitung_id']) < 1 ) {
|
||||
http_response_code(403);
|
||||
exit;
|
||||
}
|
||||
check_user_permission('wk_leitung');
|
||||
} elseif ($type === 'otl') {
|
||||
if (empty($_SESSION['set_new_password_id_user']) || empty($_SESSION['set_new_password_granted']) || $_SESSION['set_new_password_granted'] !== true || $_SESSION['set_new_password_id_user'] < 1 ) {
|
||||
if (empty($_SESSION['access_granted_db_otl']) || $_SESSION['access_granted_db_otl'] !== true) {
|
||||
http_response_code(403);
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user