summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-02-07 19:14:53 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-02-07 19:14:53 (GMT)
commitae54d15c6083425a3f6795828f8f9318d55fc044 (patch)
treedbf56a5a9135decb67e89b9c88f598a0d7372c3c
parentaae8de625b88efdda5c587e30ac46929ab906609 (diff)
downloadkolab-freebusy-ae54d15c6083425a3f6795828f8f9318d55fc044.tar.gz
$_SERVER["REDIRECT_URL"] is only of value when the Free/Busy information is not directly requested.
-rw-r--r--web/index.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/web/index.php b/web/index.php
index 9d7cc37..f62c420 100644
--- a/web/index.php
+++ b/web/index.php
@@ -48,7 +48,16 @@ if ($config->isValid()) {
$trusted_ip = $config->trustednetworks ? Utils::checkIPRange($remote_ip, $config->trustednetworks['allow']) : false;
$log = Logger::get('web');
- $log->addDebug('Request: ' . $_SERVER['REDIRECT_URL'], array('ip' => $remote_ip, 'trusted' => $trusted_ip));
+
+ $uri = $_SERVER['REDIRECT_URL'];
+
+ // we're not always redirected here
+ if (empty($uri)) {
+ $uri = $_SERVER['REQUEST_URI'];
+ $log->addDebug('Request (direct): ' . $uri, array('ip' => $remote_ip, 'trusted' => $trusted_ip));
+ } else {
+ $log->addDebug('Request (redirect): ' . $uri, array('ip' => $remote_ip, 'trusted' => $trusted_ip));
+ }
// check HTTP authentication
if (!$trusted_ip && $config->httpauth) {
@@ -64,7 +73,7 @@ if ($config->isValid()) {
header('Content-type: text/plain; charset=utf-8', true);
// analyse request
- $url = array_filter(explode('/', $_SERVER['REDIRECT_URL']));
+ $url = array_filter(explode('/', $uri));
$user = strtolower(array_pop($url));
$action = strtolower(array_pop($url));
$extended = false;