Re: Having issue with AUTH in 2.1

2012-02-29 Thread Rodrigo Rodrigues Moyle
You need to put element sql_dump on your ajax layout too

Em terça-feira, 28 de fevereiro de 2012 11h30min07s UTC-3, heohni escreveu:
>
> I have debug 2. but it will not return a sql statement, it's an ajax 
> based request anyway 
>
> On 28 Feb., 14:02, Rodrigo Rodrigues Moyle  
> wrote: 
> > Set debug to 2 
> > 
> > Em terça-feira, 28 de fevereiro de 2012 06h55min25s UTC-3, heohni 
> escreveu: 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > well, if I do it like the book says, I get no sql error any more, but 
> > > the if ($this->Auth->login()) fails without any comment. 
> > > In this case, how can I get the sql statement debugged which is 
> > > running? 
> > 
> > > On 28 Feb., 10:33, luca capra  wrote: 
> > > > Il 28/02/2012 09:55, heohni ha scritto: 
> > 
> > > > > I did this, see above? 
> > 
> > > > > On 28 Feb., 09:36, "@dariobarila"  wrote: 
> > > > >> Hello, 
> > > > >> try to configure the Auth fields on the same level of 
>  $components = 
> > > > >> array('Auth'); 
> > 
> > > > >> On 28 Feb, 09:33, heohni 
> > >  wrote: 
> > > > >> ... 
> > > > >>>  $this->Auth->fields = array('username' => 
>  'usr_username', 
> > > > >>> 'password' =>  'usr_password'); 
> > > > >>>  $this->Auth->allowedActions = array('display', 'index', 
> > > > >>> 'add'); 
> > > > >>>  $this->Auth->autoRedirect = false; 
> > > > >>>  $this->Auth->logoutRedirect = array('controller' => 
> > > > >>> 'bookmark', 'action' =>  'search'); 
> > > > >>>  $this->Auth->loginRedirect = array('controller' => 
> > >  'pages', 
> > > > >>> 'action' =>  'display', 'home'); 
> > > > >>>  } 
> > 
> > > > >>> ... 
> > > > >>> SELECT `User`.`usr_id`, `User`.`usr_username`, 
> > > `User`.`usr_password`, 
> > > > >>> `User`.`created` FROM `project`.`users` AS `User`   WHERE 
> > > > >>> `User`.`username` = 'me' AND `User`.`password` = 
> > > > >>> '998992c0dfcffb9ad442a85be2d636ba37228c3d'LIMIT 1 
> > 
> > > > I think he means something like (read the book): 
> > 
> > > > $components = array( 
> > > >'Auth' =>  array( 
> > > >  'authenticate' =>  array( 
> > > >  'Form' =>  array( 
> > > >  "fields" =>  array( 
> > > >  'username' =>  'usr_nameuser', 
> > > >  'password' =>  'usr_wordpass' 
> > > >  ), 
> > > >  ) 
> > > > ), 
> > > > );

-- 
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: Having issue with AUTH in 2.1

2012-02-28 Thread heohni
I have debug 2. but it will not return a sql statement, it's an ajax
based request anyway

On 28 Feb., 14:02, Rodrigo Rodrigues Moyle 
wrote:
> Set debug to 2
>
> Em terça-feira, 28 de fevereiro de 2012 06h55min25s UTC-3, heohni escreveu:
>
>
>
>
>
>
>
>
>
> > well, if I do it like the book says, I get no sql error any more, but
> > the if ($this->Auth->login()) fails without any comment.
> > In this case, how can I get the sql statement debugged which is
> > running?
>
> > On 28 Feb., 10:33, luca capra  wrote:
> > > Il 28/02/2012 09:55, heohni ha scritto:
>
> > > > I did this, see above?
>
> > > > On 28 Feb., 09:36, "@dariobarila"  wrote:
> > > >> Hello,
> > > >> try to configure the Auth fields on the same level of  $components =
> > > >> array('Auth');
>
> > > >> On 28 Feb, 09:33, heohni
> >  wrote:
> > > >> ...
> > > >>>          $this->Auth->fields = array('username' =>  'usr_username',
> > > >>> 'password' =>  'usr_password');
> > > >>>          $this->Auth->allowedActions = array('display', 'index',
> > > >>> 'add');
> > > >>>          $this->Auth->autoRedirect = false;
> > > >>>          $this->Auth->logoutRedirect = array('controller' =>
> > > >>> 'bookmark', 'action' =>  'search');
> > > >>>          $this->Auth->loginRedirect = array('controller' =>
> >  'pages',
> > > >>> 'action' =>  'display', 'home');
> > > >>>      }
>
> > > >>> ...
> > > >>> SELECT `User`.`usr_id`, `User`.`usr_username`,
> > `User`.`usr_password`,
> > > >>> `User`.`created` FROM `project`.`users` AS `User`   WHERE
> > > >>> `User`.`username` = 'me' AND `User`.`password` =
> > > >>> '998992c0dfcffb9ad442a85be2d636ba37228c3d'    LIMIT 1
>
> > > I think he means something like (read the book):
>
> > > $components = array(
> > >    'Auth' =>  array(
> > >              'authenticate' =>  array(
> > >                  'Form' =>  array(
> > >                      "fields" =>  array(
> > >                          'username' =>  'usr_nameuser',
> > >                          'password' =>  'usr_wordpass'
> > >                      ),
> > >                  )
> > >             ),
> > > );

-- 
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: Having issue with AUTH in 2.1

2012-02-28 Thread Rodrigo Rodrigues Moyle
Set debug to 2

Em terça-feira, 28 de fevereiro de 2012 06h55min25s UTC-3, heohni escreveu:
>
> well, if I do it like the book says, I get no sql error any more, but 
> the if ($this->Auth->login()) fails without any comment. 
> In this case, how can I get the sql statement debugged which is 
> running? 
>
> On 28 Feb., 10:33, luca capra  wrote: 
> > Il 28/02/2012 09:55, heohni ha scritto: 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > I did this, see above? 
> > 
> > > On 28 Feb., 09:36, "@dariobarila"  wrote: 
> > >> Hello, 
> > >> try to configure the Auth fields on the same level of  $components = 
> > >> array('Auth'); 
> > 
> > >> On 28 Feb, 09:33, heohni 
>  wrote: 
> > >> ... 
> > >>>  $this->Auth->fields = array('username' =>  'usr_username', 
> > >>> 'password' =>  'usr_password'); 
> > >>>  $this->Auth->allowedActions = array('display', 'index', 
> > >>> 'add'); 
> > >>>  $this->Auth->autoRedirect = false; 
> > >>>  $this->Auth->logoutRedirect = array('controller' => 
> > >>> 'bookmark', 'action' =>  'search'); 
> > >>>  $this->Auth->loginRedirect = array('controller' => 
>  'pages', 
> > >>> 'action' =>  'display', 'home'); 
> > >>>  } 
> > 
> > >>> ... 
> > >>> SELECT `User`.`usr_id`, `User`.`usr_username`, 
> `User`.`usr_password`, 
> > >>> `User`.`created` FROM `project`.`users` AS `User`   WHERE 
> > >>> `User`.`username` = 'me' AND `User`.`password` = 
> > >>> '998992c0dfcffb9ad442a85be2d636ba37228c3d'LIMIT 1 
> > 
> > I think he means something like (read the book): 
> > 
> > $components = array( 
> >'Auth' =>  array( 
> >  'authenticate' =>  array( 
> >  'Form' =>  array( 
> >  "fields" =>  array( 
> >  'username' =>  'usr_nameuser', 
> >  'password' =>  'usr_wordpass' 
> >  ), 
> >  ) 
> > ), 
> > );

-- 
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: Having issue with AUTH in 2.1

2012-02-28 Thread heohni
well, if I do it like the book says, I get no sql error any more, but
the if ($this->Auth->login()) fails without any comment.
In this case, how can I get the sql statement debugged which is
running?

On 28 Feb., 10:33, luca capra  wrote:
> Il 28/02/2012 09:55, heohni ha scritto:
>
>
>
>
>
>
>
> > I did this, see above?
>
> > On 28 Feb., 09:36, "@dariobarila"  wrote:
> >> Hello,
> >> try to configure the Auth fields on the same level of  $components =
> >> array('Auth');
>
> >> On 28 Feb, 09:33, heohni  wrote:
> >> ...
> >>>          $this->Auth->fields = array('username' =>  'usr_username',
> >>> 'password' =>  'usr_password');
> >>>          $this->Auth->allowedActions = array('display', 'index',
> >>> 'add');
> >>>          $this->Auth->autoRedirect = false;
> >>>          $this->Auth->logoutRedirect = array('controller' =>
> >>> 'bookmark', 'action' =>  'search');
> >>>          $this->Auth->loginRedirect = array('controller' =>  'pages',
> >>> 'action' =>  'display', 'home');
> >>>      }
>
> >>> ...
> >>> SELECT `User`.`usr_id`, `User`.`usr_username`, `User`.`usr_password`,
> >>> `User`.`created` FROM `project`.`users` AS `User`   WHERE
> >>> `User`.`username` = 'me' AND `User`.`password` =
> >>> '998992c0dfcffb9ad442a85be2d636ba37228c3d'    LIMIT 1
>
> I think he means something like (read the book):
>
> $components = array(
>    'Auth' =>  array(
>              'authenticate' =>  array(
>                  'Form' =>  array(
>                      "fields" =>  array(
>                          'username' =>  'usr_nameuser',
>                          'password' =>  'usr_wordpass'
>                      ),
>                  )
>             ),
> );

-- 
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: Having issue with AUTH in 2.1

2012-02-28 Thread heohni
Even that way give me the same strange sql error


On 28 Feb., 10:33, luca capra  wrote:
> Il 28/02/2012 09:55, heohni ha scritto:
>
>
>
>
>
>
>
> > I did this, see above?
>
> > On 28 Feb., 09:36, "@dariobarila"  wrote:
> >> Hello,
> >> try to configure the Auth fields on the same level of  $components =
> >> array('Auth');
>
> >> On 28 Feb, 09:33, heohni  wrote:
> >> ...
> >>>          $this->Auth->fields = array('username' =>  'usr_username',
> >>> 'password' =>  'usr_password');
> >>>          $this->Auth->allowedActions = array('display', 'index',
> >>> 'add');
> >>>          $this->Auth->autoRedirect = false;
> >>>          $this->Auth->logoutRedirect = array('controller' =>
> >>> 'bookmark', 'action' =>  'search');
> >>>          $this->Auth->loginRedirect = array('controller' =>  'pages',
> >>> 'action' =>  'display', 'home');
> >>>      }
>
> >>> ...
> >>> SELECT `User`.`usr_id`, `User`.`usr_username`, `User`.`usr_password`,
> >>> `User`.`created` FROM `project`.`users` AS `User`   WHERE
> >>> `User`.`username` = 'me' AND `User`.`password` =
> >>> '998992c0dfcffb9ad442a85be2d636ba37228c3d'    LIMIT 1
>
> I think he means something like (read the book):
>
> $components = array(
>    'Auth' =>  array(
>              'authenticate' =>  array(
>                  'Form' =>  array(
>                      "fields" =>  array(
>                          'username' =>  'usr_nameuser',
>                          'password' =>  'usr_wordpass'
>                      ),
>                  )
>             ),
> );

-- 
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: Having issue with AUTH in 2.1

2012-02-28 Thread luca capra

Il 28/02/2012 09:55, heohni ha scritto:

I did this, see above?

On 28 Feb., 09:36, "@dariobarila"  wrote:

Hello,
try to configure the Auth fields on the same level of  $components =
array('Auth');

On 28 Feb, 09:33, heohni  wrote:
...

 $this->Auth->fields = array('username' =>  'usr_username',
'password' =>  'usr_password');
 $this->Auth->allowedActions = array('display', 'index',
'add');
 $this->Auth->autoRedirect = false;
 $this->Auth->logoutRedirect = array('controller' =>
'bookmark', 'action' =>  'search');
 $this->Auth->loginRedirect = array('controller' =>  'pages',
'action' =>  'display', 'home');
 }

