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.common.inc.php | 18 ++++++ storage-backend/lib/functions.filetransfer.inc.php | 23 ++++++++ storage-backend/lib/functions.http.inc.php | 64 ++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 storage-backend/lib/functions.common.inc.php create mode 100644 storage-backend/lib/functions.filetransfer.inc.php create mode 100644 storage-backend/lib/functions.http.inc.php (limited to 'storage-backend/lib') diff --git a/storage-backend/lib/functions.common.inc.php b/storage-backend/lib/functions.common.inc.php new file mode 100644 index 0000000..b47268e --- /dev/null +++ b/storage-backend/lib/functions.common.inc.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/storage-backend/lib/functions.filetransfer.inc.php b/storage-backend/lib/functions.filetransfer.inc.php new file mode 100644 index 0000000..679cef1 --- /dev/null +++ b/storage-backend/lib/functions.filetransfer.inc.php @@ -0,0 +1,23 @@ + $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