mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
missing update
This commit is contained in:
parent
d2497c9c7c
commit
de269e97ea
@ -60,19 +60,21 @@ Router::scope('/', function (RouteBuilder $routes) {
|
||||
$whitelist = ['JsonRequestHandler', 'ElopageWebhook', 'AppRequests'];
|
||||
$ajaxWhitelist = ['TransactionSendCoins', 'TransactionCreations'];
|
||||
|
||||
$callerIp = $request->clientIp();
|
||||
|
||||
foreach($whitelist as $entry) {
|
||||
if($request->getParam('controller') === $entry) {
|
||||
if($entry == 'ElopageWebhook' || $entry == 'AppRequests') {
|
||||
return true;
|
||||
}
|
||||
$allowedIpLocalhost = ['127.0.0.1', 'localhost', '', '::1'];
|
||||
if(in_array($clientIp, $allowedIpLocalhost)) {
|
||||
if(in_array($callerIp, $allowedIpLocalhost)) {
|
||||
return true;
|
||||
}
|
||||
$allowedCaller = Configure::read('API.allowedCaller');
|
||||
$ipPerHost = [];
|
||||
if($allowedCaller && count($allowedCaller) > 0) {
|
||||
$callerIp = $request->clientIp();
|
||||
|
||||
foreach($allowedCaller as $allowed) {
|
||||
$ip = gethostbyname($allowed);
|
||||
$ipPerHost[$allowed] = $ip;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user