Re: small bug in auth components
Try $this->Auth->fields['username'] = 'email'; On 10 aug, 00:58, muslimbit wrote: > There is an error in the auth components when i init the username auth > field only in beforfilter function : > > $this->Auth->fields = array( > 'username' => 'email' > ); > > i get a notice : > > Notice (8): Undefined index: password [CORE\cake\libs\controller > \components\auth.php, line 382] -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: small bug in auth components
I understand that you get an error in your case - my question is, do you want to authenticate a user only by the user entering his/her e- mail address? For that is what you are trying to do! Auth is supposed to have to field names in the fields variable, but you are only giving it one! See the CakePHP book for a short description of the fields variable at: http://book.cakephp.org/#!/view/1267/fields Please clarify what you are trying to do :) Enjoy, John On 10 Aug., 00:58, muslimbit wrote: > There is an error in the auth components when i init the username auth > field only in beforfilter function : > > $this->Auth->fields = array( > 'username' => 'email' > ); > > i get a notice : > > Notice (8): Undefined index: password [CORE\cake\libs\controller > \components\auth.php, line 382] -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
small bug in auth components
There is an error in the auth components when i init the username auth field only in beforfilter function : $this->Auth->fields = array( 'username' => 'email' ); i get a notice : Notice (8): Undefined index: password [CORE\cake\libs\controller \components\auth.php, line 382] -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Auth components
Thanks to Gonzalo Servat & brian. problem solved. On Apr 12, 3:04 pm, Gonzalo Servat wrote: > On Sun, Apr 12, 2009 at 3:52 AM, gimmebucks wrote: > > > I want the system to display : > > "You are not authorized to access that location." > > > But not > > "You are not authorized to access that location. > > 1" > > > Please help. > > Just like brian said, remove the echo. Instead of: > > echo $session->flash('auth'); > > .. try: > > $session->flash('auth'); > > You're seeing the additional "1" because the flash() function returns a > boolean which indicates the result of the call to the flash() method. The > printing of the error message itself is done automatically inside the > flash() function so you don't need to echo the result out. > > - Gonzalo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth components
On Sun, Apr 12, 2009 at 3:52 AM, gimmebucks wrote: > > I want the system to display : > "You are not authorized to access that location." > > But not > "You are not authorized to access that location. > 1" > > Please help. Just like brian said, remove the echo. Instead of: echo $session->flash('auth'); .. try: $session->flash('auth'); You're seeing the additional "1" because the flash() function returns a boolean which indicates the result of the call to the flash() method. The printing of the error message itself is done automatically inside the flash() function so you don't need to echo the result out. - Gonzalo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth components
I want the system to display : "You are not authorized to access that location." But not "You are not authorized to access that location. 1" Please help. On Apr 11, 12:25 am, brian wrote: > Remove the echo. flash() does that itself. > > On Fri, Apr 10, 2009 at 11:01 AM, gimmebucks wrote: > > > I'm usingauthcomponent and it's working like charm. > > on layout file(default.ctp), i use: > > > echo $session->flash('auth'); > > > and the result is: > > > You are not authorized to access that location. > > 1 > > > How to get rid of '1' character? > > Please help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth components
Remove the echo. flash() does that itself. On Fri, Apr 10, 2009 at 11:01 AM, gimmebucks wrote: > > I'm using auth component and it's working like charm. > on layout file(default.ctp), i use: > > echo $session->flash('auth'); > > and the result is: > > You are not authorized to access that location. > 1 > > How to get rid of '1' character? > Please help. > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Auth components
I'm using auth component and it's working like charm. on layout file(default.ctp), i use: echo $session->flash('auth'); and the result is: You are not authorized to access that location. 1 How to get rid of '1' character? Please help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---