2015-11-21 01:11:42 +01:00
|
|
|
<?php
|
2015-11-18 19:15:23 +01:00
|
|
|
/*
|
|
|
|
* LibreNMS
|
|
|
|
*
|
|
|
|
* Copyright (c) 2015 Søren Friis Rosiak <sorenrosiak@gmail.com>
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version. Please see LICENSE.txt at the top level of
|
|
|
|
* the source code distribution for details.
|
|
|
|
*/
|
2016-04-26 15:13:01 -07:00
|
|
|
header('Content-type: application/json');
|
2015-11-18 19:15:23 +01:00
|
|
|
|
|
|
|
$status = 'error';
|
|
|
|
$message = 'unknown error';
|
2015-11-21 00:44:13 +01:00
|
|
|
$data_param = mres($_POST['data_param']);
|
|
|
|
$query_param = mres($_POST['query_param']);
|
|
|
|
if (isset($data_param) && isset($query_param)) {
|
2015-11-18 19:15:23 +01:00
|
|
|
$status = 'ok';
|
|
|
|
$message = 'Queried';
|
2015-11-21 00:44:13 +01:00
|
|
|
$output = get_ripe_api_whois_data_json($data_param, $query_param);
|
2015-11-18 19:15:23 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$status = 'error';
|
|
|
|
$message = 'ERROR: Could not query';
|
|
|
|
}
|
|
|
|
die(json_encode(array(
|
|
|
|
'status' => $status,
|
|
|
|
'message' => $message,
|
2015-11-21 00:44:13 +01:00
|
|
|
'data_param' => $data_param,
|
|
|
|
'query_param' => $query_param,
|
2015-11-18 19:15:23 +01:00
|
|
|
'output' => $output
|
|
|
|
)));
|