Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic support to show data recieved by WebHook
Release 1.1
- Loading branch information
Showing
13 changed files
with
357 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Flexplorer; | ||
|
||
/** | ||
* Flexplorer - Show WebHook data recieved. | ||
* | ||
* @author Vítězslav Dvořák <vitex@arachne.cz> | ||
* @copyright 2016-2017 Vitex Software | ||
*/ | ||
require_once 'includes/Init.php'; | ||
|
||
$oPage->onlyForLogged(); | ||
|
||
$file = $oPage->getRequestValue('file'); | ||
$sender = new Flexplorer(); | ||
$sender->lastResponseCode = 200; | ||
$sender->lastCurlResponse = json_encode(json_decode(file_get_contents(sys_get_temp_dir().'/'.basename($file))), | ||
JSON_PRETTY_PRINT); | ||
|
||
|
||
$oPage->addItem(new ui\PageTop(_('Changes recieved').': '.$file)); | ||
|
||
|
||
$oPage->container->addItem(new ui\ShowResponse($sender)); | ||
|
||
$oPage->addItem(new ui\PageBottom()); | ||
|
||
$oPage->draw(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/** | ||
* Flexplorer - Hlavní strana. | ||
* | ||
* @author Vítězslav Dvořák <vitex@arachne.cz> | ||
* @copyright 2016-2017 Vitex Software | ||
*/ | ||
|
||
namespace Flexplorer; | ||
|
||
require_once 'includes/Init.php'; | ||
|
||
$delete = $oPage->getRequestValue('delete'); | ||
|
||
$oPage->onlyForLogged(); | ||
|
||
$chages = []; | ||
|
||
$d = dir(sys_get_temp_dir()); | ||
while (false !== ($entry = $d->read())) { | ||
if (strstr($entry, 'flexplorer-change')) { | ||
if ($delete === 'all') { | ||
unlink(sys_get_temp_dir().'/'.$entry); | ||
} else { | ||
$chages[] = $entry; | ||
} | ||
} | ||
} | ||
$d->close(); | ||
|
||
|
||
$oPage->addItem(new ui\PageTop(_('FlexiBee WebHook income'))); | ||
|
||
$oPage->container->addItem(new ui\ChangesLister($chages)); | ||
|
||
if (count($chages)) { | ||
$oPage->container->addItem(new \Ease\TWB\LinkButton('?delete=all', | ||
_('Delete All'), 'danger')); | ||
} else { | ||
|
||
$webHookUrl = str_replace(basename(__FILE__), 'webhook.php', | ||
\Ease\Page::phpSelf()); | ||
|
||
$oPage->container->addItem(new \Ease\TWB\LinkButton("changesapi.php?hookurl=".urlencode($webHookUrl), | ||
_('Target to FlexPlorer'), 'success', ['class' => 'button button-xs'])); | ||
|
||
|
||
$oPage->addStatusMessage('WebHook not triggered yet'); | ||
} | ||
$oPage->addItem(new ui\PageBottom()); | ||
|
||
$oPage->draw(); |
Oops, something went wrong.