Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-29-2007, 09:28 PM
Junior Member
 
Join Date: May 2007
Posts: 22
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();

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-29-2007, 11:41 PM
SpotSec's Avatar
Senior Member
 
Join Date: Feb 2007
Location: United States
Posts: 116
Default

There are several ways to do that, but usually it is implemented as a plugin to the controller. In large web applications you would use Zend_Acl, but it seems you are doing something simple. A way to do this could be to either to extend the action controller or create a controller plugin.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-30-2007, 09:12 AM
Junior Member
 
Join Date: May 2007
Posts: 22
Default

tnx. I'll have a look at the plugins.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:30 AM.