Thread: request routing
View Single Post
  #1 (permalink)  
Old 05-29-2007, 09:28 PM
albeva albeva is offline
Junior Member
 
Join Date: May 2007
Posts: 25
Default request routing

Okay i'm stuck with a problem. I use Zend's request routings and it works fine for me. How ever in index.php I want to check if user is logged on or not. If no then route user to index controller login action. How to do it best?
PHP Code:
// check if we are logged in.
// if not direct to the login screen
if ($auth->hasIdentity())
{
    try
    {
        
$front->dispatch();
    }
    catch (
Exception $e)
    {
        echo 
fnParseException ($e);
    }
}
else
{
    
/*
        I experimented with these kind of things - doesn't seem to be working
        $request = new Zend_Controller_Request_Http();
        $request->setControllerName("index");
        $front->setRequest($request);
    */
    
$front->dispatch();

Reply With Quote