fixed some API methods
This commit is contained in:
@@ -1,23 +1,21 @@
|
||||
<?php
|
||||
|
||||
global $API_OPTIONS;
|
||||
global $OPTIONS;
|
||||
|
||||
require_once (__DIR__ . '/../internals/base.php');
|
||||
require_once (__DIR__ . '/../internals/database.php');
|
||||
|
||||
if (!isset($API_OPTIONS['target'])) die("Wrong parameters.");
|
||||
if (!isset($API_OPTIONS['secret'])) die("Wrong parameters.");
|
||||
if (!isset($API_OPTIONS['uri'])) die("Wrong parameters.");
|
||||
if (!isset($API_OPTIONS['target'])) httpDie(400, "Wrong parameters.");
|
||||
|
||||
$hook = $API_OPTIONS['target'];
|
||||
$secret = $API_OPTIONS['secret'];
|
||||
$uri = $API_OPTIONS['uri'];
|
||||
$uri = $OPTIONS['uri'];
|
||||
|
||||
$cmd = "";
|
||||
|
||||
if ($hook == 'website_mikescher') $cmd = 'git pull';
|
||||
else if ($hook == 'griddominance') $cmd = 'update-gdapi';
|
||||
else die("Unknown webhook: $hook");
|
||||
else httpDie(400, "Unknown webhook: $hook");
|
||||
|
||||
$std = shell_exec($cmd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user