Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not redirecting to URL #649

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from

Commits on Aug 16, 2016

  1. Fix not redirecting to URL

    Updated RedirectCallBack to fix not redirecting to a url problem. It was having problem here on two of these functions
    
    private function routeExists($route)
        {
            try {
                $this->router->assemble(array(), array('name' => $route));
            } catch (Exception\RuntimeException $e) {
                return false;
            }
            return true;
        }
    
    
    protected function getRedirect($currentRoute, $redirect = false)
        {
            $useRedirect = $this->options->getUseRedirectParameterIfPresent();
            $routeExists = ($redirect && $this->routeExists($redirect));
            if (!$useRedirect || !$routeExists) {
                $redirect = false;
            }
    
            switch ($currentRoute) {
                case 'zfcuser/register':
                case 'zfcuser/login':
                case 'zfcuser/authenticate':
                    $route = ($redirect) ?: $this->options->getLoginRedirectRoute();
                    return $this->router->assemble(array(), array('name' => $route));
                    break;
                case 'zfcuser/logout':
                    $route = ($redirect) ?: $this->options->getLogoutRedirectRoute();
                    return $this->router->assemble(array(), array('name' => $route));
                    break;
                default:
                    return $this->router->assemble(array(), array('name' => 'zfcuser'));
            }
        }
    roshanbudhathoki authored Aug 16, 2016
    Configuration menu
    Copy the full SHA
    a15e35e View commit details
    Browse the repository at this point in the history