kohanut icon indicating copy to clipboard operation
kohanut copied to clipboard

Redirects are missing

Open mrene85 opened this issue 15 years ago • 0 comments

Redirects are not handled this time. To fix this, edit 'action_view' in 'kohanut\modules\kohanut\classes\controller\kohanut.php'

Modify the catch to this:

$redir = Sprig::factory('kohanut_redirect' , array('url' => $url))->load();

if ( $redir->count() > 0 ) {
    // set status
    Kohanut::status( $redir->type );

    // redirect
    $path = $redir->newurl;
    Request::instance()->redirect( $path );

} else {

    // Find the error page
    $error = Sprig::factory('kohanut_page',array('url'=>'error'))->load();

    // If i couldn't find the error page, just give a generic message
    if ( ! $error->loaded())
    {
            Kohanut::status(404);
            $this->request->response = View::factory('kohanut/generic404');
            return;
    }

    // Set the response
    $out = $error->render();
}

mrene85 avatar Nov 04 '10 16:11 mrene85