|
Re: Check user: msg#00037php.zend.framework.auth
Use Zend_Auth for handling authentication. It has pretty much everything you need. http://framework.zend.com/manual/en/zend.auth.html Then, for handling login make a controller plug-in to handle that for you. http://framework.zend.com/manual/en/zend.controller.plugins.html Here is the plug-in I've implemented for an app: <?php class Intra_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract { public function preDispatch(Zend_Controller_Request_Abstract $request) { if ( !($this->getRequest()->getControllerName() === 'auth' and $this->getRequest()->getModuleName() === 'default') and !Zend_Auth::getInstance()->hasIdentity() ) { $redirectNS = new Zend_Session_Namespace('redirect'); $redirectNS->fromUrl = $_SERVER['REQUEST_URI']; $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('Redirector'); $redirector->goto('login', 'auth', ''); } } } (All the stuff with $redirectNS is just to be able to redirect the user back to the page he requested after logging in) Note: Use the latest version of ZF (1.0.2), otherwise you will not be able to use the Redirector helper. Regards, Emil Ivanov On 18/10/2007, Csányi András <sayusi.ando@xxxxxxxxx> wrote: Hi everybody! -- My place to share my ideas: http://vladev.blogspot.com |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Updating information in my storage: 00037, Емил Иванов / Emil Ivanov |
|---|---|
| Next by Date: | OpenID + OAuth: 00037, Erik Unger | bouncing bytes |
| Previous by Thread: | Re: Check useri: 00037, Vincent |
| Next by Thread: | Re: Check user: 00037, Csányi András |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |