Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-29 Thread cricket
On Tue, Dec 28, 2010 at 11:58 PM, John Maxim goog...@gmail.com wrote: Users_controllers.php: var $name = 'Users'; /*some codes in between*/ function login() {         if(!empty($this-data))        {                 // If the username/password match                

Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-29 Thread Amit Badkas
Hi, By default, Auth component redirects to referrer page (if set) otherwise to the page set in loginRedirect. So you may need to overwrite 'Auth.redirect' session parameter. FYI, please have a look at http://book.cakephp.org/view/1270/loginRedirect Amit Badkas PHP Applications for E-Biz:

Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-29 Thread John Maxim
Hi cricket ! you're awesome, thanks your working and explanation solved the puzzle I had.. Amit, I will check that link out..thanks too. Regards, Maxim On Dec 30, 12:54 pm, Amit Badkas amit.sanis...@gmail.com wrote: Hi, By default, Auth component redirects to referrer page (if set)

Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-28 Thread Amit Badkas
Hi, In CakePHP, the views don't display directly, you need to render them using actions of controllers. From your description, it seems that you need to redirect to /posts/index page, so use $this-redirect(array('controller' = 'posts', 'action' = 'index')); to go to that page. Hope this helps.

Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-28 Thread John Maxim
Hi Amit, I used your code: $this-redirect(array('controller' = 'posts', 'action' = 'index')); but it still redirects me to the root directory... What can be wrong ? On Dec 29, 1:39 pm, Amit Badkas amit.sanis...@gmail.com wrote: Hi, In CakePHP, the views don't display directly, you need

Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-28 Thread Amit Badkas
Hi, I think the problem is due to other thing(s). I can't advise much without looking at all of the code. However, please refer http://book.cakephp.org/view/1250/Authentication to check if you have set-up authentication parameters correctly or not. Hope this helps. Amit Badkas PHP Applications