Esempio n. 1
0
        }
    }
    $url = implode('/', $urlArray);
    unset($urlArray);
}
if ($url) {
    foreach (array_keys($Params['UserParameters']) as $key) {
        if ($key == 'offset') {
            continue;
        }
        $url .= '/(' . $key . ')/' . $Params['UserParameters'][$key];
    }
    $module->redirectTo('/' . $url);
} else {
    if (isset($_SERVER['HTTP_REFERER'])) {
        $preferredRedirectionURI = eZURI::decodeURL($_SERVER['HTTP_REFERER']);
        // We should exclude OFFSET from $preferredRedirectionURI
        $exploded = explode('/', $preferredRedirectionURI);
        foreach (array_keys($exploded) as $itemKey) {
            $item = $exploded[$itemKey];
            if ($item == '(offset)') {
                array_splice($exploded, $itemKey, 2);
                break;
            }
        }
        $redirectURI = implode('/', $exploded);
        // Protect against redirect loop
        if (strpos($redirectURI, '/user/preferences/set') !== false) {
            $module->redirectTo('/');
        } else {
            eZRedirectManager::redirectTo($module, false, true, false, $redirectURI);