From 509128be585b7108ef77f807d49ce5ffe1a57853 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Fri, 30 Sep 2016 16:03:18 +0200 Subject: Implements FS#236: Save receipient jid --- storage-backend/lib/functions.http.inc.php | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 storage-backend/lib/functions.http.inc.php (limited to 'storage-backend/lib/functions.http.inc.php') diff --git a/storage-backend/lib/functions.http.inc.php b/storage-backend/lib/functions.http.inc.php new file mode 100644 index 0000000..c508b20 --- /dev/null +++ b/storage-backend/lib/functions.http.inc.php @@ -0,0 +1,64 @@ + $data]; + } + header('Content-Type: application/json'); + sendHttpReturnCodeAndMessage($code, json_encode($data)); +} + +function sendHttpReturnCodeAndMessage($code, $text = '') { + http_response_code($code); + exit($text); +} + +function getOptionalPostParameter($parameterName, $default = NULL) { + $parameter = $_POST[$parameterName]; + if (!isset($parameter) || is_null($parameter) || empty($parameter)) { + $parameter = $default; + } + return $parameter; +} +?> \ No newline at end of file -- cgit v1.2.3