...
SELECT `User`.`usr_id`, `User`.`usr_username`, `User`.`usr_password`,
`User`.`created` FROM `project`.`users` AS `User`   WHERE
`User`.`username` = 'me' AND `User`.`password` =
'998992c0dfcffb9ad442a85be2d636ba37228c3d'LIMIT 1



I think he means something like (read the book):

$components = array(
  'Auth' =>  array(
'authenticate' =>  array(
'Form' =>  array(
"fields" =>  array(
'username' =>  'usr_nameuser',
'password' =>  'usr_wordpass'
),
)
   ),
);

--
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: Having issue with AUTH in 2.1

2012-02-28 Thread heohni
I did this, see above?

On 28 Feb., 09:36, "@dariobarila"  wrote:
> Hello,
> try to configure the Auth fields on the same level of  $components =
> array('Auth');
>
> On 28 Feb, 09:33, heohni  wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > as I only have to secure one controller, I put this into my
> > usersController:
>
> > class UsersController extends AppController {
> >     var $name = 'User';
> >     var $components = array('Auth');
> >     public function beforeFilter() {
> >         parent::beforeFilter();
>
> >         $this->Auth->fields = array('username' => 'usr_username',
> > 'password' => 'usr_password');
> >         $this->Auth->allowedActions = array('display', 'index',
> > 'add');
> >         $this->Auth->autoRedirect = false;
> >         $this->Auth->logoutRedirect = array('controller' =>
> > 'bookmark', 'action' => 'search');
> >         $this->Auth->loginRedirect = array('controller' => 'pages',
> > 'action' => 'display', 'home');
> >     }
>
> > But when I try to login, I get this sql error:
>
> > SELECT `User`.`usr_id`, `User`.`usr_username`, `User`.`usr_password`,
> > `User`.`created` FROM `project`.`users` AS `User`   WHERE
> > `User`.`username` = 'me' AND `User`.`password` =
> > '998992c0dfcffb9ad442a85be2d636ba37228c3d'    LIMIT 1
>
> > It looks to me as  $this->Auth->fields is just ignored?
>
> > I went to the book and read about but I couldn't find a hint how else
> > to write it.
> > Anyone an idea?

-- 
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: Having issue with AUTH in 2.1

2012-02-28 Thread @dariobarila
Hello,
try to configure the Auth fields on the same level of  $components =
array('Auth');




On 28 Feb, 09:33, heohni  wrote:
> Hi,
>
> as I only have to secure one controller, I put this into my
> usersController:
>
> class UsersController extends AppController {
>     var $name = 'User';
>     var $components = array('Auth');
>     public function beforeFilter() {
>         parent::beforeFilter();
>
>         $this->Auth->fields = array('username' => 'usr_username',
> 'password' => 'usr_password');
>         $this->Auth->allowedActions = array('display', 'index',
> 'add');
>         $this->Auth->autoRedirect = false;
>         $this->Auth->logoutRedirect = array('controller' =>
> 'bookmark', 'action' => 'search');
>         $this->Auth->loginRedirect = array('controller' => 'pages',
> 'action' => 'display', 'home');
>     }
>
> But when I try to login, I get this sql error:
>
> SELECT `User`.`usr_id`, `User`.`usr_username`, `User`.`usr_password`,
> `User`.`created` FROM `project`.`users` AS `User`   WHERE
> `User`.`username` = 'me' AND `User`.`password` =
> '998992c0dfcffb9ad442a85be2d636ba37228c3d'    LIMIT 1
>
> It looks to me as  $this->Auth->fields is just ignored?
>
> I went to the book and read about but I couldn't find a hint how else
> to write it.
> Anyone an idea?

-- 
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