mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
git-subtree-dir: community_server git-subtree-mainline: ff11f6efe35bba180260fe84077bcd94298895c1 git-subtree-split: b6544b9e69fb85d4da100934675323c3e8c8ef67
52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Controller\AppController;
|
|
|
|
class ElopageWebhookController extends AppController
|
|
{
|
|
public function initialize()
|
|
{
|
|
parent::initialize();
|
|
|
|
$this->Auth->allow(['put']);
|
|
|
|
}
|
|
|
|
public function put()
|
|
{
|
|
$this->autoRender = false;
|
|
$data = $this->request->getData();
|
|
$response = $this->response->withType('text/plain');
|
|
|
|
$dataString = http_build_query($data);
|
|
//$this->recursiveArrayToString($data, $dataString);
|
|
// %5B => [
|
|
// %5D => ]
|
|
$dataString = preg_replace(['/\%5B/', '/\%5D/'], ['[', ']'], $dataString);
|
|
//var_dump($dataString);
|
|
|
|
//2020-02-27T13:52:32+01:00
|
|
$dateString = date('c');
|
|
$fh = fopen('/etc/grd_login/php_elopage_requests.txt', 'a');
|
|
if($fh === FALSE) {
|
|
return $response->withStringBody('400 ERROR');
|
|
}
|
|
fwrite($fh, $dateString);
|
|
fwrite($fh, "\n");
|
|
fwrite($fh, $dataString);
|
|
fwrite($fh, "\n");
|
|
fclose($fh);
|
|
|
|
|
|
return $response->withStringBody('200 OK');
|
|
|
|
}
|
|
}
|