From 7aca28cbca8c0fc7656cdd3216a8c1319a6e4d29 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 5 Dec 2016 13:18:47 +0300 Subject: [PATCH] php: alone IP address --- web/documentserver-example/php/common.php | 7 +++++++ web/documentserver-example/php/config.php | 1 + 2 files changed, 8 insertions(+) diff --git a/web/documentserver-example/php/common.php b/web/documentserver-example/php/common.php index a1321e35..07a56538 100644 --- a/web/documentserver-example/php/common.php +++ b/web/documentserver-example/php/common.php @@ -145,6 +145,13 @@ function serverPath() { } function getCurUserHostAddress($userAddress = NULL) { + if ($GLOBALS['ALONE']) { + if (empty($GLOBALS['STORAGE_PATH'])) { + return "Storage"; + } else { + return ""; + } + } if (is_null($userAddress)) {$userAddress = getClientIp();} return preg_replace("[^0-9a-zA-Z.=]", '_', $userAddress); } diff --git a/web/documentserver-example/php/config.php b/web/documentserver-example/php/config.php index dd505edd..1accc4c5 100644 --- a/web/documentserver-example/php/config.php +++ b/web/documentserver-example/php/config.php @@ -2,6 +2,7 @@ $GLOBALS['FILE_SIZE_MAX'] = 5242880; $GLOBALS['STORAGE_PATH'] = ""; +$GLOBALS['ALONE'] = FALSE; $GLOBALS['MODE'] = "";