mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add config check
This commit is contained in:
parent
61b520fdef
commit
e0aa06744e
@ -67,11 +67,13 @@ Router::scope('/', function (RouteBuilder $routes) {
|
||||
return true;
|
||||
}
|
||||
$allowedCaller = Configure::read('API.allowedCaller');
|
||||
$callerIp = $request->clientIp();
|
||||
foreach($allowedCaller as $allowed) {
|
||||
$ip = gethostbyname($allowed);
|
||||
if($ip === $callerIp) return true;
|
||||
}
|
||||
if($allowedCaller && count($allowedCaller) > 0) {
|
||||
$callerIp = $request->clientIp();
|
||||
foreach($allowedCaller as $allowed) {
|
||||
$ip = gethostbyname($allowed);
|
||||
if($ip === $callerIp) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit a04d4769974b9d93ba72e490ed7dca3fbaed768c
|
||||
Subproject commit 21d4a0a5e9a19f251e26c0ae07ce74be2fa99bbf
|
||||
Loading…
x
Reference in New Issue
Block a user