Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
24 righe
691 B
24 righe
691 B
<?php |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
require_once $configPath; |
|
|
|
ProcurePlus\In::authenticate(); |
|
|
|
switch($_GET["method"]) { |
|
case 'ping': |
|
$inputBuffer = file_get_contents("php://input"); |
|
if(!valid_json($inputBuffer, $payload, true)) { |
|
die("Invalid payload"); |
|
} |
|
|
|
$signKey = ProcurePlus\KeyStore::get("sign", getCurrentDomain(), "private"); |
|
|
|
|
|
die(\JOSE_JWT::encode($payload)->sign($signKey, "RS512")->toString()); |
|
break; |
|
default: |
|
ProcurePlus\HTTP::respondJson(["error" => "Method not found"], 404); |
|
|
|
} |
|
|
|
|
|
|