Re: Change Auth component will solve hash without salt?

2008-09-11 Thread [EMAIL PROTECTED]

There are at least two ways to stop AuthComponent from using the salt.

I think the simple hacky way for you in this case is to alter that one
line of code in Auth and keep it in your list of "small tweaks I have
done" (I have one of those).
Line 811
return Security::hash($password, null, true);
should read
return Security::hash($password, null, false);

You can avoid modifying Auth by assigning the authenticate property to
an object you have created. Then you can hash any way you like in that
object. Look at hashPasswords() in Auth. This method delegates the
hashing to an authenticate object if you have set one.

/Martin


On Sep 11, 11:50 am, "Yodi Aditya" <[EMAIL PROTECTED]> wrote:
> Thanks David,
>
> I want password in table hashing with sha1 only and without security.salt.
> in another way, it will make me easy using same table with different
> framework or CMS.
> cause sha1 is include on most CMS / framework. Salt? i don't think so.
>
> Cookies needed for " remember me " on login form.
> I need security.salt to hash them and I don't put user password on cookies.
>
> I think someone has same problem with me.
> Just in some case, you want to build some cakephp based site.
> but, received some user and password data (hashed with sha1) before.
>
> how to use this with Auth component...
>
> On 9/11/08, David C. Zentgraf <[EMAIL PROTECTED]> wrote:
>
> > Not quite sure I understand your particular issue, but why is the
> > password in your DB "pure" SHA1?
> > If you're using the Auth component all the way, it will hash the
> > password including Salt when the user registers, so the only thing
> > that should go into the db is SHA1(salt.password). And every time the
> > user logs in, Auth uses the same SHA1(salt.password) for checking.
>
> > If of course you got the passwords into the DB in another way, using
> > only SHA1(password), you'll get conflicting results...
>
> > And what do you want to do with cookies?
>
> > Chrs,
> > Dav
>
> > On 11 Sep 2008, at 15:36, Yodi Aditya wrote:
>
> > > Hey, dude.
> > > Thanks, that's right sha1 is default hashing in auth component.
> > > i just convience that using correct hashing sha1 in my controller
> > > using
> > > beforeFilter().
>
> > > But,
> > > I say before, security.salt needed not only for Auth but hashing
> > > cookies
> > > too.
> > > Disable security.salt is a bad solution.
>
> > > I'm login using Auth component, just like this :
>
> > > function login() {
> > > if ($this->Auth->user()) {
> > >            if (!empty($this->data)) {
> > >            $this->redirect($this->Auth->redirect());
> > >            }
> > >      }
> > > }
>
> > > user() check username and password automatically.
> > > When checking password, Auth always hashing using sha1 combine with
> > > security.salt.
> > > It's makes different value compare with my password in database
> > > that's using
> > > sha1 only.
>
> > > Anyone help?
>
> > > On 9/10/08, Okto Silaban <[EMAIL PROTECTED]> wrote:
>
> > >> Why do you need to set Security::setHash('sha1') in beforeFilter()
> > >> function
> > >> ?
>
> > >> CakePHP use sha1 as default encryption.
>
> > >> Meanwhile, you can use this In login form :
>
> > >> $this->Auth->password($this->data['User']['password']) <--
> > >> automatically
> > >> using sha1 with salt.
>
> > >> But if you want CakePHP use no .salt. at all, edit : app/config/
> > >> core.php
>
> > >> Just comment the following line :
>
> > >> //Configure::write('Security.salt',
> > >> '78bc27f1b49f17f5c3392e728f789bad78dbeb77');
>
> > >> Okto.Silaban.Net
>
> > >> On Wed, Sep 10, 2008 at 12:31 AM, Yodi Aditya <[EMAIL PROTECTED]>
> > >> wrote:
>
> > >>> I have some users table with 2 value , email and password (hash with
> > >>> sha1).
> > >>> Then i using auth component to make login form.
> > >>> To make sure, that auth will using sha1 when hashing password, i'm
> > >>> using :
> > >>> Security::setHash('sha1'); in beforeFilter().
>
> > >>> Problem happen when Auth hashing password from password input form.
> > >>> Auth hashing password from input form with 

Re: Change Auth component will solve hash without salt?

2008-09-11 Thread Yodi Aditya
Thanks David,

I want password in table hashing with sha1 only and without security.salt.
in another way, it will make me easy using same table with different
framework or CMS.
cause sha1 is include on most CMS / framework. Salt? i don't think so.

Cookies needed for " remember me " on login form.
I need security.salt to hash them and I don't put user password on cookies.

I think someone has same problem with me.
Just in some case, you want to build some cakephp based site.
but, received some user and password data (hashed with sha1) before.

how to use this with Auth component...

On 9/11/08, David C. Zentgraf <[EMAIL PROTECTED]> wrote:

> Not quite sure I understand your particular issue, but why is the
> password in your DB "pure" SHA1?
> If you're using the Auth component all the way, it will hash the
> password including Salt when the user registers, so the only thing
> that should go into the db is SHA1(salt.password). And every time the
> user logs in, Auth uses the same SHA1(salt.password) for checking.
>
> If of course you got the passwords into the DB in another way, using
> only SHA1(password), you'll get conflicting results...
>
> And what do you want to do with cookies?
>
> Chrs,
> Dav
>
>
> On 11 Sep 2008, at 15:36, Yodi Aditya wrote:
>
> > Hey, dude.
> > Thanks, that's right sha1 is default hashing in auth component.
> > i just convience that using correct hashing sha1 in my controller
> > using
> > beforeFilter().
> >
> > But,
> > I say before, security.salt needed not only for Auth but hashing
> > cookies
> > too.
> > Disable security.salt is a bad solution.
> >
> > I'm login using Auth component, just like this :
> >
> > function login() {
> > if ($this->Auth->user()) {
> >if (!empty($this->data)) {
> >$this->redirect($this->Auth->redirect());
> >}
> >  }
> > }
> >
> > user() check username and password automatically.
> > When checking password, Auth always hashing using sha1 combine with
> > security.salt.
> > It's makes different value compare with my password in database
> > that's using
> > sha1 only.
> >
> > Anyone help?
> >
> >
> >
> > On 9/10/08, Okto Silaban <[EMAIL PROTECTED]> wrote:
> >>
> >> Why do you need to set Security::setHash('sha1') in beforeFilter()
> >> function
> >> ?
> >>
> >> CakePHP use sha1 as default encryption.
> >>
> >> Meanwhile, you can use this In login form :
> >>
> >> $this->Auth->password($this->data['User']['password']) <--
> >> automatically
> >> using sha1 with salt.
> >>
> >>
> >> But if you want CakePHP use no .salt. at all, edit : app/config/
> >> core.php
> >>
> >> Just comment the following line :
> >>
> >> //Configure::write('Security.salt',
> >> '78bc27f1b49f17f5c3392e728f789bad78dbeb77');
> >>
> >> Okto.Silaban.Net
> >>
> >> On Wed, Sep 10, 2008 at 12:31 AM, Yodi Aditya <[EMAIL PROTECTED]>
> >> wrote:
> >>
> >>> I have some users table with 2 value , email and password (hash with
> >>> sha1).
> >>> Then i using auth component to make login form.
> >>> To make sure, that auth will using sha1 when hashing password, i'm
> >>> using :
> >>> Security::setHash('sha1'); in beforeFilter().
> >>>
> >>> Problem happen when Auth hashing password from password input form.
> >>> Auth hashing password from input form with sha1 + security.salt.
> >>> (not pure
> >>> sha1).
> >>> It's make different value between password input form and value in
> >>> password table's with same words,
> >>> example, clean password is "test".
> >>> hashing output "test" from Auth is different with sha1 hashing in
> >>> password
> >>> table.
> >>>
> >>> Make clean value on security.salt will be one bad solution.
> >>> Cause cakePHP using security.salt not only on Auth, but encrypt
> >>> cookies
> >>> too.
> >>>
> >>> Then, i try edit cake/libs/controller/components/auth.php.
> >>> .
> >>> /**
> >>> * Hash a password with the application's salt value (as defined with
> >>> Configure::write('Security.salt');
> >>> *
> >>> * @param string $password Password to hash
> >>> * @return string Hashed password
> >>> * @access public
> >>> */
> >>>function password($password) {
> >>>return Security::hash($password, null, true); <--- i change
> >>> this
> >>> with false
> >>>}
> >>> /**
> >>> .
> >>>
> >>> Problem solved. But still doubt about it.
> >>> There are another way to make Auth hashing without security.salt ?
> >>>
> >>>
> >>>
> >>
> >>>
> >>
> >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Change Auth component will solve hash without salt?

2008-09-11 Thread David C. Zentgraf

Not quite sure I understand your particular issue, but why is the  
password in your DB "pure" SHA1?
If you're using the Auth component all the way, it will hash the  
password including Salt when the user registers, so the only thing  
that should go into the db is SHA1(salt.password). And every time the  
user logs in, Auth uses the same SHA1(salt.password) for checking.

If of course you got the passwords into the DB in another way, using  
only SHA1(password), you'll get conflicting results...

And what do you want to do with cookies?

Chrs,
Dav

On 11 Sep 2008, at 15:36, Yodi Aditya wrote:

> Hey, dude.
> Thanks, that's right sha1 is default hashing in auth component.
> i just convience that using correct hashing sha1 in my controller  
> using
> beforeFilter().
>
> But,
> I say before, security.salt needed not only for Auth but hashing  
> cookies
> too.
> Disable security.salt is a bad solution.
>
> I'm login using Auth component, just like this :
>
> function login() {
> if ($this->Auth->user()) {
>if (!empty($this->data)) {
>$this->redirect($this->Auth->redirect());
>}
>  }
> }
>
> user() check username and password automatically.
> When checking password, Auth always hashing using sha1 combine with
> security.salt.
> It's makes different value compare with my password in database  
> that's using
> sha1 only.
>
> Anyone help?
>
>
>
> On 9/10/08, Okto Silaban <[EMAIL PROTECTED]> wrote:
>>
>> Why do you need to set Security::setHash('sha1') in beforeFilter()  
>> function
>> ?
>>
>> CakePHP use sha1 as default encryption.
>>
>> Meanwhile, you can use this In login form :
>>
>> $this->Auth->password($this->data['User']['password']) <--  
>> automatically
>> using sha1 with salt.
>>
>>
>> But if you want CakePHP use no .salt. at all, edit : app/config/ 
>> core.php
>>
>> Just comment the following line :
>>
>> //Configure::write('Security.salt',
>> '78bc27f1b49f17f5c3392e728f789bad78dbeb77');
>>
>> Okto.Silaban.Net
>>
>> On Wed, Sep 10, 2008 at 12:31 AM, Yodi Aditya <[EMAIL PROTECTED]>  
>> wrote:
>>
>>> I have some users table with 2 value , email and password (hash with
>>> sha1).
>>> Then i using auth component to make login form.
>>> To make sure, that auth will using sha1 when hashing password, i'm  
>>> using :
>>> Security::setHash('sha1'); in beforeFilter().
>>>
>>> Problem happen when Auth hashing password from password input form.
>>> Auth hashing password from input form with sha1 + security.salt.  
>>> (not pure
>>> sha1).
>>> It's make different value between password input form and value in
>>> password table's with same words,
>>> example, clean password is "test".
>>> hashing output "test" from Auth is different with sha1 hashing in  
>>> password
>>> table.
>>>
>>> Make clean value on security.salt will be one bad solution.
>>> Cause cakePHP using security.salt not only on Auth, but encrypt  
>>> cookies
>>> too.
>>>
>>> Then, i try edit cake/libs/controller/components/auth.php.
>>> .
>>> /**
>>> * Hash a password with the application's salt value (as defined with
>>> Configure::write('Security.salt');
>>> *
>>> * @param string $password Password to hash
>>> * @return string Hashed password
>>> * @access public
>>> */
>>>function password($password) {
>>>return Security::hash($password, null, true); <--- i change  
>>> this
>>> with false
>>>}
>>> /**
>>> .
>>>
>>> Problem solved. But still doubt about it.
>>> There are another way to make Auth hashing without security.salt ?
>>>
>>>
>>>
>>
>>>
>>
>
> >


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Change Auth component will solve hash without salt?

2008-09-10 Thread Yodi Aditya
Hey, dude.
Thanks, that's right sha1 is default hashing in auth component.
i just convience that using correct hashing sha1 in my controller using
beforeFilter().

But,
I say before, security.salt needed not only for Auth but hashing cookies
too.
Disable security.salt is a bad solution.

I'm login using Auth component, just like this :

function login() {
if ($this->Auth->user()) {
if (!empty($this->data)) {
$this->redirect($this->Auth->redirect());
}
  }
}

user() check username and password automatically.
When checking password, Auth always hashing using sha1 combine with
security.salt.
It's makes different value compare with my password in database that's using
sha1 only.

Anyone help?



On 9/10/08, Okto Silaban <[EMAIL PROTECTED]> wrote:
>
> Why do you need to set Security::setHash('sha1') in beforeFilter() function
> ?
>
> CakePHP use sha1 as default encryption.
>
> Meanwhile, you can use this In login form :
>
> $this->Auth->password($this->data['User']['password']) <-- automatically
> using sha1 with salt.
>
>
> But if you want CakePHP use no .salt. at all, edit : app/config/core.php
>
> Just comment the following line :
>
> //Configure::write('Security.salt',
> '78bc27f1b49f17f5c3392e728f789bad78dbeb77');
>
> Okto.Silaban.Net
>
> On Wed, Sep 10, 2008 at 12:31 AM, Yodi Aditya <[EMAIL PROTECTED]> wrote:
>
>> I have some users table with 2 value , email and password (hash with
>> sha1).
>> Then i using auth component to make login form.
>> To make sure, that auth will using sha1 when hashing password, i'm using :
>> Security::setHash('sha1'); in beforeFilter().
>>
>> Problem happen when Auth hashing password from password input form.
>> Auth hashing password from input form with sha1 + security.salt. (not pure
>> sha1).
>> It's make different value between password input form and value in
>> password table's with same words,
>> example, clean password is "test".
>> hashing output "test" from Auth is different with sha1 hashing in password
>> table.
>>
>> Make clean value on security.salt will be one bad solution.
>> Cause cakePHP using security.salt not only on Auth, but encrypt cookies
>> too.
>>
>> Then, i try edit cake/libs/controller/components/auth.php.
>> .
>> /**
>>  * Hash a password with the application's salt value (as defined with
>> Configure::write('Security.salt');
>>  *
>>  * @param string $password Password to hash
>>  * @return string Hashed password
>>  * @access public
>>  */
>> function password($password) {
>> return Security::hash($password, null, true); <--- i change this
>> with false
>> }
>> /**
>> .
>>
>> Problem solved. But still doubt about it.
>> There are another way to make Auth hashing without security.salt ?
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Change Auth component will solve hash without salt?

2008-09-10 Thread Okto Silaban
Why do you need to set Security::setHash('sha1') in beforeFilter() function
?

CakePHP use sha1 as default encryption.

Meanwhile, you can use this In login form :

$this->Auth->password($this->data['User']['password']) <-- automatically
using sha1 with salt.


But if you want CakePHP use no .salt. at all, edit : app/config/core.php

Just comment the following line :

//Configure::write('Security.salt',
'78bc27f1b49f17f5c3392e728f789bad78dbeb77');

Okto.Silaban.Net

On Wed, Sep 10, 2008 at 12:31 AM, Yodi Aditya <[EMAIL PROTECTED]> wrote:

> I have some users table with 2 value , email and password (hash with sha1).
> Then i using auth component to make login form.
> To make sure, that auth will using sha1 when hashing password, i'm using :
> Security::setHash('sha1'); in beforeFilter().
>
> Problem happen when Auth hashing password from password input form.
> Auth hashing password from input form with sha1 + security.salt. (not pure
> sha1).
> It's make different value between password input form and value in password
> table's with same words,
> example, clean password is "test".
> hashing output "test" from Auth is different with sha1 hashing in password
> table.
>
> Make clean value on security.salt will be one bad solution.
> Cause cakePHP using security.salt not only on Auth, but encrypt cookies
> too.
>
> Then, i try edit cake/libs/controller/components/auth.php.
> .
> /**
>  * Hash a password with the application's salt value (as defined with
> Configure::write('Security.salt');
>  *
>  * @param string $password Password to hash
>  * @return string Hashed password
>  * @access public
>  */
> function password($password) {
> return Security::hash($password, null, true); <--- i change this
> with false
> }
> /**
> .
>
> Problem solved. But still doubt about it.
> There are another way to make Auth hashing without security.salt ?
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Change Auth component will solve hash without salt?

2008-09-09 Thread Yodi Aditya
I have some users table with 2 value , email and password (hash with sha1).
Then i using auth component to make login form.
To make sure, that auth will using sha1 when hashing password, i'm using :
Security::setHash('sha1'); in beforeFilter().

Problem happen when Auth hashing password from password input form.
Auth hashing password from input form with sha1 + security.salt. (not pure
sha1).
It's make different value between password input form and value in password
table's with same words,
example, clean password is "test".
hashing output "test" from Auth is different with sha1 hashing in password
table.

Make clean value on security.salt will be one bad solution.
Cause cakePHP using security.salt not only on Auth, but encrypt cookies too.

Then, i try edit cake/libs/controller/components/auth.php.
.
/**
 * Hash a password with the application's salt value (as defined with
Configure::write('Security.salt');
 *
 * @param string $password Password to hash
 * @return string Hashed password
 * @access public
 */
function password($password) {
return Security::hash($password, null, true); <--- i change this
with false
}
/**
.

Problem solved. But still doubt about it.
There are another way to make Auth hashing without security.salt ?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Allowing entire controllers with Auth component

2008-09-05 Thread jbarbede

This solution works only in this special case, for pages_controller.
For another controllers, it doesn't work.

I explain my situation: I added in my app_controller the Auth
component and configure it to allow 'display' (I suppose you've the
same tekomp):

   //Set application wide actions which do not require authentication.
   $this->Auth->allow('display');

All my static pages located in the pages folder are accessible to
public users and all others actions are limited to registered users of
my application.

Of course, I have classical functions like registration that need a
public access, so I created a public controller which contains all
public functionalities accessible to public users. I tried to make
like tekomp to allow all these functionalities:

  //Retrieve application controller configuration for the Auth
component.
  parent::beforeFilter();
  //Set application wide actions which do not require authentication.
  $this->Auth->allow('*');

It didn't work. Then I found this post and tried to use the 'display'
but the result was the same, it didn't work. The only solution which
works is the following:
  //Retrieve application controller configuration for the Auth
component.
  parent::beforeFilter();
  //Set application wide actions which do not require authentication.
  $this->Auth->allow();

The allow method without parameters works to allow all functionalities
of a controller. I read the Auth component to discover this solution

In fact, I think there is a bug in the Auth component. When you call
the parent::BeforeFilter and you set a new value to the Auth variable
allow (what I do above with a star for all cations), a merge of the
two arrays of actions (actions allowed from the app_controller and
actions allowed of the called controller) is done. It means you obtain
an array like that for your allowed actions: array('display', '*').
Till this point, there is no problem.

But now if we check the test in the Auth component which tests if an
action is allowed, we can see the following line:
  if ($loginAction != $url && ($this->allowedActions == array('*') ||
in_array($controller->action, $this->allowedActions)))...

And I think the $this->allowedActions == array('*') condition is
incorrect. I change it for this line:
  if ($loginAction != $url && (in_array('*', $this->allowedActions) ||
in_array($controller->action, $this->allowedActions)))
and now my Auth component works perfectly when I use a star to define
all actions.

Somebody to check this problem and confirm we face a bug?

On Aug 24, 2:09 pm, tekomp <[EMAIL PROTECTED]> wrote:
> I was still having a problem with it because I created my own
> pages_controller.php.  Once I copied the default one from /cake/libs/
> controller/pages_controller.php and added the snippets posted here, I
> was able to override the display action and all my "pages" didn't
> require authorization, while at the same time still have the Auth
> component work in the background.
>
> On Aug 23, 3:49 pm, tekomp <[EMAIL PROTECTED]> wrote:
>
> > I'm using the Auth Component in my app_controller.php in the
> > beforeFilter function, which is great for making people login, but I'm
> > having a hard time allowing certain pages.  I want all pages in my
> > "Pages" controller to not require authorization, so I added 
> > $this->Auth->allow('*')  in my beforeFilter in pages_controller.php.
>
> > Problem with that is that it overrides the beforeFilter in
> > app_controller.php and I cannot access $this->Auth.  I tried adding
> > parent::beforeFilter in pages_controller.php, but it then does not
> > recognize my $this->Auth->allow('*').
>
> > I've tried a number of things and read all the tutorials I could find,
> > but still can't find a way to allow an entire controller while
> > maintaining this->Auth.  It doesn't seem right that I'd have to add
> > the Auth code to each individual controller.
>
> > Any ideas?
>
> > Thanks.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component: username and password in two different models

2008-09-04 Thread Penfold

HI,

If the Auth component you have writing extends the original auth then
all is good.

the way i suggested was a stab in the dark really.

Post your comment as a feature request on trac and they might include
it.

On 4 Sep, 14:11, jbarbede <[EMAIL PROTECTED]> wrote:
> I have already try this possibility. Of course, I thought it will work
> like you but it doesn't.
>
> I read the original Auth component and it can't work because it
> considers only the userModel for the two fields even if you define
> your fields like you made it, with two different models.
>
> So I wrote an adapted Auth component to take in account two different
> models. My component allows me now to have two different models for
> the username and the password.
>
> I'm newbie with cakePHP, so I think my adapted component is not
> perfect. Maybe it could be interesting to propose this improvement to
> cakePHP team.
>
> On Sep 4, 4:50 am, Penfold <[EMAIL PROTECTED]> wrote:
>
> > This is how to change from the default.
>
> > $this->Auth->fields = array('username' => 'email', 'password' =>
> > 'passwd');
>
> > It might work if you added the model
>
> > $this->Auth->fields = array('username' => 'email.email1', 'password'
> > => 'user.passwd');
>
> > On 3 Sep, 23:37, jbarbede <[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > >   I try to use the Auth component to authentificate users but It seems
> > > I can't have a username and a password in two different models.
>
> > >   I explain the situation in details: a user can connect to the Web
> > > site with his email and his password. But my application allows a user
> > > to have several emails whose one primary to connect to the Web site.
> > > So I manage a model for users and a model for emails.
>
> > >   Someone who already solved this problem? Or the unique solution
> > > consists to modify the Auth component to integrate this particularity?
>
> > > Thanks
>
> > > Julien
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component: username and password in two different models

2008-09-04 Thread jbarbede

I have already try this possibility. Of course, I thought it will work
like you but it doesn't.

I read the original Auth component and it can't work because it
considers only the userModel for the two fields even if you define
your fields like you made it, with two different models.

So I wrote an adapted Auth component to take in account two different
models. My component allows me now to have two different models for
the username and the password.

I'm newbie with cakePHP, so I think my adapted component is not
perfect. Maybe it could be interesting to propose this improvement to
cakePHP team.

On Sep 4, 4:50 am, Penfold <[EMAIL PROTECTED]> wrote:
> This is how to change from the default.
>
> $this->Auth->fields = array('username' => 'email', 'password' =>
> 'passwd');
>
> It might work if you added the model
>
> $this->Auth->fields = array('username' => 'email.email1', 'password'
> => 'user.passwd');
>
> On 3 Sep, 23:37, jbarbede <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> >   I try to use the Auth component to authentificate users but It seems
> > I can't have a username and a password in two different models.
>
> >   I explain the situation in details: a user can connect to the Web
> > site with his email and his password. But my application allows a user
> > to have several emails whose one primary to connect to the Web site.
> > So I manage a model for users and a model for emails.
>
> >   Someone who already solved this problem? Or the unique solution
> > consists to modify the Auth component to integrate this particularity?
>
> > Thanks
>
> > Julien
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component: username and password in two different models

2008-09-04 Thread Penfold

This is how to change from the default.

$this->Auth->fields = array('username' => 'email', 'password' =>
'passwd');

It might work if you added the model

$this->Auth->fields = array('username' => 'email.email1', 'password'
=> 'user.passwd');

On 3 Sep, 23:37, jbarbede <[EMAIL PROTECTED]> wrote:
> Hello,
>
>   I try to use the Auth component to authentificate users but It seems
> I can't have a username and a password in two different models.
>
>   I explain the situation in details: a user can connect to the Web
> site with his email and his password. But my application allows a user
> to have several emails whose one primary to connect to the Web site.
> So I manage a model for users and a model for emails.
>
>   Someone who already solved this problem? Or the unique solution
> consists to modify the Auth component to integrate this particularity?
>
> Thanks
>
> Julien
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth component: username and password in two different models

2008-09-03 Thread jbarbede

Hello,

  I try to use the Auth component to authentificate users but It seems
I can't have a username and a password in two different models.

  I explain the situation in details: a user can connect to the Web
site with his email and his password. But my application allows a user
to have several emails whose one primary to connect to the Web site.
So I manage a model for users and a model for emails.

  Someone who already solved this problem? Or the unique solution
consists to modify the Auth component to integrate this particularity?

Thanks

Julien
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth Component big problem

2008-09-02 Thread drusba42

Hi I am new here and with CakePhp.
I've spent two days on searching some solution for this, but I
couldn't. The problem is that I am using Auth Component and all sites,
which needs to be authorized works greate, expect one which is specify
in loginRedirect. Everytime I trie to log in for the first time,
something strange happend with my addres :
from (http://localhost/example/index.php/users/login)
it redirects me to (http://localhost/example/index.php/http:/localhost/
example)
, insted of  (http://localhost/example/index.php/users/my) and I get
the error:

Error:  Http:Controller could not be found.

Error: Create the class Http:Controller below in file: app\controllers
\http:controller.php

The address is doubled in some way I don't know why. And after this
when i am trying to login second time everything is good. Here is a
piece of my code.

Controller: (UsersController)

var $components = array('Session','Email','Auth');

function beforeFilter()
{
parent::beforeFilter();

$this->Auth->loginAction = array('controller' => 
'users', 'action'
=> 'login');
$this->Auth->loginRedirect = array('controller' => 
'users',
'action' => 'my');
$this->Auth->allow('add', 'index');
}

Form: (users/login.ctp)

if ($session->check('Message.auth')) 
$session->flash('auth');
echo $form->create('User', array('action' => 'login'));
 echo $form->input('username');
 echo $form->input('password');
 echo $form->end('Login')

Sorry for my English, I hope that everything is clear. Please help me.
Best regards.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component on Zeus Hosting

2008-08-27 Thread AussieFreelancer

I may be wrong here, but I think I may have resolved the issue... the
security I had tried on medium and low also, but that had no impact.
This time, I have set the sessions to 'cake' as opposed to 'php' and
in the last few minutes, it has logged me in and not kicked me out
yet... time will tell, but it looks like there may have been a config
setting with the host php that was conflicting or something...

On Aug 27, 6:38 pm, RichardAtHome <[EMAIL PROTECTED]> wrote:
> I had exactly this issue before but setting the security setting from
> High to Medium fixed it for me.
>
> Check your httpd error logs for any warnings about missing files/
> images etc.
>
> On Aug 27, 11:23 am, AussieFreelancer
>
> <[EMAIL PROTECTED]> wrote:
> > ok, so no whitespace, but still not sure what is causing it.. still
> > the same issue, doesn't seem to like the sessions very much and kicks
> > me out randomly... has no-one had this before?
>
> > On Aug 7, 9:46 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>
> > > Also check for whitespace:http://bin.cakephp.org/view/1837474952
>
> > > On Thu, Aug 7, 2008 at 4:35 AM, AussieFreelancer
>
> > > <[EMAIL PROTECTED]> wrote:
>
> > > > Hmm, I changed it from High to Medium with no effect, and also to Low
> > > > without having any effect either... I will double check the links for
> > > > non-existent files, this could be something to do with it, as if i
> > > > press refresh a couple of times quickly it logs me out, not sure this
> > > > is what is happening every time, but I know that refreshing twice fast
> > > > certainly does it...
>
> > > > So no known issues with sessions and Zeus or anything like that?
>
> > > > Thanks
>
> > > > Patrick
>
> > > > On Aug 6, 6:46 pm, acoustic_overdrive <[EMAIL PROTECTED]>
> > > > wrote:
> > > >> This is probably not server-specific, but on one application I was
> > > >> building it took me ages to realise why sometimes I was getting logged
> > > >> out and other times not. I eventually realised that I had a CSS link
> > > >> that was pointing at a non-existent file, and this caused the page to
> > > >> continue trying to load it in the background. If I cancelled the page
> > > >> loading prematurely by clicking on a link and visiting another page, I
> > > >> would stay logged in. But if I allowed the page to complete its
> > > >> loading, it would log me out. When I corrected the broken link it
> > > >> behaved fine again.
>
> > > >> That was not using the latest release so perhaps newer versions are
> > > >> OK.
>
> > > >> On Aug 6, 3:21 am, AussieFreelancer <[EMAIL PROTECTED]>
> > > >> wrote:
>
> > > >> > Hello, I have a client who's website is hosted on a server powered by
> > > >> > zeus instead of apache. I have already run into issues with the
> > > >> > rewrite which are now resolved, but there seems to also be an issue
> > > >> > with the Auth components...
>
> > > >> > I have an administration panel as a plugin, which works on other
> > > >> > sites, but for some reason, on this particular site, it randomly 
> > > >> > kicks
> > > >> > the user out. Sometimes I can't even get to one page without it
> > > >> > kicking me out, other times i can update 5 things and then it will
> > > >> > kick me out... does anyone know why this is? I have security set to
> > > >> > low, I thought that maybe it was to do with that but doesn't seem to
> > > >> > have made a difference...
>
> > > >> > Would love to hear any suggestions on how to resolve this as the 
> > > >> > admin
> > > >> > panel isnt really usable until it is fixed..
>
> > > >> > Thanks
>
> > > >> > Patrick
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component on Zeus Hosting

2008-08-27 Thread RichardAtHome

I had exactly this issue before but setting the security setting from
High to Medium fixed it for me.

Check your httpd error logs for any warnings about missing files/
images etc.

On Aug 27, 11:23 am, AussieFreelancer
<[EMAIL PROTECTED]> wrote:
> ok, so no whitespace, but still not sure what is causing it.. still
> the same issue, doesn't seem to like the sessions very much and kicks
> me out randomly... has no-one had this before?
>
> On Aug 7, 9:46 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>
> > Also check for whitespace:http://bin.cakephp.org/view/1837474952
>
> > On Thu, Aug 7, 2008 at 4:35 AM, AussieFreelancer
>
> > <[EMAIL PROTECTED]> wrote:
>
> > > Hmm, I changed it from High to Medium with no effect, and also to Low
> > > without having any effect either... I will double check the links for
> > > non-existent files, this could be something to do with it, as if i
> > > press refresh a couple of times quickly it logs me out, not sure this
> > > is what is happening every time, but I know that refreshing twice fast
> > > certainly does it...
>
> > > So no known issues with sessions and Zeus or anything like that?
>
> > > Thanks
>
> > > Patrick
>
> > > On Aug 6, 6:46 pm, acoustic_overdrive <[EMAIL PROTECTED]>
> > > wrote:
> > >> This is probably not server-specific, but on one application I was
> > >> building it took me ages to realise why sometimes I was getting logged
> > >> out and other times not. I eventually realised that I had a CSS link
> > >> that was pointing at a non-existent file, and this caused the page to
> > >> continue trying to load it in the background. If I cancelled the page
> > >> loading prematurely by clicking on a link and visiting another page, I
> > >> would stay logged in. But if I allowed the page to complete its
> > >> loading, it would log me out. When I corrected the broken link it
> > >> behaved fine again.
>
> > >> That was not using the latest release so perhaps newer versions are
> > >> OK.
>
> > >> On Aug 6, 3:21 am, AussieFreelancer <[EMAIL PROTECTED]>
> > >> wrote:
>
> > >> > Hello, I have a client who's website is hosted on a server powered by
> > >> > zeus instead of apache. I have already run into issues with the
> > >> > rewrite which are now resolved, but there seems to also be an issue
> > >> > with the Auth components...
>
> > >> > I have an administration panel as a plugin, which works on other
> > >> > sites, but for some reason, on this particular site, it randomly kicks
> > >> > the user out. Sometimes I can't even get to one page without it
> > >> > kicking me out, other times i can update 5 things and then it will
> > >> > kick me out... does anyone know why this is? I have security set to
> > >> > low, I thought that maybe it was to do with that but doesn't seem to
> > >> > have made a difference...
>
> > >> > Would love to hear any suggestions on how to resolve this as the admin
> > >> > panel isnt really usable until it is fixed..
>
> > >> > Thanks
>
> > >> > Patrick
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component on Zeus Hosting

2008-08-27 Thread AussieFreelancer

ok, so no whitespace, but still not sure what is causing it.. still
the same issue, doesn't seem to like the sessions very much and kicks
me out randomly... has no-one had this before?

On Aug 7, 9:46 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> Also check for whitespace:http://bin.cakephp.org/view/1837474952
>
> On Thu, Aug 7, 2008 at 4:35 AM, AussieFreelancer
>
>
>
>
>
> <[EMAIL PROTECTED]> wrote:
>
> > Hmm, I changed it from High to Medium with no effect, and also to Low
> > without having any effect either... I will double check the links for
> > non-existent files, this could be something to do with it, as if i
> > press refresh a couple of times quickly it logs me out, not sure this
> > is what is happening every time, but I know that refreshing twice fast
> > certainly does it...
>
> > So no known issues with sessions and Zeus or anything like that?
>
> > Thanks
>
> > Patrick
>
> > On Aug 6, 6:46 pm, acoustic_overdrive <[EMAIL PROTECTED]>
> > wrote:
> >> This is probably not server-specific, but on one application I was
> >> building it took me ages to realise why sometimes I was getting logged
> >> out and other times not. I eventually realised that I had a CSS link
> >> that was pointing at a non-existent file, and this caused the page to
> >> continue trying to load it in the background. If I cancelled the page
> >> loading prematurely by clicking on a link and visiting another page, I
> >> would stay logged in. But if I allowed the page to complete its
> >> loading, it would log me out. When I corrected the broken link it
> >> behaved fine again.
>
> >> That was not using the latest release so perhaps newer versions are
> >> OK.
>
> >> On Aug 6, 3:21 am, AussieFreelancer <[EMAIL PROTECTED]>
> >> wrote:
>
> >> > Hello, I have a client who's website is hosted on a server powered by
> >> > zeus instead of apache. I have already run into issues with the
> >> > rewrite which are now resolved, but there seems to also be an issue
> >> > with the Auth components...
>
> >> > I have an administration panel as a plugin, which works on other
> >> > sites, but for some reason, on this particular site, it randomly kicks
> >> > the user out. Sometimes I can't even get to one page without it
> >> > kicking me out, other times i can update 5 things and then it will
> >> > kick me out... does anyone know why this is? I have security set to
> >> > low, I thought that maybe it was to do with that but doesn't seem to
> >> > have made a difference...
>
> >> > Would love to hear any suggestions on how to resolve this as the admin
> >> > panel isnt really usable until it is fixed..
>
> >> > Thanks
>
> >> > Patrick
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-27 Thread shabba

I also had this problem its caused because your not allowing a certain
page. Action, my problem was that I had a element that was dynamically
loading data. Instead I created a new layout just for the login that
solved the problem. Here is what my app controller looks like.

class AppController extends Controller {

var $components = array('Auth');
/**
 * Load the Authentication
 *
 * @access public
 */
function beforeFilter(){
$this->layout = 'login';
$this->Auth->loginAction = array('controller' => 'users', 
'action'
=> 'login');
$this->Auth->loginRedirect = array('controller' => 'pages', 
'action'
=> 'home');
$this->Auth->logoutRedirect = '/users/login';
$this->Auth->allow('login');
$this->Auth->authorize = 'controller';
}

function isAuthorized() {
return true;
   }
}

On Aug 25, 8:32 pm, luigi7up <[EMAIL PROTECTED]> wrote:
> Ola, everyone...
>
> //Using RC2 version of CakePHP
>
> I'm building simple application that allows users to write articles.
> So there are their corresponding models and controllers.
>
> Few days ago I made custom Login/register part of application that
> writes username to session etc. but now I decided to use Auth
> component for this purpose.
> As soon as I define:
> var $components = array('Auth');
> in my users_controller or app_controller, application stops working.
> Firefox gives following error: "Firefox has detected that the server
> is redirecting the request for this address in a way that will never
> complete." So, some infinite loop occured definitely and I'm quite
> sure that I didn't cause it :)
>
> I found few posts about this problem but none of them resolves my
> problem.
>
> The weirdest thing,to me, is that error occurs as soon as I include
> Auth component; I don't even use one method of that class ?!?
> Also another confusing part with this problem is that my other
> controllers also stop working with same output eventhough component
> Auth is included only in users_controller. User model is in
> association with articles model but I think that articles_controller
> shoud with or without component Auth included in users_controller. Am
> I wrong?
>
> My database is USERS and has fields username and password and also
> there is a model for users table.
>
> Thanks in advance
>
> Luka

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: JSON call circumvents Auth component?

2008-08-26 Thread mark_story

Not really, like the_woodsman said, parseExtensions, just indicates to
the view and controller, that the layout and view files need to be
from the js folder, to load up the jsHelper, and change the headers.
Nothing else is different from a normal request.

-Mark

On Aug 25, 1:48 pm, Jonathan Snook <[EMAIL PROTECTED]> wrote:
> I haven't had a chance to check this out in any detail and since there
> are multiple people touching this app, I just wanted to ask: is it
> possible to circumvent the Auth component by creating a request via a
> JSON call (with parseExtensions enabled)?
>
> (I know I'm being really lazy here since I haven't bothered to
> research it but just thought I'd ask and see if anybody had a quick
> answer.)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-26 Thread RichardAtHome

Sounds like the Auth component is redirecting you away from a
protected page, to another protected page - hence the loop.

In your Users controller do you have a login action?

On Aug 26, 9:19 am, luigi7up <[EMAIL PROTECTED]> wrote:
> I'll try this. I read about this but I thought they were talking about
> other databases and not MySql.
> thx...
>
> On Aug 26, 8:57 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > I have had situations in which I was unable to use a column named
> > "password" and had to instead use something like "passwd".  I believe
> > it is a reserved keyword issue with MySQL?  Not sure if it was just
> > related to an older version, but you might at least try changing the
> > column name.
>
> > -Aran
>
> > On Aug 25, 12:32 pm, luigi7up <[EMAIL PROTECTED]> wrote:
>
> > > Ola, everyone...
>
> > > //Using RC2 version of CakePHP
>
> > > I'm building simple application that allows users to write articles.
> > > So there are their corresponding models and controllers.
>
> > > Few days ago I made custom Login/register part of application that
> > > writes username to session etc. but now I decided to use Auth
> > > component for this purpose.
> > > As soon as I define:
> > > var $components = array('Auth');
> > > in my users_controller or app_controller, application stops working.
> > > Firefox gives following error: "Firefox has detected that the server
> > > is redirecting the request for this address in a way that will never
> > > complete." So, some infinite loop occured definitely and I'm quite
> > > sure that I didn't cause it :)
>
> > > I found few posts about this problem but none of them resolves my
> > > problem.
>
> > > The weirdest thing,to me, is that error occurs as soon as I include
> > > Auth component; I don't even use one method of that class ?!?
> > > Also another confusing part with this problem is that my other
> > > controllers also stop working with same output eventhough component
> > > Auth is included only in users_controller. User model is in
> > > association with articles model but I think that articles_controller
> > > shoud with or without component Auth included in users_controller. Am
> > > I wrong?
>
> > > My database is USERS and has fields username and password and also
> > > there is a model for users table.
>
> > > Thanks in advance
>
> > > Luka
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-26 Thread luigi7up

I think I know what's causing the problem.

I have a ELEMENT that is calling index() action of users_controller to
get some data from users model and in index() function I have:

$users = $this->paginate();

if(isset($this->params['requested'])) {
return $users;
}
$this->set('users', $users);

If I comment this there are no errors?!?

My element looks like this:

$users = $this->requestAction('users/index/sort:id/direction:desc/
limit:5');

foreach($users as $user):
echo $user['User']['username'];
echo '';
endforeach;


Hope this helps...

Luka




In my users_controller I have index() action

On Aug 25, 9:36 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Mon, Aug 25, 2008 at 3:32 PM, luigi7up <[EMAIL PROTECTED]> wrote:
> > I found few posts about this problem but none of them resolves my
> > problem.
>
> Really hard to diagnose without seeing any code.  Have you tried
> looking at this fantastic tutorial on using the Auth component?
>
> http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful...
>
> There are some other links there that deal with the Auth component as well.
>
> --
> Chris Hartjes
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-26 Thread luigi7up

What about this:

Also another confusing part with this problem is that my other
controllers also stop working with same output eventhough component
Auth is included only in users_controller. User model is in
association with articles model but I think that articles_controller
shoud with or without component Auth included in users_controller. Am
I wrong?




On Aug 25, 9:36 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Mon, Aug 25, 2008 at 3:32 PM, luigi7up <[EMAIL PROTECTED]> wrote:
> > I found few posts about this problem but none of them resolves my
> > problem.
>
> Really hard to diagnose without seeing any code.  Have you tried
> looking at this fantastic tutorial on using the Auth component?
>
> http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful...
>
> There are some other links there that deal with the Auth component as well.
>
> --
> Chris Hartjes
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-26 Thread luigi7up

I'll try this. I read about this but I thought they were talking about
other databases and not MySql.
thx...

On Aug 26, 8:57 am, aranworld <[EMAIL PROTECTED]> wrote:
> I have had situations in which I was unable to use a column named
> "password" and had to instead use something like "passwd".  I believe
> it is a reserved keyword issue with MySQL?  Not sure if it was just
> related to an older version, but you might at least try changing the
> column name.
>
> -Aran
>
> On Aug 25, 12:32 pm, luigi7up <[EMAIL PROTECTED]> wrote:
>
> > Ola, everyone...
>
> > //Using RC2 version of CakePHP
>
> > I'm building simple application that allows users to write articles.
> > So there are their corresponding models and controllers.
>
> > Few days ago I made custom Login/register part of application that
> > writes username to session etc. but now I decided to use Auth
> > component for this purpose.
> > As soon as I define:
> > var $components = array('Auth');
> > in my users_controller or app_controller, application stops working.
> > Firefox gives following error: "Firefox has detected that the server
> > is redirecting the request for this address in a way that will never
> > complete." So, some infinite loop occured definitely and I'm quite
> > sure that I didn't cause it :)
>
> > I found few posts about this problem but none of them resolves my
> > problem.
>
> > The weirdest thing,to me, is that error occurs as soon as I include
> > Auth component; I don't even use one method of that class ?!?
> > Also another confusing part with this problem is that my other
> > controllers also stop working with same output eventhough component
> > Auth is included only in users_controller. User model is in
> > association with articles model but I think that articles_controller
> > shoud with or without component Auth included in users_controller. Am
> > I wrong?
>
> > My database is USERS and has fields username and password and also
> > there is a model for users table.
>
> > Thanks in advance
>
> > Luka
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-26 Thread luigi7up

I tried few great tutorials but I'll try this one too.

thanx

On Aug 25, 9:36 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Mon, Aug 25, 2008 at 3:32 PM, luigi7up <[EMAIL PROTECTED]> wrote:
> > I found few posts about this problem but none of them resolves my
> > problem.
>
> Really hard to diagnose without seeing any code.  Have you tried
> looking at this fantastic tutorial on using the Auth component?
>
> http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful...
>
> There are some other links there that deal with the Auth component as well.
>
> --
> Chris Hartjes
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-25 Thread aranworld

I have had situations in which I was unable to use a column named
"password" and had to instead use something like "passwd".  I believe
it is a reserved keyword issue with MySQL?  Not sure if it was just
related to an older version, but you might at least try changing the
column name.

-Aran

On Aug 25, 12:32 pm, luigi7up <[EMAIL PROTECTED]> wrote:
> Ola, everyone...
>
> //Using RC2 version of CakePHP
>
> I'm building simple application that allows users to write articles.
> So there are their corresponding models and controllers.
>
> Few days ago I made custom Login/register part of application that
> writes username to session etc. but now I decided to use Auth
> component for this purpose.
> As soon as I define:
> var $components = array('Auth');
> in my users_controller or app_controller, application stops working.
> Firefox gives following error: "Firefox has detected that the server
> is redirecting the request for this address in a way that will never
> complete." So, some infinite loop occured definitely and I'm quite
> sure that I didn't cause it :)
>
> I found few posts about this problem but none of them resolves my
> problem.
>
> The weirdest thing,to me, is that error occurs as soon as I include
> Auth component; I don't even use one method of that class ?!?
> Also another confusing part with this problem is that my other
> controllers also stop working with same output eventhough component
> Auth is included only in users_controller. User model is in
> association with articles model but I think that articles_controller
> shoud with or without component Auth included in users_controller. Am
> I wrong?
>
> My database is USERS and has fields username and password and also
> there is a model for users table.
>
> Thanks in advance
>
> Luka
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-25 Thread Chris Hartjes

On Mon, Aug 25, 2008 at 3:32 PM, luigi7up <[EMAIL PROTECTED]> wrote:
> I found few posts about this problem but none of them resolves my
> problem.

Really hard to diagnose without seeing any code.  Have you tried
looking at this fantastic tutorial on using the Auth component?

http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/

There are some other links there that deal with the Auth component as well.

-- 
Chris Hartjes
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth Component - I'm going crazy

2008-08-25 Thread luigi7up

Ola, everyone...

//Using RC2 version of CakePHP

I'm building simple application that allows users to write articles.
So there are their corresponding models and controllers.

Few days ago I made custom Login/register part of application that
writes username to session etc. but now I decided to use Auth
component for this purpose.
As soon as I define:
var $components = array('Auth');
in my users_controller or app_controller, application stops working.
Firefox gives following error: "Firefox has detected that the server
is redirecting the request for this address in a way that will never
complete." So, some infinite loop occured definitely and I'm quite
sure that I didn't cause it :)

I found few posts about this problem but none of them resolves my
problem.

The weirdest thing,to me, is that error occurs as soon as I include
Auth component; I don't even use one method of that class ?!?
Also another confusing part with this problem is that my other
controllers also stop working with same output eventhough component
Auth is included only in users_controller. User model is in
association with articles model but I think that articles_controller
shoud with or without component Auth included in users_controller. Am
I wrong?

My database is USERS and has fields username and password and also
there is a model for users table.

Thanks in advance

Luka

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: JSON call circumvents Auth component?

2008-08-25 Thread the_woodsman

I haven't done your expieriment for you, but I don't see how this
could circumvent secuirty - parseExtensions applies to which views get
rendered, and Auth is done way before that, surely?

On Aug 25, 6:48 pm, Jonathan Snook <[EMAIL PROTECTED]> wrote:
> I haven't had a chance to check this out in any detail and since there
> are multiple people touching this app, I just wanted to ask: is it
> possible to circumvent the Auth component by creating a request via a
> JSON call (with parseExtensions enabled)?
>
> (I know I'm being really lazy here since I haven't bothered to
> research it but just thought I'd ask and see if anybody had a quick
> answer.)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



JSON call circumvents Auth component?

2008-08-25 Thread Jonathan Snook

I haven't had a chance to check this out in any detail and since there
are multiple people touching this app, I just wanted to ask: is it
possible to circumvent the Auth component by creating a request via a
JSON call (with parseExtensions enabled)?

(I know I'm being really lazy here since I haven't bothered to
research it but just thought I'd ask and see if anybody had a quick
answer.)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Allowing entire controllers with Auth component

2008-08-25 Thread Sam Sherlock
try
$this->Auth->allow(array('display'));
parent::beforeFilter();

2008/8/23 tekomp <[EMAIL PROTECTED]>

>
> I'm using the Auth Component in my app_controller.php in the
> beforeFilter function, which is great for making people login, but I'm
> having a hard time allowing certain pages.  I want all pages in my
> "Pages" controller to not require authorization, so I added $this-
> >Auth->allow('*')  in my beforeFilter in pages_controller.php.
> Problem with that is that it overrides the beforeFilter in
> app_controller.php and I cannot access $this->Auth.  I tried adding
> parent::beforeFilter in pages_controller.php, but it then does not
> recognize my $this->Auth->allow('*').
>
> I've tried a number of things and read all the tutorials I could find,
> but still can't find a way to allow an entire controller while
> maintaining this->Auth.  It doesn't seem right that I'd have to add
> the Auth code to each individual controller.
>
> Any ideas?
>
> Thanks.
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component admin login redirect for unauthorized page access

2008-08-24 Thread mario

Thanks Marcin. I solve the problem by using $this->Auth->loginAction()
of the Auth Component.


On Aug 24, 9:02 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
> C'mon man- do some searching. I suggest looking at the api at auth
> component properties.
> HTH
>
> 2008/8/24,mario<[EMAIL PROTECTED]>:
>
>
>
>
>
>
>
> > Hello,
>
> > How can I configure the Auth component so that
> > it will redirect me to the login action of my admins_controller
> > everytime someone access an unauthorized page?
>
> > I see that it redirects me to the login action of my user_controller
> > which I don't want to happen.
>
> > Here is a snippet of my app_controller.php
>
> >  > class AppController extends Controller {
> >    var $components = array('Auth');
> >    function beforeFilter()
> >    {
> >            $this->Auth->loginRedirect = array('controller' => 'mainpage',
> > 'action' => 'home');
> >            $this->Auth->logoutRedirect = array('controller' => 'mainpage',
> > 'action' => 'home');
> >            $this->Auth->allow('home');
> >            $this->Auth->authorize = 'controller';
> >            $this->set('loggedIn', $this->Auth->user('id'));
> >    }
> >    function isAuthorized()
> >    {
> >                    return true;
> >    }
> > }
> > ?>
>
> > Thanks,
>
> >Mario
>
> --
> Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Allowing entire controllers with Auth component

2008-08-24 Thread tekomp

I was still having a problem with it because I created my own
pages_controller.php.  Once I copied the default one from /cake/libs/
controller/pages_controller.php and added the snippets posted here, I
was able to override the display action and all my "pages" didn't
require authorization, while at the same time still have the Auth
component work in the background.

On Aug 23, 3:49 pm, tekomp <[EMAIL PROTECTED]> wrote:
> I'm using the Auth Component in my app_controller.php in the
> beforeFilter function, which is great for making people login, but I'm
> having a hard time allowing certain pages.  I want all pages in my
> "Pages" controller to not require authorization, so I added 
> $this->Auth->allow('*')  in my beforeFilter in pages_controller.php.
>
> Problem with that is that it overrides the beforeFilter in
> app_controller.php and I cannot access $this->Auth.  I tried adding
> parent::beforeFilter in pages_controller.php, but it then does not
> recognize my $this->Auth->allow('*').
>
> I've tried a number of things and read all the tutorials I could find,
> but still can't find a way to allow an entire controller while
> maintaining this->Auth.  It doesn't seem right that I'd have to add
> the Auth code to each individual controller.
>
> Any ideas?
>
> Thanks.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component admin login redirect for unauthorized page access

2008-08-24 Thread Marcin Domanski

C'mon man- do some searching. I suggest looking at the api at auth
component properties.
HTH

2008/8/24, mario <[EMAIL PROTECTED]>:
>
> Hello,
>
> How can I configure the Auth component so that
> it will redirect me to the login action of my admins_controller
> everytime someone access an unauthorized page?
>
> I see that it redirects me to the login action of my user_controller
> which I don't want to happen.
>
> Here is a snippet of my app_controller.php
>
>  class AppController extends Controller {
>   var $components = array('Auth');
>   function beforeFilter()
>   {
>   $this->Auth->loginRedirect = array('controller' => 'mainpage',
> 'action' => 'home');
>   $this->Auth->logoutRedirect = array('controller' => 'mainpage',
> 'action' => 'home');
>   $this->Auth->allow('home');
>   $this->Auth->authorize = 'controller';
>   $this->set('loggedIn', $this->Auth->user('id'));
>   }
>   function isAuthorized()
>   {
>   return true;
>   }
> }
> ?>
>
> Thanks,
>
> Mario
>
>
> >
>


-- 
Marcin Domanski
http://kabturek.info

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth Component admin login redirect for unauthorized page access

2008-08-24 Thread mario

Hello,

How can I configure the Auth component so that
it will redirect me to the login action of my admins_controller
everytime someone access an unauthorized page?

I see that it redirects me to the login action of my user_controller
which I don't want to happen.

Here is a snippet of my app_controller.php

Auth->loginRedirect = array('controller' => 'mainpage',
'action' => 'home');
$this->Auth->logoutRedirect = array('controller' => 'mainpage',
'action' => 'home');
$this->Auth->allow('home');
$this->Auth->authorize = 'controller';
$this->set('loggedIn', $this->Auth->user('id'));
}
function isAuthorized()
{
return true;
}
}
?>

Thanks,

Mario


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Allowing entire controllers with Auth component

2008-08-24 Thread RichardAtHome

I'd do it this way round:

parent::beforeFilter();
$this->Auth->allow(array('display'));

So the controllers can override settings in AppController

On Aug 24, 8:44 am, tekomp <[EMAIL PROTECTED]> wrote:
> Thanks Sam.  Got it to work after realizing that "display" is a built-
> in action to the built-in pages controller.
>
> On Aug 23, 8:22 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
>
> > try
> >         $this->Auth->allow(array('display'));
> >         parent::beforeFilter();
>
> > 2008/8/23 tekomp <[EMAIL PROTECTED]>
>
> > > I'm using the Auth Component in my app_controller.php in the
> > > beforeFilter function, which is great for making people login, but I'm
> > > having a hard time allowing certain pages.  I want all pages in my
> > > "Pages" controller to not require authorization, so I added $this-
> > > >Auth->allow('*')  in my beforeFilter in pages_controller.php.
> > > Problem with that is that it overrides the beforeFilter in
> > > app_controller.php and I cannot access $this->Auth.  I tried adding
> > > parent::beforeFilter in pages_controller.php, but it then does not
> > > recognize my $this->Auth->allow('*').
>
> > > I've tried a number of things and read all the tutorials I could find,
> > > but still can't find a way to allow an entire controller while
> > > maintaining this->Auth.  It doesn't seem right that I'd have to add
> > > the Auth code to each individual controller.
>
> > > Any ideas?
>
> > > Thanks.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Allowing entire controllers with Auth component

2008-08-24 Thread tekomp

Thanks Sam.  Got it to work after realizing that "display" is a built-
in action to the built-in pages controller.

On Aug 23, 8:22 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> try
>         $this->Auth->allow(array('display'));
>         parent::beforeFilter();
>
> 2008/8/23 tekomp <[EMAIL PROTECTED]>
>
>
>
> > I'm using the Auth Component in my app_controller.php in the
> > beforeFilter function, which is great for making people login, but I'm
> > having a hard time allowing certain pages.  I want all pages in my
> > "Pages" controller to not require authorization, so I added $this-
> > >Auth->allow('*')  in my beforeFilter in pages_controller.php.
> > Problem with that is that it overrides the beforeFilter in
> > app_controller.php and I cannot access $this->Auth.  I tried adding
> > parent::beforeFilter in pages_controller.php, but it then does not
> > recognize my $this->Auth->allow('*').
>
> > I've tried a number of things and read all the tutorials I could find,
> > but still can't find a way to allow an entire controller while
> > maintaining this->Auth.  It doesn't seem right that I'd have to add
> > the Auth code to each individual controller.
>
> > Any ideas?
>
> > Thanks.
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Allowing entire controllers with Auth component

2008-08-23 Thread tekomp

I'm using the Auth Component in my app_controller.php in the
beforeFilter function, which is great for making people login, but I'm
having a hard time allowing certain pages.  I want all pages in my
"Pages" controller to not require authorization, so I added $this-
>Auth->allow('*')  in my beforeFilter in pages_controller.php.
Problem with that is that it overrides the beforeFilter in
app_controller.php and I cannot access $this->Auth.  I tried adding
parent::beforeFilter in pages_controller.php, but it then does not
recognize my $this->Auth->allow('*').

I've tried a number of things and read all the tutorials I could find,
but still can't find a way to allow an entire controller while
maintaining this->Auth.  It doesn't seem right that I'd have to add
the Auth code to each individual controller.

Any ideas?

Thanks.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Problem with auth component

2008-07-25 Thread Intellex

Hey i am having a problem ... every thing is going fine except the
redirect url ... Cake is saving the referer address in Session
"Auth.redirect" but its not accurate ... its not giving correct url of
controller ... instead its just giving an "s" in place of controller
name ... example ... when i try to access localhost/recipe/recipes/add
(recipes is controller) it moves to localhost/recipe/users/login after
successfull authentication it redirects me to localhost/recipe/s/
add ... I am clueless why cake isnt getting correct url ... plz 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: curl_exec and auth component (one for the brainiacs)

2008-07-16 Thread Chris Hartjes

On Wed, Jul 16, 2008 at 12:51 PM, michaelmcandrew (aka Milky Joe)
<[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I've got so far with debugging this but can't get any further.
> Appreciate that this post might not have the info you need, but it
> would be great for some pointers on how I could go about solving this
> - I've hit a wall.
>
> I'm using cURL to make a call to a paypal server.  It works fine until
> I start using the Auth component in the controller that makes the
> call.
>
> Then (even when I have $this->Auth->allow('*'); in the beforeFilter)
> curl_exec fails.
>
> My curl_init and curl_setopt functions are all working fine.
>
> Cheers if you can help.
> Michael
>
> Here is the relevant code:  Anything else you would like to know?

In the future, I suggest you use http://bin.cakephp.org to paste those
code samples into, instead of putting it in the body of the message.

Just a little mailing list etiquette, that's all.

-- 
Chris Hartjes
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



curl_exec and auth component (one for the brainiacs)

2008-07-16 Thread michaelmcandrew (aka Milky Joe)

Hi all,

I've got so far with debugging this but can't get any further.
Appreciate that this post might not have the info you need, but it
would be great for some pointers on how I could go about solving this
- I've hit a wall.

I'm using cURL to make a call to a paypal server.  It works fine until
I start using the Auth component in the controller that makes the
call.

Then (even when I have $this->Auth->allow('*'); in the beforeFilter)
curl_exec fails.

My curl_init and curl_setopt functions are all working fine.

Cheers if you can help.
Michael

Here is the relevant code:  Anything else you would like to know?

var $components = array('Email', 'Auth');

function beforeFilter() {
$this->Auth->allow('*');
}

function _fetchData($unique_id, $submiturl, $data) {
// get data ready for API
$user_agent = $_SERVER['HTTP_USER_AGENT'];
// Here's your custom headers; adjust appropriately for your 
setup:
$headers[] = "Content-Type: text/namevalue"; //or text/xml if 
using
XMLPay.
$headers[] = "Content-Length : " . strlen ($data);  // Length of
data to be passed
// Here I set the server timeout value to 45, but notice below 
in
the cURL section, I set the timeout
// for cURL to 90 seconds.  You want to make sure the server 
timeout
is less, then the connection.
$headers[] = "X-VPS-Timeout: 45";
$headers[] = "X-VPS-Request-ID:" . $unique_id;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $submiturl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_HEADER, 1);// tells 
curl to
include headers in response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);// return 
into a
variable
curl_setopt($ch, CURLOPT_TIMEOUT, 90);  // times out
after 90 secs
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);// this line
makes it work under https
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);//adding 
POST
data
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,  2);   //verifies 
ssl
certificate
curl_setopt($ch, CURLOPT_FORBID_REUSE, TRUE);   //forces 
closure
of connection when done
curl_setopt($ch, CURLOPT_POST, 1);  
//data sent as POST

$i=1;
while ($i++ <= 1) {
$result = curl_exec($ch);
$headers = curl_getinfo($ch);
if ($headers['http_code'] != 200) {
sleep(5);  // Let's wait 5 seconds to see if 
its a temporary
network issue.
} else if ($headers['http_code'] == 200) {
break;
}
}
if ($headers['http_code'] != 200) {
echo 'General Error!';
echo 'Unable to receive response from PayPal 
server.';
echo 'Verify host URL of '.$submiturl.' and check 
for firewall/
proxy issues.';
curl_close($ch);
exit;
}
curl_close($ch);
$result = strstr($result, "RESULT");
// echo $result;
// prepare responses into array
$proArray = array();
while(strlen($result)){
// name
$keypos= strpos($result,'=');
$keyval = substr($result,0,$keypos);
// value
$valuepos = strpos($result,'&') ? strpos($result,'&'):
strlen($result);
$valval = substr($result,$keypos+1,$valuepos-$keypos-1);
// decoding the respose
$proArray[$keyval] = $valval;
$result = substr($result,$valuepos+1,strlen($result));
}
return $proArray;
}




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using Auth Component from behavior

2008-07-07 Thread Novice Programmer
Here is a post where nate suggests a way to model sessions..

http://groups.google.com/group/cake-php/browse_thread/thread/8911d61137f80eb5/00217852f762f67c?lnk=gst&q=novice.program+session+model#00217852f762f67c

Thanks.


On 7/7/08, francky06l <[EMAIL PROTECTED]> wrote:
>
>
> Session in not available in models. The best in your case would be to
> pass the parameters to the behavior from controller.
> hth
>
> On Jul 7, 2:05 pm, "Siegfried Hirsch" <[EMAIL PROTECTED]>
> wrote:
> > Hello,
> >
> > just a simple question, I guess:
> >
> > How could I load the AuthComponent from a behavior, that I am writing ?
> >
> > I think it should work with something like:
> >
> >App::import('Component', 'AuthComponent');
> >$this->Auth = new AuthComponent();
> > from within the behavior.
> >
> > But if I want to call it like this:
> >   $user = $this->Auth->user();
> > I get a Undefined property:  AuthComponent::$Session
> >
> > Any hints ?
> >
> > Thanks and sorry for the other incomplete posting in the list.
> >
> > Siegfried
> >
>


-- 
Thanks & Regards,
Novice.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using Auth Component from behavior

2008-07-07 Thread francky06l

Session in not available in models. The best in your case would be to
pass the parameters to the behavior from controller.
hth

On Jul 7, 2:05 pm, "Siegfried Hirsch" <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> just a simple question, I guess:
>
> How could I load the AuthComponent from a behavior, that I am writing ?
>
> I think it should work with something like:
>
>App::import('Component', 'AuthComponent');
>$this->Auth = new AuthComponent();
> from within the behavior.
>
> But if I want to call it like this:
>   $user = $this->Auth->user();
> I get a Undefined property:  AuthComponent::$Session
>
> Any hints ?
>
> Thanks and sorry for the other incomplete posting in the list.
>
> Siegfried
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Using Auth Component from behavior

2008-07-07 Thread Siegfried Hirsch

Hello,

just a simple question, I guess:

How could I load the AuthComponent from a behavior, that I am writing ?

I think it should work with something like:

   App::import('Component', 'AuthComponent');
   $this->Auth = new AuthComponent();
from within the behavior.

But if I want to call it like this:
  $user = $this->Auth->user();
I get a Undefined property:  AuthComponent::$Session

Any hints ?

Thanks and sorry for the other incomplete posting in the list.

Siegfried

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Using Auth Component from behavior

2008-07-07 Thread Siegfried Hirsch

Hello,

just a simple question, I guess:

How could I load the AuthComponent from a behavior, that I am writing ?

I think it should work with something like:

App::import('Component', 'AuthComponent');
$this->Auth = new AuthComponent();

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $loginRedirect in the Auth component does not work?

2008-06-30 Thread wil

I was having this problem and then set debug = 3 and which seems to
have resolved it.  Maybe a cache issue?


On Jun 24, 4:03 pm, deltawing <[EMAIL PROTECTED]> wrote:
> I tried setting $loginRedirectin theAuthcomponent but it doesn't
> seem to work. No matter what I set the variable to, Cake will always
> redirect to the last page that I was at prior to logging in.
>
> Anyone have any ideas on why?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: User Account Administration using Auth Component - Password reset/Forgot Password Functionality

2008-06-29 Thread Chris Hartjes

On Sun, Jun 29, 2008 at 12:03 PM, Maro <[EMAIL PROTECTED]> wrote:
>if(strcmp($phrase,$createdHash) == 0)
>{
>
>
> if(!empty($this->Auth->data['User']['password_confirm']))
>{
>if 
> ($this->Auth->data['User']['password'] == $this->Auth-
>>data['User']['password_confirm'])
>{
>
> $this->User->confirmPassword($this->data);
>$this->User->saveField('password',$this->Auth-
>>data['User']['password'],true);
>

Hi there, I noticed a few things.

Unless they changed things dramatically in the latest RC releases for
1.2, you should be using $this->data['User']['password'] not
$this->Auth->data['User']['password'].

Secondly, Auth automatically hashes the contents of your User password
input field if you pass data in the User 'username' field.  In order
to make your "password confirm" field work, you have to also hash the
password_confirm field.  Try this

if ($this->data['User']['password'] ==
$this->Auth->password($this->data['User']['password_confirm'])

as your check.

I recently added that info to book.cakephp.org in the Auth component
section.  Hope that helps.


-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



User Account Administration using Auth Component - Password reset/Forgot Password Functionality

2008-06-29 Thread Maro

I'm trying to to allow users to update their password should they
forget it using a "Forget Password" link which maps to method
resetPassword().  I am using the Auth component and when registering a
new user and saving the account details to the database the password
is automattically encrypted and saved properly using the register()
method.  However, in this case when resetting the password I can not
get the same encryption of password to occur.  Please advise on how i
can get this password encrypted.


function resetPassword($id,$phrase) {
//  Next feature for implementation   To be debugged
$this->User->id = $id;
$this->data = $this->User->read();

$this->set('phrase', $phrase);

$createdHash = md5($this->data['User']['password'].$this-
>data['User']['created']);

if(strcmp($phrase,$createdHash) == 0)
{


if(!empty($this->Auth->data['User']['password_confirm']))
{
if 
($this->Auth->data['User']['password'] == $this->Auth-
>data['User']['password_confirm'])
{

$this->User->confirmPassword($this->data);
$this->User->saveField('password',$this->Auth-
>data['User']['password'],true);


$this->flash("Your password has been updated."  
,"/
users/login",5);
exit();
}
else
{
$this->flash("Your password reset failed.  
Please make
sure your passwords match."  ,"/users/resetPassword/".$id."/".$phrase,
5);
}
}
else
{
$this->data['User']['password'] = "";


}

}
else
{
$this->data['User']['password']="";
$this->flash("You do not have permission to reset the password
for this user.  If you think you have received this message in error
please verify the link provided in your reset request e-mail."  ,"/
users/Roda/",5);
exit();

}
}



-


function register() {
print_r(debug($this));
if (!empty($this->data)) {
if ($this->User->confirmPassword($this->data)){
$this->User->create();
if($this->User->save($this->data))//;
{
$this->_sendRegistrantConfirmationMail($this-
>data['User']['username']);
$this->flash("Thank you for registering.  You must
verify your registration in order to login to your account.  An email
verificaiton has been sent your email at ". $this->data['User']
['username'],"/users/login",5);
}
}
}
$this->data['User']['password']='';
$this->data['User']['password_confirm']='';
}
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component the most failment of Cakephp

2008-06-26 Thread Alessio

dear, believe me, that I have taken all possibilities...and calling
the parent class...

I don't know...
Sometimes Auth gives me errors...
I am testing..
I am deciding if pass to manual management of users...
I will see...
Bye

On Jun 25, 9:28 pm, the_woodsman <[EMAIL PROTECTED]> wrote:
> Just throwing one thing out there:
>
> Often when I have a problem in only one controller, it's because I'm
> overriding the constructor or the beforeFilter, and forgetting to call
> the parent class version too...
>
> Any chance this is relevant?
>
> On Jun 25, 2:22 pm, Alessio <[EMAIL PROTECTED]> wrote:
>
>
>
> > yes with security level is set to high.
> > The ajax question is good..
> > I have a return in the BeforeFilter...
> > If request comes from ajax I return...
> > I had a lot of notices...unable to unlink file in cache..and blah-..
>
> > I dont know how but this lesson was very useful to clean all my
> > code...
> > I discovered that many times the code in beforeFilter is triggered
> > many times...so I have put some condition...
>
> > beforeFilter is called always, if you use ajax , maybe you don't
> > need ...or maybe you need... depend of your application...
> > for example i use comment in ajax...if you force the loggin
>
> > I don't know how but now it works...
> > I recreate all my site..with rc1..and clean a lot the code...
>
> > Essentially I learned this..that if the beforeFilter triggers two
> > times, the auth component becomes instable...
>
> > So you have to check all your code...
>
> > for example in my application i had an image not present in server...
> > so the controller triggered more times...
> > and the auth went to be crazy...
>
> > REply to Chris..
>
> > I am use this logic..because I process all request... and my
> > application is built only for seo criterials...
>
> > also the forum...
>
> > surely with normal management the auth would work greatly...
>
> > Thanks to all.
>
> > On 25 Giu, 00:21, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > I guess if this Auth->user() looses the user, it's linked to session.
> > > What are you security.level in core ? What is your check.agent (do you
> > > do lot's of ajax ?). Do you have some other "notices, warnings"
> > > before ?
>
> > > On Jun 24, 5:30 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > > > I'm curious to know why you are routing everything to the
> > > > Contents_Controller rather than just put the functionality of the
> > > > Contents_Controller into the app_controller?
>
> > > > I think that one of the frustrations people have with the Auth
> > > > component is that when a problem crops up, it can take a lot of
> > > > digging around to solve.  I don't think this is a critique of the
> > > > component, but in the heat of the moment, I think people just get
> > > > frustrated when something isn't "just working".
>
> > > > On Jun 23, 6:45 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > > > > On Mon, Jun 23, 2008 at 9:33 PM, Alessio <[EMAIL PROTECTED]> wrote:
>
> > > > > > Ok thanks Chris...
> > > > > > I believe that you have not problems with the component...
>
> > > > > I wasn't try to be snarky or anything, but I realize it might come
> > > > > across that way.  I just never run into those problems with Auth that
> > > > > people report.  Again, I keep things very simple and haven't gone
> > > > > wrong with that approach.
>
> > > > > > Maybe I have found the reason...
> > > > > > I believe that it doesn't work when you use a particular route::
> > > > > >                // Custom URL route
> > > > > >  Router::connect('/*', array('controller' => 'contents', 'action' =>
> > > > > > 'ProcessAllRequest'));
>
> > > > > > Essentially when in my site the user write something, I redirect all
> > > > > > to the Content_Controller...
>
> > > > > > So When, the user enter in mycontroller by route, the component 
> > > > > > forces
> > > > > > to logout...
>
> > > > > Why would you do it that way?  Is there a requirement that every
> > > > > single request has to go through ju

Re: Auth Component the most failment of Cakephp

2008-06-25 Thread the_woodsman

Just throwing one thing out there:

Often when I have a problem in only one controller, it's because I'm
overriding the constructor or the beforeFilter, and forgetting to call
the parent class version too...

Any chance this is relevant?



On Jun 25, 2:22 pm, Alessio <[EMAIL PROTECTED]> wrote:
> yes with security level is set to high.
> The ajax question is good..
> I have a return in the BeforeFilter...
> If request comes from ajax I return...
> I had a lot of notices...unable to unlink file in cache..and blah-..
>
> I dont know how but this lesson was very useful to clean all my
> code...
> I discovered that many times the code in beforeFilter is triggered
> many times...so I have put some condition...
>
> beforeFilter is called always, if you use ajax , maybe you don't
> need ...or maybe you need... depend of your application...
> for example i use comment in ajax...if you force the loggin
>
> I don't know how but now it works...
> I recreate all my site..with rc1..and clean a lot the code...
>
> Essentially I learned this..that if the beforeFilter triggers two
> times, the auth component becomes instable...
>
> So you have to check all your code...
>
> for example in my application i had an image not present in server...
> so the controller triggered more times...
> and the auth went to be crazy...
>
> REply to Chris..
>
> I am use this logic..because I process all request... and my
> application is built only for seo criterials...
>
> also the forum...
>
> surely with normal management the auth would work greatly...
>
> Thanks to all.
>
> On 25 Giu, 00:21, francky06l <[EMAIL PROTECTED]> wrote:
>
> > I guess if this Auth->user() looses the user, it's linked to session.
> > What are you security.level in core ? What is your check.agent (do you
> > do lot's of ajax ?). Do you have some other "notices, warnings"
> > before ?
>
> > On Jun 24, 5:30 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > > I'm curious to know why you are routing everything to the
> > > Contents_Controller rather than just put the functionality of the
> > > Contents_Controller into the app_controller?
>
> > > I think that one of the frustrations people have with the Auth
> > > component is that when a problem crops up, it can take a lot of
> > > digging around to solve.  I don't think this is a critique of the
> > > component, but in the heat of the moment, I think people just get
> > > frustrated when something isn't "just working".
>
> > > On Jun 23, 6:45 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > > > On Mon, Jun 23, 2008 at 9:33 PM, Alessio <[EMAIL PROTECTED]> wrote:
>
> > > > > Ok thanks Chris...
> > > > > I believe that you have not problems with the component...
>
> > > > I wasn't try to be snarky or anything, but I realize it might come
> > > > across that way.  I just never run into those problems with Auth that
> > > > people report.  Again, I keep things very simple and haven't gone
> > > > wrong with that approach.
>
> > > > > Maybe I have found the reason...
> > > > > I believe that it doesn't work when you use a particular route::
> > > > >                // Custom URL route
> > > > >  Router::connect('/*', array('controller' => 'contents', 'action' =>
> > > > > 'ProcessAllRequest'));
>
> > > > > Essentially when in my site the user write something, I redirect all
> > > > > to the Content_Controller...
>
> > > > > So When, the user enter in mycontroller by route, the component forces
> > > > > to logout...
>
> > > > Why would you do it that way?  Is there a requirement that every
> > > > single request has to go through just one controller?  It makes no
> > > > sense to me, but I probably don't understand the problem you are
> > > > trying to solve.
>
> > > > > Essentially I say to the auth component to allow all request of
> > > > > COntent_controller...
> > > > > But I saw after many hour of debugging that the Auth COmponent is not
> > > > > able to manage this situation...
>
> > > > I think (again, just my opinion) you are trying to use Auth for
> > > > something it is not intended to do.  You're not necessarily wrong,
> > > > you're just trying to do something that maybe Auth just cannot handle.
>
> > > > It might help if you paste some code tohttp://bin.cakephp.orgit
> > > > might be helpful.
>
> > > > --
> > > > Chris Hartjes
> > > > Internet Loudmouth
> > > > Motto for 2008: "Moving from herding elephants to handling snakes..."
> > > > @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component the most failment of Cakephp

2008-06-25 Thread Alessio

yes with security level is set to high.
The ajax question is good..
I have a return in the BeforeFilter...
If request comes from ajax I return...
I had a lot of notices...unable to unlink file in cache..and blah-..

I dont know how but this lesson was very useful to clean all my
code...
I discovered that many times the code in beforeFilter is triggered
many times...so I have put some condition...

beforeFilter is called always, if you use ajax , maybe you don't
need ...or maybe you need... depend of your application...
for example i use comment in ajax...if you force the loggin

I don't know how but now it works...
I recreate all my site..with rc1..and clean a lot the code...

Essentially I learned this..that if the beforeFilter triggers two
times, the auth component becomes instable...

So you have to check all your code...

for example in my application i had an image not present in server...
so the controller triggered more times...
and the auth went to be crazy...

REply to Chris..

I am use this logic..because I process all request... and my
application is built only for seo criterials...

also the forum...

surely with normal management the auth would work greatly...

Thanks to all.


On 25 Giu, 00:21, francky06l <[EMAIL PROTECTED]> wrote:
> I guess if this Auth->user() looses the user, it's linked to session.
> What are you security.level in core ? What is your check.agent (do you
> do lot's of ajax ?). Do you have some other "notices, warnings"
> before ?
>
> On Jun 24, 5:30 am, aranworld <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm curious to know why you are routing everything to the
> > Contents_Controller rather than just put the functionality of the
> > Contents_Controller into the app_controller?
>
> > I think that one of the frustrations people have with the Auth
> > component is that when a problem crops up, it can take a lot of
> > digging around to solve.  I don't think this is a critique of the
> > component, but in the heat of the moment, I think people just get
> > frustrated when something isn't "just working".
>
> > On Jun 23, 6:45 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > > On Mon, Jun 23, 2008 at 9:33 PM, Alessio <[EMAIL PROTECTED]> wrote:
>
> > > > Ok thanks Chris...
> > > > I believe that you have not problems with the component...
>
> > > I wasn't try to be snarky or anything, but I realize it might come
> > > across that way.  I just never run into those problems with Auth that
> > > people report.  Again, I keep things very simple and haven't gone
> > > wrong with that approach.
>
> > > > Maybe I have found the reason...
> > > > I believe that it doesn't work when you use a particular route::
> > > >                // Custom URL route
> > > >  Router::connect('/*', array('controller' => 'contents', 'action' =>
> > > > 'ProcessAllRequest'));
>
> > > > Essentially when in my site the user write something, I redirect all
> > > > to the Content_Controller...
>
> > > > So When, the user enter in mycontroller by route, the component forces
> > > > to logout...
>
> > > Why would you do it that way?  Is there a requirement that every
> > > single request has to go through just one controller?  It makes no
> > > sense to me, but I probably don't understand the problem you are
> > > trying to solve.
>
> > > > Essentially I say to the auth component to allow all request of
> > > > COntent_controller...
> > > > But I saw after many hour of debugging that the Auth COmponent is not
> > > > able to manage this situation...
>
> > > I think (again, just my opinion) you are trying to use Auth for
> > > something it is not intended to do.  You're not necessarily wrong,
> > > you're just trying to do something that maybe Auth just cannot handle.
>
> > > It might help if you paste some code tohttp://bin.cakephp.orgit
> > > might be helpful.
>
> > > --
> > > Chris Hartjes
> > > Internet Loudmouth
> > > Motto for 2008: "Moving from herding elephants to handling snakes..."
> > > @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $loginRedirect in the Auth component does not work?

2008-06-24 Thread Federico Rinaldi
That's how it's supposed to work. The Auth component just redirects to
$loginRedirect when you access the $loginAction directly becouse it doesn't
have any where else to go.

If you want to redirect somewhere else you can use the auth's or
controller's redirect method after a succesfull login.

On Tue, Jun 24, 2008 at 8:03 PM, deltawing <[EMAIL PROTECTED]> wrote:

>
> I tried setting $loginRedirect in the Auth component but it doesn't
> seem to work. No matter what I set the variable to, Cake will always
> redirect to the last page that I was at prior to logging in.
>
> Anyone have any ideas on why?
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



$loginRedirect in the Auth component does not work?

2008-06-24 Thread deltawing

I tried setting $loginRedirect in the Auth component but it doesn't
seem to work. No matter what I set the variable to, Cake will always
redirect to the last page that I was at prior to logging in.

Anyone have any ideas on why?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component the most failment of Cakephp

2008-06-24 Thread francky06l

I guess if this Auth->user() looses the user, it's linked to session.
What are you security.level in core ? What is your check.agent (do you
do lot's of ajax ?). Do you have some other "notices, warnings"
before ?


On Jun 24, 5:30 am, aranworld <[EMAIL PROTECTED]> wrote:
> I'm curious to know why you are routing everything to the
> Contents_Controller rather than just put the functionality of the
> Contents_Controller into the app_controller?
>
> I think that one of the frustrations people have with the Auth
> component is that when a problem crops up, it can take a lot of
> digging around to solve.  I don't think this is a critique of the
> component, but in the heat of the moment, I think people just get
> frustrated when something isn't "just working".
>
> On Jun 23, 6:45 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > On Mon, Jun 23, 2008 at 9:33 PM, Alessio <[EMAIL PROTECTED]> wrote:
>
> > > Ok thanks Chris...
> > > I believe that you have not problems with the component...
>
> > I wasn't try to be snarky or anything, but I realize it might come
> > across that way.  I just never run into those problems with Auth that
> > people report.  Again, I keep things very simple and haven't gone
> > wrong with that approach.
>
> > > Maybe I have found the reason...
> > > I believe that it doesn't work when you use a particular route::
> > >// Custom URL route
> > >  Router::connect('/*', array('controller' => 'contents', 'action' =>
> > > 'ProcessAllRequest'));
>
> > > Essentially when in my site the user write something, I redirect all
> > > to the Content_Controller...
>
> > > So When, the user enter in mycontroller by route, the component forces
> > > to logout...
>
> > Why would you do it that way?  Is there a requirement that every
> > single request has to go through just one controller?  It makes no
> > sense to me, but I probably don't understand the problem you are
> > trying to solve.
>
> > > Essentially I say to the auth component to allow all request of
> > > COntent_controller...
> > > But I saw after many hour of debugging that the Auth COmponent is not
> > > able to manage this situation...
>
> > I think (again, just my opinion) you are trying to use Auth for
> > something it is not intended to do.  You're not necessarily wrong,
> > you're just trying to do something that maybe Auth just cannot handle.
>
> > It might help if you paste some code tohttp://bin.cakephp.orgit
> > might be helpful.
>
> > --
> > Chris Hartjes
> > Internet Loudmouth
> > Motto for 2008: "Moving from herding elephants to handling snakes..."
> > @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component the most failment of Cakephp

2008-06-23 Thread aranworld

I'm curious to know why you are routing everything to the
Contents_Controller rather than just put the functionality of the
Contents_Controller into the app_controller?

I think that one of the frustrations people have with the Auth
component is that when a problem crops up, it can take a lot of
digging around to solve.  I don't think this is a critique of the
component, but in the heat of the moment, I think people just get
frustrated when something isn't "just working".


On Jun 23, 6:45 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Mon, Jun 23, 2008 at 9:33 PM, Alessio <[EMAIL PROTECTED]> wrote:
>
> > Ok thanks Chris...
> > I believe that you have not problems with the component...
>
> I wasn't try to be snarky or anything, but I realize it might come
> across that way.  I just never run into those problems with Auth that
> people report.  Again, I keep things very simple and haven't gone
> wrong with that approach.
>
> > Maybe I have found the reason...
> > I believe that it doesn't work when you use a particular route::
> >                // Custom URL route
> >  Router::connect('/*', array('controller' => 'contents', 'action' =>
> > 'ProcessAllRequest'));
>
> > Essentially when in my site the user write something, I redirect all
> > to the Content_Controller...
>
> > So When, the user enter in mycontroller by route, the component forces
> > to logout...
>
> Why would you do it that way?  Is there a requirement that every
> single request has to go through just one controller?  It makes no
> sense to me, but I probably don't understand the problem you are
> trying to solve.
>
>
>
> > Essentially I say to the auth component to allow all request of
> > COntent_controller...
> > But I saw after many hour of debugging that the Auth COmponent is not
> > able to manage this situation...
>
> I think (again, just my opinion) you are trying to use Auth for
> something it is not intended to do.  You're not necessarily wrong,
> you're just trying to do something that maybe Auth just cannot handle.
>
> It might help if you paste some code tohttp://bin.cakephp.orgit
> might be helpful.
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component the most failment of Cakephp

2008-06-23 Thread Chris Hartjes

On Mon, Jun 23, 2008 at 9:33 PM, Alessio <[EMAIL PROTECTED]> wrote:
>
> Ok thanks Chris...
> I believe that you have not problems with the component...

I wasn't try to be snarky or anything, but I realize it might come
across that way.  I just never run into those problems with Auth that
people report.  Again, I keep things very simple and haven't gone
wrong with that approach.

> Maybe I have found the reason...
> I believe that it doesn't work when you use a particular route::
>// Custom URL route
>  Router::connect('/*', array('controller' => 'contents', 'action' =>
> 'ProcessAllRequest'));
>
> Essentially when in my site the user write something, I redirect all
> to the Content_Controller...
>
> So When, the user enter in mycontroller by route, the component forces
> to logout...

Why would you do it that way?  Is there a requirement that every
single request has to go through just one controller?  It makes no
sense to me, but I probably don't understand the problem you are
trying to solve.

>
> Essentially I say to the auth component to allow all request of
> COntent_controller...
> But I saw after many hour of debugging that the Auth COmponent is not
> able to manage this situation...

I think (again, just my opinion) you are trying to use Auth for
something it is not intended to do.  You're not necessarily wrong,
you're just trying to do something that maybe Auth just cannot handle.

It might help if you paste some code to http://bin.cakephp.org it
might be helpful.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component the most failment of Cakephp

2008-06-23 Thread Alessio

Ok thanks Chris...
I believe that you have not problems with the component...

Maybe I have found the reason...
I believe that it doesn't work when you use a particular route::
// Custom URL route
  Router::connect('/*', array('controller' => 'contents', 'action' =>
'ProcessAllRequest'));

Essentially when in my site the user write something, I redirect all
to the Content_Controller...

So When, the user enter in mycontroller by route, the component forces
to logout...

It seems that with normal routing it works...
It is a pity that I cannot use the auth component..but I cannot use
url like php for seo reasons...

So you have to give me some suggestions?

Essentially I say to the auth component to allow all request of
COntent_controller...
But I saw after many hour of debugging that the Auth COmponent is not
able to manage this situation...

For the discourse of beta I can be in agree with you..but when I have
to change from beta to stable...it is very hard...only this...
Bye...




On 24 Giu, 03:16, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Mon, Jun 23, 2008 at 9:05 PM, Alessio <[EMAIL PROTECTED]> wrote:
> > Why the auth is so buggy...?
>
> I wonder what I am doing in my code that Auth works perfectly every
> time I use it, never experiencing the problems mentioned on the
> mailing list.  I never get logins failing to work, I never get empty
> values from $this->Auth->user().  Works like a charm.
>
> As for "what happen to CakePHP", I cannot answer that except to say
> that when you use software that has not been labeled as stable, you
> take your chances no matter how talented the developers are who
> created it.
>
> I use the bleeding edge from SVN and can only think of a onef time in
> the last year where an update truly broke something in my application.
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component the most failment of Cakephp

2008-06-23 Thread Chris Hartjes

On Mon, Jun 23, 2008 at 9:05 PM, Alessio <[EMAIL PROTECTED]> wrote:
> Why the auth is so buggy...?

I wonder what I am doing in my code that Auth works perfectly every
time I use it, never experiencing the problems mentioned on the
mailing list.  I never get logins failing to work, I never get empty
values from $this->Auth->user().  Works like a charm.

As for "what happen to CakePHP", I cannot answer that except to say
that when you use software that has not been labeled as stable, you
take your chances no matter how talented the developers are who
created it.

I use the bleeding edge from SVN and can only think of a onef time in
the last year where an update truly broke something in my application.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth Component the most failment of Cakephp

2008-06-23 Thread Alessio

I have lost an evening to understand the mechanism of Auth component.
Sometimes the $this->Auth->user() gives me empty values and others
times I get values filled in.
I was using the beta, and now changed to Rc1 only hoping to get a
better solution in Auth..
But the result are same...
Moving from a controller to another, sometimes, the Auth component
goes and sometimes is empty..
So tomorrow i will reuse the old style code, a simple function and
some value in the session to check the user...
Why the auth is so buggy...?
I put every debug in all part of my code...and aniway the auth
fails...
Someone had similar problem?

A little note about the changes in Rc1, from the beta...it is very
boring adapting the code from beta to rc1...
The files of js with root / are not seen good...
In The validation you must rewrite some funtioncs...
What happen to Cakephp?

Essentially I used the logical from this post:
http://groups.google.com/group/cake-php/browse_thread/thread/6fdf328fb22a4e80/b301c378f4b8ddae?lnk=gst&q=Auth-%3Eallow+all#b301c378f4b8ddae

I tried others solutions, all solution but auth doesn't work!

Thanks.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-06 Thread Timothée BRENNER
Ok, thanks for your help. I've tried to do it this way but I should have
done a mistake because it didn't work.
Hmm quoting by Dardo, if you have a beforeFilter() in another controller
extending AppController, it will not work unless you call
parent::beforeFilter() in the child beforeFilter()...


2008/6/6 Greg <[EMAIL PROTECTED]>:

>
> Hi teum,
>
> I too had a lot of problems trying to get this work using anything
> other the standard users controller. I'm using 1.2 and I found that
> this works:
>
> In app controller:
>
>  class AppController extends Controller {
>
>var $helpers = array('javascript');
> var $components = array('Auth');
>
>function beforeFilter() {
> $this->Auth->userModel = 'Account';
>$this->Auth->loginAction = array('controller' => 'accounts',
> 'action' => 'login');
>$this->Auth->loginRedirect = array('controller' =>
> 'dashboard',
> 'action' => 'index');
>$this->Auth->logoutRedirect = array('controller' =>
> 'accounts',
> 'action' => 'login');
>}
>
> }
> ?>
>
> That's all. And then be sure to remove all references to Auth in your
> other controllers if you want your entire app to be protected. You
> don't need to use Auth->allow for login either - that will really
> cause problems.
>
> Cheers
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-06 Thread Greg

Hi teum,

I too had a lot of problems trying to get this work using anything
other the standard users controller. I'm using 1.2 and I found that
this works:

In app controller:

Auth->userModel = 'Account';
$this->Auth->loginAction = array('controller' => 'accounts',
'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'dashboard',
'action' => 'index');
$this->Auth->logoutRedirect = array('controller' => 'accounts',
'action' => 'login');
}

}
?>

That's all. And then be sure to remove all references to Auth in your
other controllers if you want your entire app to be protected. You
don't need to use Auth->allow for login either - that will really
cause problems.

Cheers

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread teum

> If you need an example of a clean cake install with the auth
> configured, I can just send it to your email, so you can give it a
> try.

Yes if you don't mind I'd be happy to give it a try. Thanks Dardo.


On 5 juin, 19:38, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> > But using the standard Users controller doesn't change anything with
> > that. So I may use Dardo Sordi Bogado's method as he tells me it
> > works...
>
> Just Dardo, please.
>
> My method isn't any different from the suggested at the manual, I just
> use a separate function for the auth stuff beacause I usually do many
> things in the beforeFilter and I like to keep them organized, that's
> it.
>
> Just remember to call parent::beforeFilter()!!!
>
> If you need an example of a clean cake install with the auth
> configured, I can just send it to your email, so you can give it a
> try.
>
> Regards,
> - Dardo Sordi.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread Dardo Sordi Bogado

> But using the standard Users controller doesn't change anything with
> that. So I may use Dardo Sordi Bogado's method as he tells me it
> works...

Just Dardo, please.

My method isn't any different from the suggested at the manual, I just
use a separate function for the auth stuff beacause I usually do many
things in the beforeFilter and I like to keep them organized, that's
it.

Just remember to call parent::beforeFilter()!!!

If you need an example of a clean cake install with the auth
configured, I can just send it to your email, so you can give it a
try.


Regards,
- Dardo Sordi.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread teum

> That's going to be a lot of maintenance.

You're right, I didn't think about it. Obviously I'm not so
experienced in professionnal development which is normal as I've only
been working as a web developer for seven months. In opposition to me,
you seem to have a good hindsight with development, and I appreciate
your advice a lot.

> It gets to the point in a 'serious project' where you have to stop digging 
> and move on.(...) I now have a rule that if after an hour it looks like I'm 
> going
nowhere I do something else.

You are right. I'm always waisting my time trying to find the best
solution ever or trying to make things work exactly as I want them to
work and finally I waste a lot of time. And at work time == money so
you can't spend a whole day searching the web...

But as far as the Auth component is concerned, even if you use the
standard Users controller, actually (correct me if I'm wrong) it
doesn't help you save a lot of lines. What I wanted to do is keeping
all the initialization process of the Auth component in the
AppController class in order to not repeat the following lines in each
controller :

var $components = array("Auth");

function beforeFilter()
{
$this->Auth->userModel = "Utilisateur";
$this->Auth->fields = array('username' => 'login', 'password' =>
'pass');
$this->Auth->loginAction = array('controller' => 'utilisateurs',
'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'utilisateurs',
'action' => 'index');
$this->Auth->logoutRedirect = array('controller' => 'creations',
'action' => 'index');
$this->Auth->loginError = __("Identifiant et/ou mot de passe
incorrect", true);
$this->Auth->authError = __("Vous n'êtes pas autorisé à accéder à cet
endroit.", true);
}

But using the standard Users controller doesn't change anything with
that. So I may use Dardo Sordi Bogado's method as he tells me it
works...

Thank you Leo.


On 5 juin, 18:09, leo <[EMAIL PROTECTED]> wrote:
> >> "I gave up in the end as I had to make so many changes"
> >> => The only changes that I had to make for now is to add the following
> >> code in all my controllers :
>
> That's going to be a lot of maintenance.
>
> >> Can you please give me more details about
> >> those changes ? What do you advise me to do ? I'm working on a serious
> >> project (at the office, so not just for fun) so if it's necessary to
> >> have a Users controller I'll make one...
>
> I can't really give you details because I never got it working by
> reconfiguring and it would (may) just lead you along the wrong path.
>
> It gets to the point in a 'serious project' where you have to stop
> digging and move on. This thread has now run to 14 messages.
>
> I now have a rule that if after an hour it looks like I'm going
> nowhere I do something else. That's why I opted to go with the
> standard out of the box approach. Follow the manual word for word and
> it'll just work.
>
> On Jun 5, 4:53 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>
> > >=> Do you think it will work as my solution which was about the same
> > > technically (except I didn't use the parent beforeFilter() method and my
> > > initializeAuthComponent() wasn't private) didn't ?
>
> > I don't know what are you doing in your setup in order to make it
> > don't work, for me is working great.
>
> > > BTW, I don't understand why my solution didn't work, but this Auth 
> > > component
> > > seems a little strange...
>
> > The Auth component works just fine.
>
> > > 2008/6/5 Dardo Sordi Bogado <[EMAIL PROTECTED]>:
>
> > >> > I guess that when you declare a beforeFilter() method in a controller
> > >> > (which extends AppController) it overrides the
> > >> > AppController::beforeFilter() ? Am I right ?
>
> > >> Yes, then you just need to call parent::beforeFilter() inside the
> > >> beforeFilter method from the controller you are declaring.
>
> > >> Usually, when you override a parent method for extending it's
> > >> functionality you need to call it manually.
>
> > >> > I'm going to do the following :
>
> > >> > 1) In my AppController I'll put this :
>
> > >

Re: Auth component : UsersController could not be found

2008-06-05 Thread leo

>> "I gave up in the end as I had to make so many changes"

>> => The only changes that I had to make for now is to add the following
>> code in all my controllers :

That's going to be a lot of maintenance.


>> Can you please give me more details about
>> those changes ? What do you advise me to do ? I'm working on a serious
>> project (at the office, so not just for fun) so if it's necessary to
>> have a Users controller I'll make one...

I can't really give you details because I never got it working by
reconfiguring and it would (may) just lead you along the wrong path.

It gets to the point in a 'serious project' where you have to stop
digging and move on. This thread has now run to 14 messages.

I now have a rule that if after an hour it looks like I'm going
nowhere I do something else. That's why I opted to go with the
standard out of the box approach. Follow the manual word for word and
it'll just work.

On Jun 5, 4:53 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >    => Do you think it will work as my solution which was about the same
> > technically (except I didn't use the parent beforeFilter() method and my
> > initializeAuthComponent() wasn't private) didn't ?
>
> I don't know what are you doing in your setup in order to make it
> don't work, for me is working great.
>
> > BTW, I don't understand why my solution didn't work, but this Auth component
> > seems a little strange...
>
> The Auth component works just fine.
>
>
>
> > 2008/6/5 Dardo Sordi Bogado <[EMAIL PROTECTED]>:
>
> >> > I guess that when you declare a beforeFilter() method in a controller
> >> > (which extends AppController) it overrides the
> >> > AppController::beforeFilter() ? Am I right ?
>
> >> Yes, then you just need to call parent::beforeFilter() inside the
> >> beforeFilter method from the controller you are declaring.
>
> >> Usually, when you override a parent method for extending it's
> >> functionality you need to call it manually.
>
> >> > I'm going to do the following :
>
> >> > 1) In my AppController I'll put this :
>
> >> > function initializeAuthComponent()
> >> > {
> >> >        $this->Auth->userModel = "Utilisateur";
> >> >        $this->Auth->fields = array('username' => 'login', 'password' =>
> >> > 'pass');
> >> >        $this->Auth->loginAction = array('controller' => 'utilisateurs',
> >> > 'action' => 'login');
> >> >        $this->Auth->loginError = __("Identifiant et/ou mot de passe
> >> > incorrect", true);
> >> > }
>
> >> > 2) In all of my controllers extending AppController I'll do this :
>
> >> > function beforeFilter()
> >> > {
> >> >        $this->initializeAuthComponent();
> >> >        $this->Auth->allow("allowedAction1", "allowedAction2", ...);
> >> > }
>
> >> I use to do this:
>
> >> Create a private function _setupAuth() in AppController, then in
> >> AppController::beforeFilter() call it and in child controller's
> >> beforeFilter() just call parent::beforeFilter().
>
> >> > Thanks for your time.
>
> >> You are welcome.
>
> >> Regards,
> >> - Dardo Sordi.
>
> >> > On 5 juin, 13:02, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >> >> Ignore the previous code, I hit the send button by accident
>
> >> >> class ThingsControllers extends Appcontroller {
>
> >> >>     var $name = 'Things';
>
> >> >>     function beforeFilter() {
>
> >> >>         parent::beforeFilter();
>
> >> >>         // this controller custom stuff
>
> >> >>     }
>
> >> >> }
>
> >> >> Regards,
> >> >> - Dardo Sordi
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread teum

Ok, I'll try again later. I might just be doing something wrong.


On 5 juin, 16:53, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >=> Do you think it will work as my solution which was about the same
> > technically (except I didn't use the parent beforeFilter() method and my
> > initializeAuthComponent() wasn't private) didn't ?
>
> I don't know what are you doing in your setup in order to make it
> don't work, for me is working great.
>
> > BTW, I don't understand why my solution didn't work, but this Auth component
> > seems a little strange...
>
> The Auth component works just fine.
>
>
>
> > 2008/6/5 Dardo Sordi Bogado <[EMAIL PROTECTED]>:
>
> >> > I guess that when you declare a beforeFilter() method in a controller
> >> > (which extends AppController) it overrides the
> >> > AppController::beforeFilter() ? Am I right ?
>
> >> Yes, then you just need to call parent::beforeFilter() inside the
> >> beforeFilter method from the controller you are declaring.
>
> >> Usually, when you override a parent method for extending it's
> >> functionality you need to call it manually.
>
> >> > I'm going to do the following :
>
> >> > 1) In my AppController I'll put this :
>
> >> > function initializeAuthComponent()
> >> > {
> >> >$this->Auth->userModel = "Utilisateur";
> >> >$this->Auth->fields = array('username' => 'login', 'password' =>
> >> > 'pass');
> >> >$this->Auth->loginAction = array('controller' => 'utilisateurs',
> >> > 'action' => 'login');
> >> >$this->Auth->loginError = __("Identifiant et/ou mot de passe
> >> > incorrect", true);
> >> > }
>
> >> > 2) In all of my controllers extending AppController I'll do this :
>
> >> > function beforeFilter()
> >> > {
> >> >$this->initializeAuthComponent();
> >> >$this->Auth->allow("allowedAction1", "allowedAction2", ...);
> >> > }
>
> >> I use to do this:
>
> >> Create a private function _setupAuth() in AppController, then in
> >> AppController::beforeFilter() call it and in child controller's
> >> beforeFilter() just call parent::beforeFilter().
>
> >> > Thanks for your time.
>
> >> You are welcome.
>
> >> Regards,
> >> - Dardo Sordi.
>
> >> > On 5 juin, 13:02, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >> >> Ignore the previous code, I hit the send button by accident
>
> >> >> class ThingsControllers extends Appcontroller {
>
> >> >> var $name = 'Things';
>
> >> >> function beforeFilter() {
>
> >> >> parent::beforeFilter();
>
> >> >> // this controller custom stuff
>
> >> >> }
>
> >> >> }
>
> >> >> Regards,
> >> >> - Dardo Sordi
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread Dardo Sordi Bogado

>=> Do you think it will work as my solution which was about the same
> technically (except I didn't use the parent beforeFilter() method and my
> initializeAuthComponent() wasn't private) didn't ?

I don't know what are you doing in your setup in order to make it
don't work, for me is working great.

> BTW, I don't understand why my solution didn't work, but this Auth component
> seems a little strange...

The Auth component works just fine.

>
>
> 2008/6/5 Dardo Sordi Bogado <[EMAIL PROTECTED]>:
>>
>> > I guess that when you declare a beforeFilter() method in a controller
>> > (which extends AppController) it overrides the
>> > AppController::beforeFilter() ? Am I right ?
>>
>> Yes, then you just need to call parent::beforeFilter() inside the
>> beforeFilter method from the controller you are declaring.
>>
>> Usually, when you override a parent method for extending it's
>> functionality you need to call it manually.
>>
>> > I'm going to do the following :
>> >
>> > 1) In my AppController I'll put this :
>> >
>> > function initializeAuthComponent()
>> > {
>> >$this->Auth->userModel = "Utilisateur";
>> >$this->Auth->fields = array('username' => 'login', 'password' =>
>> > 'pass');
>> >$this->Auth->loginAction = array('controller' => 'utilisateurs',
>> > 'action' => 'login');
>> >$this->Auth->loginError = __("Identifiant et/ou mot de passe
>> > incorrect", true);
>> > }
>> >
>> > 2) In all of my controllers extending AppController I'll do this :
>> >
>> > function beforeFilter()
>> > {
>> >$this->initializeAuthComponent();
>> >$this->Auth->allow("allowedAction1", "allowedAction2", ...);
>> > }
>> >
>>
>> I use to do this:
>>
>> Create a private function _setupAuth() in AppController, then in
>> AppController::beforeFilter() call it and in child controller's
>> beforeFilter() just call parent::beforeFilter().
>>
>> > Thanks for your time.
>>
>> You are welcome.
>>
>> Regards,
>> - Dardo Sordi.
>>
>>
>> >
>> > On 5 juin, 13:02, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>> >> Ignore the previous code, I hit the send button by accident
>> >>
>> >> class ThingsControllers extends Appcontroller {
>> >>
>> >> var $name = 'Things';
>> >>
>> >> function beforeFilter() {
>> >>
>> >> parent::beforeFilter();
>> >>
>> >> // this controller custom stuff
>> >>
>> >> }
>> >>
>> >> }
>> >>
>> >> Regards,
>> >> - Dardo Sordi
>> > >
>> >
>>
>>
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread Timothée BRENNER
I use to do this:

Create a private function _setupAuth() in AppController, then in
AppController::beforeFilter() call it and in child controller's
beforeFilter() just call parent::beforeFilter().

   => Do you think it will work as my solution which was about the same
technically (except I didn't use the parent beforeFilter() method and my
initializeAuthComponent() wasn't private) didn't ?

BTW, I don't understand why my solution didn't work, but this Auth component
seems a little strange...



2008/6/5 Dardo Sordi Bogado <[EMAIL PROTECTED]>:

>
> > I guess that when you declare a beforeFilter() method in a controller
> > (which extends AppController) it overrides the
> > AppController::beforeFilter() ? Am I right ?
>
> Yes, then you just need to call parent::beforeFilter() inside the
> beforeFilter method from the controller you are declaring.
>
> Usually, when you override a parent method for extending it's
> functionality you need to call it manually.
>
> > I'm going to do the following :
> >
> > 1) In my AppController I'll put this :
> >
> > function initializeAuthComponent()
> > {
> >$this->Auth->userModel = "Utilisateur";
> >$this->Auth->fields = array('username' => 'login', 'password' =>
> > 'pass');
> >$this->Auth->loginAction = array('controller' => 'utilisateurs',
> > 'action' => 'login');
> >$this->Auth->loginError = __("Identifiant et/ou mot de passe
> > incorrect", true);
> > }
> >
> > 2) In all of my controllers extending AppController I'll do this :
> >
> > function beforeFilter()
> > {
> >$this->initializeAuthComponent();
> >$this->Auth->allow("allowedAction1", "allowedAction2", ...);
> > }
> >
>
> I use to do this:
>
> Create a private function _setupAuth() in AppController, then in
> AppController::beforeFilter() call it and in child controller's
> beforeFilter() just call parent::beforeFilter().
>
> > Thanks for your time.
>
> You are welcome.
>
> Regards,
> - Dardo Sordi.
>
>
> >
> > On 5 juin, 13:02, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >> Ignore the previous code, I hit the send button by accident
> >>
> >> class ThingsControllers extends Appcontroller {
> >>
> >> var $name = 'Things';
> >>
> >> function beforeFilter() {
> >>
> >> parent::beforeFilter();
> >>
> >> // this controller custom stuff
> >>
> >> }
> >>
> >> }
> >>
> >> Regards,
> >> - Dardo Sordi
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread Dardo Sordi Bogado

> I guess that when you declare a beforeFilter() method in a controller
> (which extends AppController) it overrides the
> AppController::beforeFilter() ? Am I right ?

Yes, then you just need to call parent::beforeFilter() inside the
beforeFilter method from the controller you are declaring.

Usually, when you override a parent method for extending it's
functionality you need to call it manually.

> I'm going to do the following :
>
> 1) In my AppController I'll put this :
>
> function initializeAuthComponent()
> {
>$this->Auth->userModel = "Utilisateur";
>$this->Auth->fields = array('username' => 'login', 'password' =>
> 'pass');
>$this->Auth->loginAction = array('controller' => 'utilisateurs',
> 'action' => 'login');
>$this->Auth->loginError = __("Identifiant et/ou mot de passe
> incorrect", true);
> }
>
> 2) In all of my controllers extending AppController I'll do this :
>
> function beforeFilter()
> {
>$this->initializeAuthComponent();
>$this->Auth->allow("allowedAction1", "allowedAction2", ...);
> }
>

I use to do this:

Create a private function _setupAuth() in AppController, then in
AppController::beforeFilter() call it and in child controller's
beforeFilter() just call parent::beforeFilter().

> Thanks for your time.

You are welcome.

Regards,
- Dardo Sordi.


>
> On 5 juin, 13:02, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>> Ignore the previous code, I hit the send button by accident
>>
>> class ThingsControllers extends Appcontroller {
>>
>> var $name = 'Things';
>>
>> function beforeFilter() {
>>
>> parent::beforeFilter();
>>
>> // this controller custom stuff
>>
>> }
>>
>> }
>>
>> Regards,
>> - Dardo Sordi
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread teum

Ok I tried to do what I said in my previous message but unfortunately
it doesn't work well, so I'm getting back to the only method that
works i.e. putting a beforeFilter() with all the Auth component
initializations (7 lines) in EACH of my controllers + a line to tell
Cake that my controller uses the Auth component. Again, it's not
optimal because there are a few lines that repeat themselves, but it's
not really important as long as the authentication works.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread teum

I guess that when you declare a beforeFilter() method in a controller
(which extends AppController) it overrides the
AppController::beforeFilter() ? Am I right ?

I'm going to do the following :

1) In my AppController I'll put this :

function initializeAuthComponent()
{
$this->Auth->userModel = "Utilisateur";
$this->Auth->fields = array('username' => 'login', 'password' =>
'pass');
$this->Auth->loginAction = array('controller' => 'utilisateurs',
'action' => 'login');
$this->Auth->loginError = __("Identifiant et/ou mot de passe
incorrect", true);
}

2) In all of my controllers extending AppController I'll do this :

function beforeFilter()
{
$this->initializeAuthComponent();
$this->Auth->allow("allowedAction1", "allowedAction2", ...);
}


Thanks for your time.


On 5 juin, 13:02, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> Ignore the previous code, I hit the send button by accident
>
> class ThingsControllers extends Appcontroller {
>
> var $name = 'Things';
>
> function beforeFilter() {
>
> parent::beforeFilter();
>
> // this controller custom stuff
>
> }
>
> }
>
> Regards,
> - Dardo Sordi
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread teum

"I gave up in the end as I had to make so many changes"

=> The only changes that I had to make for now is to add the following
code in all my controllers :

var $components = array("Auth");

function beforeFilter()
{
$this->Auth->userModel = "Utilisateur";
$this->Auth->fields = array('username' => 'login',
'password' =>
'pass');
$this->Auth->loginAction = array('controller' =>
'utilisateurs',
'action' => 'login');
$this->Auth->loginError = __("Identifiant et/ou mot de
passe
incorrect", true);
}

If there is nothing more it doesn't bother me that much. But if you
tell me there will be other problems I'd better stop now and use the
default Users controller...Can you please give me more details about
those changes ? What do you advise me to do ? I'm working on a serious
project (at the office, so not just for fun) so if it's necessary to
have a Users controller I'll make one...

Thanks !


On 5 juin, 12:27, leo <[EMAIL PROTECTED]> wrote:
> > I'm trying to get the Auth component working. I've specified a
> > different "users" controller ("utilisateurs") but when I try to go to
> > the login page (/utilisateurs/login) or to access a denied resource
> > I'm always redirected to /users/login (should be /utilisateurs/login).
>
> I don't know if it'll help, but I had the same problem - 'usuaris'. I
> gave up in the end as I had to make so many changes that were internal
> and therefore ultimately invisible to the end user.
>
> Finally I settled on the default manual names for db, model,
> controller and views. It'll all be hidden by pretty urls anyway.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread Dardo Sordi Bogado

Ignore the previous code, I hit the send button by accident

class ThingsControllers extends Appcontroller {

var $name = 'Things';

function beforeFilter() {

parent::beforeFilter();

// this controller custom stuff

}

}


Regards,
- Dardo Sordi

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread Dardo Sordi Bogado

If you override the beforeFilter in a descendant of AppController
don't forget to call parent::beforeFilter()

ie:

class ThingsControllers extends Appcontroller {

var $name = 'Things';

   function beforeFilter() {

}

}

On Thu, Jun 5, 2008 at 7:11 AM, teum <[EMAIL PROTECTED]> wrote:
>
> It seems like the problem comes from the app_controller.php file but I
> wonder what I have done wrong. In fact, when I drag the content of my
> AppController class into each of my controllers and I add $this->Auth-
>>allow("allowedAction1", "allowedAction2", ...); it works. But it is
> far from optimal...
>
> Here is an extract of the CookBook :
>
> Like all components, you use it by adding 'auth' to the list of
> components in your controller:
> Code View
>
> class FooController extends AppController {
>var $components = array('Auth');
>
>   1. class FooController extends AppController {
>   2. var $components = array('Auth');
>
> Or add it to your AppController so all of your controllers will use
> it:
> Code View
>
> class AppController extends Controller {
>var $components = array('Auth');
>
>
> So, when I choose the first option (add the auth component in each
> controller) it works and when I choose the second option (add the auth
> component in the AppController) it doesn't.
>
> Maybe what I do wrong is putting the beforeFilter() in the
> AppController class ("Whenever you want to alter a default option for
> AuthComponent, you do that by creating a beforeFilter() method for
> your controller, and then calling various built-in methods or setting
> component variables.").
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread leo

> I'm trying to get the Auth component working. I've specified a
> different "users" controller ("utilisateurs") but when I try to go to
> the login page (/utilisateurs/login) or to access a denied resource
> I'm always redirected to /users/login (should be /utilisateurs/login).

I don't know if it'll help, but I had the same problem - 'usuaris'. I
gave up in the end as I had to make so many changes that were internal
and therefore ultimately invisible to the end user.

Finally I settled on the default manual names for db, model,
controller and views. It'll all be hidden by pretty urls anyway.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread teum

It seems like the problem comes from the app_controller.php file but I
wonder what I have done wrong. In fact, when I drag the content of my
AppController class into each of my controllers and I add $this->Auth-
>allow("allowedAction1", "allowedAction2", ...); it works. But it is
far from optimal...

Here is an extract of the CookBook :

Like all components, you use it by adding 'auth' to the list of
components in your controller:
Code View

class FooController extends AppController {
var $components = array('Auth');

   1. class FooController extends AppController {
   2. var $components = array('Auth');

Or add it to your AppController so all of your controllers will use
it:
Code View

class AppController extends Controller {
var $components = array('Auth');


So, when I choose the first option (add the auth component in each
controller) it works and when I choose the second option (add the auth
component in the AppController) it doesn't.

Maybe what I do wrong is putting the beforeFilter() in the
AppController class ("Whenever you want to alter a default option for
AuthComponent, you do that by creating a beforeFilter() method for
your controller, and then calling various built-in methods or setting
component variables.").
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-05 Thread teum

I've upgraded to 1.2 RC1 and it hasn't solved my problem. Thanks
anyway.

Another idea someone ?


On 4 juin, 21:01, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> > Any idea ?
>
> Try to upgrade your cake version.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component: how to change current user, w/out password?

2008-06-04 Thread Dardo Sordi Bogado

I think you can do $this->Auth->login($id);

Regards,
- Dardo Sordi.


On Wed, Jun 4, 2008 at 7:16 PM, mcjustin <[EMAIL PROTECTED]> wrote:
>
> Is it possible to programmatically switch which user the Auth lib has
> logged in, without knowing the password of the second user?
>
> For example, "userAdminJoe" is logged in. I want him to be able to
> click a link which will switch him to be treated as user
> "userPeonJack". I want to do this at the Auth level, because I want
> him to be treated as "userPeonJack" by the Auth and Acl libs. If he
> wanted to be treated as "userAdminJoe" again, he'd need to log-in
> again.
>
> I've looked around a bit, but can't seem to find an answer to this...
>
> Thanks!
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth component: how to change current user, w/out password?

2008-06-04 Thread mcjustin

Is it possible to programmatically switch which user the Auth lib has
logged in, without knowing the password of the second user?

For example, "userAdminJoe" is logged in. I want him to be able to
click a link which will switch him to be treated as user
"userPeonJack". I want to do this at the Auth level, because I want
him to be treated as "userPeonJack" by the Auth and Acl libs. If he
wanted to be treated as "userAdminJoe" again, he'd need to log-in
again.

I've looked around a bit, but can't seem to find an answer to this...

Thanks!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component : UsersController could not be found

2008-06-04 Thread Dardo Sordi Bogado

> Any idea ?

Try to upgrade your cake version.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth component : UsersController could not be found

2008-06-04 Thread teum

Hello,

I've spent some time trying to find a solution to the following
problem by myself and also by searching in this group but I found
nothing at all. Here's the thing :

I'm trying to get the Auth component working. I've specified a
different "users" controller ("utilisateurs") but when I try to go to
the login page (/utilisateurs/login) or to access a denied resource
I'm always redirected to /users/login (should be /utilisateurs/login).

Here's my app/app_controller.php file :

class AppController extends Controller {

var $components = array("Auth");

function beforeFilter()
{
$this->Auth->userModel = "Utilisateur";
$this->Auth->fields = array('username' => 'login', 'password' =>
'pass');
$this->Auth->loginAction = array('controller' => 'utilisateurs',
'action' => 'login');
$this->Auth->loginError = __("Identifiant et/ou mot de passe
incorrect", true);
}
}

Any idea ?

Thanks in advance.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component not working using PagesController

2008-05-30 Thread Dan Soendergaard

Thanks! So simple, I don't believe it... But it works :)

On 29 Maj, 23:47, francky06l <[EMAIL PROTECTED]> wrote:
> Did you copy the PagesController in your application ? If so, create
> the beforeFilter and call parent::beforeFiler ..
> hth
>
> On May 29, 10:47 pm, Dan Soendergaard <[EMAIL PROTECTED]> wrote:
>
> > Hi everybody,
>
> > I use the AuthComponent on my site for authentication. I've specified
> > all of the things that it needs to know in the app_controller.php,
> > where I also set a variable, $user, which contains the object of the
> > current user. I use this for showing custom menus, log out links etc.
>
> > However, I'm also using the built-in PagesController to show static
> > pages on the site. But apparently the $user variable isn't set when
> > viewing pages. I tried adding the AuthComponent directly to the
> > PagesController, allowing all pages, and setting the $user variable
> > directly in the PagesController also. Still, menus and links don't
> > show up.
>
> > Any suggestions here? This is the code for app_controller.php,
>
> >  > class AppController extends Controller
> > {
> >         var $helpers = array( 'Html', 'Javascript', 'Form' );
> >         var $components = array( 'Auth' );
>
> >         function beforeFilter()
> >         {
> >                 Security::setHash('sha1');
>
> >                 $this->Auth->loginAction = '/users/login';
> >                 $this->Auth->loginRedirect = array('controller' => 'events',
> > 'action' => 'index');
> >                 $this->Auth->logoutRedirect = '/events/index';
> >                 $this->Auth->loginError = __('Wrong username or password.', 
> > true);
> >                 $this->Auth->authError = __('You have to log in to access 
> > this
> > page.', true);
> >                 $this->Auth->authorize = 'controller';
> >                 $this->Auth->deny('*');
>
> >                 if ($this->Auth->user())
> >                 {
> >                         $this->set('user', $this->Auth->user());
> >                 }
> >                 else
> >                 {
> >                         $this->set('user', null);
> >                 }
> >         }
>
> >         public function isAuthorized()
> >         {
> >                 return true;
> >         }}
>
> > ?>
>
> > Thanks in advance :)
>
> > - Dan
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component not working using PagesController

2008-05-29 Thread francky06l

Did you copy the PagesController in your application ? If so, create
the beforeFilter and call parent::beforeFiler ..
hth

On May 29, 10:47 pm, Dan Soendergaard <[EMAIL PROTECTED]> wrote:
> Hi everybody,
>
> I use the AuthComponent on my site for authentication. I've specified
> all of the things that it needs to know in the app_controller.php,
> where I also set a variable, $user, which contains the object of the
> current user. I use this for showing custom menus, log out links etc.
>
> However, I'm also using the built-in PagesController to show static
> pages on the site. But apparently the $user variable isn't set when
> viewing pages. I tried adding the AuthComponent directly to the
> PagesController, allowing all pages, and setting the $user variable
> directly in the PagesController also. Still, menus and links don't
> show up.
>
> Any suggestions here? This is the code for app_controller.php,
>
>  class AppController extends Controller
> {
> var $helpers = array( 'Html', 'Javascript', 'Form' );
> var $components = array( 'Auth' );
>
> function beforeFilter()
> {
> Security::setHash('sha1');
>
> $this->Auth->loginAction = '/users/login';
> $this->Auth->loginRedirect = array('controller' => 'events',
> 'action' => 'index');
> $this->Auth->logoutRedirect = '/events/index';
> $this->Auth->loginError = __('Wrong username or password.', 
> true);
> $this->Auth->authError = __('You have to log in to access this
> page.', true);
> $this->Auth->authorize = 'controller';
> $this->Auth->deny('*');
>
> if ($this->Auth->user())
> {
> $this->set('user', $this->Auth->user());
> }
> else
> {
> $this->set('user', null);
> }
> }
>
> public function isAuthorized()
> {
> return true;
> }}
>
> ?>
>
> Thanks in advance :)
>
> - Dan
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth Component not working using PagesController

2008-05-29 Thread Dan Soendergaard

Hi everybody,

I use the AuthComponent on my site for authentication. I've specified
all of the things that it needs to know in the app_controller.php,
where I also set a variable, $user, which contains the object of the
current user. I use this for showing custom menus, log out links etc.

However, I'm also using the built-in PagesController to show static
pages on the site. But apparently the $user variable isn't set when
viewing pages. I tried adding the AuthComponent directly to the
PagesController, allowing all pages, and setting the $user variable
directly in the PagesController also. Still, menus and links don't
show up.

Any suggestions here? This is the code for app_controller.php,

Auth->loginAction = '/users/login';
$this->Auth->loginRedirect = array('controller' => 'events',
'action' => 'index');
$this->Auth->logoutRedirect = '/events/index';
$this->Auth->loginError = __('Wrong username or password.', 
true);
$this->Auth->authError = __('You have to log in to access this
page.', true);
$this->Auth->authorize = 'controller';
$this->Auth->deny('*');

if ($this->Auth->user())
{
$this->set('user', $this->Auth->user());
}
else
{
$this->set('user', null);
}
}

public function isAuthorized()
{
return true;
}
}
?>

Thanks in advance :)

- Dan
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Restricting Login Attempts with Auth Component

2008-05-28 Thread aranworld

The scenario leveille brings up is the one I'm in.  This is more of an
extranet than an intranet.  The server is off-site, and is being
accessed by many people who all share the same IP.

My solution was this:

1: upon entry to user login form, check if user's IP is associated
with a threshold number of failed attempts
2: if IP is not on banned list, then allow display of login form
3: for first few attempts, use session data, to avoid unnessary
inserts into database
4: if user fails after a handful of attempts, then write failed
attempts to database increasing count for this IP

This way if a user just makes a typo a couple times, the failed
attempts don't get registered, and the database table remains a more
accurate count of people who were trying to login with absolutely no
clue about their password -- ie hackers stabbing in the dark.


On May 23, 5:47 am, leveille <[EMAIL PROTECTED]> wrote:
> Bear in mind that the browser fingerprint would only be reliable if
> the server to which the clients are making the request is in the same
> network (behind the same firewall).  In that case the IP address would
> be a DHCPd 1.9.168.*.* variation.  If the server to which the requests
> are going to is outside the network, the requests would all show as
> originating from the same IP address.
>
> On May 22, 8:33 pm, BrendonKoz <[EMAIL PROTECTED]> wrote:
>
> > If you're worried about using just the IP, why not store a browser
> > fingerprint in the database and use that as the mechanism for
> > identifying an identical user?  A simple browser fingerprint would be
> > the IP and UserAgent string concatenated toghether, and then hashed
> > (MD5 for instance).  Although this technically could lead to
> > duplication eventually, the chances that you'd have multiple hits on
> > the same IP would be greater.  You can find more about browser
> > fingerprinting with a simple web search (and find better methods).
>
> > On May 22, 4:29 pm, aranworld <[EMAIL PROTECTED]> wrote:
>
> > > Thanks for the feedback.  I will add some database functionality to it
> > > as well.
>
> > > One problem I am coming across is that many of my users are all in the
> > > same office with identical IP addresses.  So if one user makes 5
> > > unsuccessful attempts, I run the risk of locking out everyone else in
> > > the office.
>
> > > I'm thinking that I can have a session based lockout set at 5, but
> > > then make a database lockout with a much higher limit to compensate
> > > for the fact that many users could all enter wrong passwords within a
> > > week's time.  Even if the limit is as high as 100, I still think that
> > > is very likely to combat brute force methods, which usually require
> > > 10s of thousands of entries to have any hopes of success.
>
> > > On May 22, 12:58 pm, davidpersson <[EMAIL PROTECTED]> wrote:
>
> > > > There's a brute force protection behavior available over at the
> > > > bakery:http://bakery.cakephp.org/articles/view/brute-force-protection
>
> > > > It may need some changes to make it work with 1.2 but I think it's
> > > > simple and does it's job.
>
> > > > On May 22, 9:13 pm, aranworld <[EMAIL PROTECTED]> wrote:
>
> > > > > I am trying to figure out the most reliable way of restricting login
> > > > > attempts while using the Auth Component.
>
> > > > > Here is my best stab at the problem thus far:
>
> > > > >http://cakeforge.org/snippet/detail.php?type=snippet&id=220
>
> > > > > I'd love to hear what other people have done, or what they think of
> > > > > the method I am using in the code snipped I've linked to.
>
> > > > > -Aran
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Restricting Login Attempts with Auth Component

2008-05-23 Thread leveille

Bear in mind that the browser fingerprint would only be reliable if
the server to which the clients are making the request is in the same
network (behind the same firewall).  In that case the IP address would
be a DHCPd 1.9.168.*.* variation.  If the server to which the requests
are going to is outside the network, the requests would all show as
originating from the same IP address.

On May 22, 8:33 pm, BrendonKoz <[EMAIL PROTECTED]> wrote:
> If you're worried about using just the IP, why not store a browser
> fingerprint in the database and use that as the mechanism for
> identifying an identical user?  A simple browser fingerprint would be
> the IP and UserAgent string concatenated toghether, and then hashed
> (MD5 for instance).  Although this technically could lead to
> duplication eventually, the chances that you'd have multiple hits on
> the same IP would be greater.  You can find more about browser
> fingerprinting with a simple web search (and find better methods).
>
> On May 22, 4:29 pm, aranworld <[EMAIL PROTECTED]> wrote:
>
> > Thanks for the feedback.  I will add some database functionality to it
> > as well.
>
> > One problem I am coming across is that many of my users are all in the
> > same office with identical IP addresses.  So if one user makes 5
> > unsuccessful attempts, I run the risk of locking out everyone else in
> > the office.
>
> > I'm thinking that I can have a session based lockout set at 5, but
> > then make a database lockout with a much higher limit to compensate
> > for the fact that many users could all enter wrong passwords within a
> > week's time.  Even if the limit is as high as 100, I still think that
> > is very likely to combat brute force methods, which usually require
> > 10s of thousands of entries to have any hopes of success.
>
> > On May 22, 12:58 pm, davidpersson <[EMAIL PROTECTED]> wrote:
>
> > > There's a brute force protection behavior available over at the
> > > bakery:http://bakery.cakephp.org/articles/view/brute-force-protection
>
> > > It may need some changes to make it work with 1.2 but I think it's
> > > simple and does it's job.
>
> > > On May 22, 9:13 pm, aranworld <[EMAIL PROTECTED]> wrote:
>
> > > > I am trying to figure out the most reliable way of restricting login
> > > > attempts while using the Auth Component.
>
> > > > Here is my best stab at the problem thus far:
>
> > > >http://cakeforge.org/snippet/detail.php?type=snippet&id=220
>
> > > > I'd love to hear what other people have done, or what they think of
> > > > the method I am using in the code snipped I've linked to.
>
> > > > -Aran
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Restricting Login Attempts with Auth Component

2008-05-22 Thread BrendonKoz

If you're worried about using just the IP, why not store a browser
fingerprint in the database and use that as the mechanism for
identifying an identical user?  A simple browser fingerprint would be
the IP and UserAgent string concatenated toghether, and then hashed
(MD5 for instance).  Although this technically could lead to
duplication eventually, the chances that you'd have multiple hits on
the same IP would be greater.  You can find more about browser
fingerprinting with a simple web search (and find better methods).

On May 22, 4:29 pm, aranworld <[EMAIL PROTECTED]> wrote:
> Thanks for the feedback.  I will add some database functionality to it
> as well.
>
> One problem I am coming across is that many of my users are all in the
> same office with identical IP addresses.  So if one user makes 5
> unsuccessful attempts, I run the risk of locking out everyone else in
> the office.
>
> I'm thinking that I can have a session based lockout set at 5, but
> then make a database lockout with a much higher limit to compensate
> for the fact that many users could all enter wrong passwords within a
> week's time.  Even if the limit is as high as 100, I still think that
> is very likely to combat brute force methods, which usually require
> 10s of thousands of entries to have any hopes of success.
>
> On May 22, 12:58 pm, davidpersson <[EMAIL PROTECTED]> wrote:
>
> > There's a brute force protection behavior available over at the
> > bakery:http://bakery.cakephp.org/articles/view/brute-force-protection
>
> > It may need some changes to make it work with 1.2 but I think it's
> > simple and does it's job.
>
> > On May 22, 9:13 pm, aranworld <[EMAIL PROTECTED]> wrote:
>
> > > I am trying to figure out the most reliable way of restricting login
> > > attempts while using the Auth Component.
>
> > > Here is my best stab at the problem thus far:
>
> > >http://cakeforge.org/snippet/detail.php?type=snippet&id=220
>
> > > I'd love to hear what other people have done, or what they think of
> > > the method I am using in the code snipped I've linked to.
>
> > > -Aran
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Restricting Login Attempts with Auth Component

2008-05-22 Thread aranworld

Thanks for the feedback.  I will add some database functionality to it
as well.

One problem I am coming across is that many of my users are all in the
same office with identical IP addresses.  So if one user makes 5
unsuccessful attempts, I run the risk of locking out everyone else in
the office.

I'm thinking that I can have a session based lockout set at 5, but
then make a database lockout with a much higher limit to compensate
for the fact that many users could all enter wrong passwords within a
week's time.  Even if the limit is as high as 100, I still think that
is very likely to combat brute force methods, which usually require
10s of thousands of entries to have any hopes of success.

On May 22, 12:58 pm, davidpersson <[EMAIL PROTECTED]> wrote:
> There's a brute force protection behavior available over at the
> bakery:http://bakery.cakephp.org/articles/view/brute-force-protection
>
> It may need some changes to make it work with 1.2 but I think it's
> simple and does it's job.
>
> On May 22, 9:13 pm, aranworld <[EMAIL PROTECTED]> wrote:
>
> > I am trying to figure out the most reliable way of restricting login
> > attempts while using the Auth Component.
>
> > Here is my best stab at the problem thus far:
>
> >http://cakeforge.org/snippet/detail.php?type=snippet&id=220
>
> > I'd love to hear what other people have done, or what they think of
> > the method I am using in the code snipped I've linked to.
>
> > -Aran
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Restricting Login Attempts with Auth Component

2008-05-22 Thread davidpersson

There's a brute force protection behavior available over at the
bakery:
http://bakery.cakephp.org/articles/view/brute-force-protection

It may need some changes to make it work with 1.2 but I think it's
simple and does it's job.

On May 22, 9:13 pm, aranworld <[EMAIL PROTECTED]> wrote:
> I am trying to figure out the most reliable way of restricting login
> attempts while using the Auth Component.
>
> Here is my best stab at the problem thus far:
>
> http://cakeforge.org/snippet/detail.php?type=snippet&id=220
>
> I'd love to hear what other people have done, or what they think of
> the method I am using in the code snipped I've linked to.
>
> -Aran
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Restricting Login Attempts with Auth Component

2008-05-22 Thread Mathew Nik Foscarini
Assuming that your blocking their IP, because you think a hacking attempt is 
taking place.

Usually, hacking attempts are performed by robots, and it wouldn't be hard to 
have the robot retry every 5 minutes.

I think storing the IP address in the session isn't useful. If they fail to 
login after the number of tries, then this IP should be stored in a black list 
database. The IP address can have a TTL value that expires in say 30 days.

What's important is the IP address attacking the website. A robot could attack 
all the known users for a domain. Where the user name is shown a robot can just 
process all the account looking for someone stupid enough to use a commonly 
known password.

This would be a strict approach.


- Original Message 
From: aranworld <[EMAIL PROTECTED]>
To: CakePHP 
Sent: Thursday, May 22, 2008 3:13:57 PM
Subject: Restricting Login Attempts with Auth Component


I am trying to figure out the most reliable way of restricting login
attempts while using the Auth Component.

Here is my best stab at the problem thus far:

http://cakeforge.org/snippet/detail.php?type=snippet&id=220

I'd love to hear what other people have done, or what they think of
the method I am using in the code snipped I've linked to.

-Aran


  
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Restricting Login Attempts with Auth Component

2008-05-22 Thread aranworld

I am trying to figure out the most reliable way of restricting login
attempts while using the Auth Component.

Here is my best stab at the problem thus far:

http://cakeforge.org/snippet/detail.php?type=snippet&id=220

I'd love to hear what other people have done, or what they think of
the method I am using in the code snipped I've linked to.

-Aran
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Login for Auth Component?

2008-04-30 Thread Howard Glynn
I'd agree with you in most circumstances (inheritance) - in this instance I
broke the advice never to touch the core

The key point is not to write an LdapAuth or WhateverAuth, the objective was
to create a few lines in Auth that allows you to call an external method to
do whatever validation you like (not just ldap, could be anything) (I think
Nate hinted at this earlier in the thread) My few lines of change were
allowed me to do exactly that, in the same style of other parts of Auth.
Provides extra functionality, and stays backward compatible. Allows the core
to delegate responsibility elsewhere, to the developer, seamlessly and in a
generic way not tied to any particular implementation.

As I said originally I was going to add to or launch a new trac ticket with
the possible fix once I'd established what it was and tested it.


On Wed, Apr 30, 2008 at 7:49 PM, Marcin Domanski <[EMAIL PROTECTED]> wrote:

>
> Hey
>
> On Wed, Apr 30, 2008 at 3:49 PM, Aitch <[EMAIL PROTECTED]> wrote:
> >
> >  Folks, this *can* be done if you dig deep enough. I know it is bad
> >  karma to modify the source, but I've done it - to add LDAP
> >  authentication capability to Auth. I even have the diffs against
> >  6311 :-) The trick is to look at the identify() method in auth.php.
> >  Essentially the hard coded call to find needs to be replaced with an
> >  if/else in two places - only 4 extra lines of "real" code, I was very
> >  careful to use what is provided and completely minimise the hack.
> Wouldn't it be better to create a LdapAuth component that would
> inherit from Auth component instead of editing the core ?
>
>
>
> --
> Marcin Domanski
> http://kabturek.info
>
>
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Login for Auth Component?

2008-04-30 Thread Marcin Domanski

Hey

On Wed, Apr 30, 2008 at 3:49 PM, Aitch <[EMAIL PROTECTED]> wrote:
>
>  Folks, this *can* be done if you dig deep enough. I know it is bad
>  karma to modify the source, but I've done it - to add LDAP
>  authentication capability to Auth. I even have the diffs against
>  6311 :-) The trick is to look at the identify() method in auth.php.
>  Essentially the hard coded call to find needs to be replaced with an
>  if/else in two places - only 4 extra lines of "real" code, I was very
>  careful to use what is provided and completely minimise the hack.
Wouldn't it be better to create a LdapAuth component that would
inherit from Auth component instead of editing the core ?



-- 
Marcin Domanski
http://kabturek.info

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Login for Auth Component?

2008-04-30 Thread Aitch

Folks, this *can* be done if you dig deep enough. I know it is bad
karma to modify the source, but I've done it - to add LDAP
authentication capability to Auth. I even have the diffs against
6311 :-) The trick is to look at the identify() method in auth.php.
Essentially the hard coded call to find needs to be replaced with an
if/else in two places - only 4 extra lines of "real" code, I was very
careful to use what is provided and completely minimise the hack.

This hack is the only diversion from standard, the rest can be
achieved by careful use of the hooks and callbacks provided. You have
to use a few tricks that are supported to override things like
hashPasswords. It did take a while to figure it out with heavy use of
pr() etc, and was complicated a bit by an "Employee" rather than
"User" model.

I've got half a bakery article written (on my screen right now, how is
that for a tease) and had in mind a trac ticket with the changes,
which are 100% backward compatible. (essentially, check for presence
of an alternative "authenticateUser" method in the user model, if
exists, then call it)

For the record, I'm using Auth, with authentication via an LDAP stored
password, with a local Employee table with various "cached" data like
user role etc.

This approach would work for any external authentication requirement,
as it leaves you to write the method.

I'm still playing with the right approach to use in beforeFilter() /
isAuthorized() and app_controller / xxx_controllers before I can give
a definitive statement.

Howard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Login for Auth Component?

2008-04-29 Thread BrendonKoz

If one doesn't exist, would an enhancement request help to solidify
that?  Thanks for the update, Nate.

On Apr 29, 4:32 pm, nate <[EMAIL PROTECTED]> wrote:
> The Auth component will *probably* be refactored to provide for an
> adapter-like interface before 1.2 final.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Login for Auth Component?

2008-04-29 Thread nate

The Auth component will *probably* be refactored to provide for an
adapter-like interface before 1.2 final.

On Apr 29, 4:00 pm, Knud Soerensen <[EMAIL PROTECTED]> wrote:
> BrendonKoz wrote:
> > I'd really like to take advantage of CakePHP v1.2's Auth and ACL
> > features, but our user authentication is not stored in a database that
> > I have access to, it is only accessible via a SSL webservice call.
> > This means that users will not initially have any related model data
> > in the User model, and they will *never* have a related password.  I'd
> > like to still use an action of login for the User model.  From what I
> > can tell, the only ways I can do this are a bit hackish...which would
> > be the best (or is there better)?
>
> I am working on site using openid and here it is the same problem.
>
> Maybe the auth module should be rewritten to cover this situation before
> 1.2 is released.
>
> Knud
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Login for Auth Component?

2008-04-29 Thread Knud Soerensen

BrendonKoz wrote:
> I'd really like to take advantage of CakePHP v1.2's Auth and ACL
> features, but our user authentication is not stored in a database that
> I have access to, it is only accessible via a SSL webservice call.
> This means that users will not initially have any related model data
> in the User model, and they will *never* have a related password.  I'd
> like to still use an action of login for the User model.  From what I
> can tell, the only ways I can do this are a bit hackish...which would
> be the best (or is there better)?
>
>   
I am working on site using openid and here it is the same problem.

Maybe the auth module should be rewritten to cover this situation before
1.2 is released.


Knud

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Login for Auth Component?

2008-04-29 Thread Chris Hartjes

On Tue, Apr 29, 2008 at 3:54 PM, BrendonKoz <[EMAIL PROTECTED]> wrote:
>
>  Assuming this is something you've done before, or at least thought
>  through...by a custom model, surely you mean extending the Model class
>  and overriding any incompatible methods, right?  I just checked all of
>  the methods included in the Model class - that's 120 methods according
>  to Zend for Eclipse.  Yikes!

Well, you don't have to override them *all*, just the ones that Auth
is expecting you to use.

>  Regardless, I believe I left out some pertinent information.  There
>  will be user data stored in a table on a local database, it's simply
>  the username and password (used for authentication) that will not be
>  accessible in this table.  Would the suggested solution still be the
>  same?

Well, I seem to remember someone who was able to use the Auth
component and talk to a RADIUS server.  phishy, was that you?

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Login for Auth Component?

2008-04-29 Thread BrendonKoz

Assuming this is something you've done before, or at least thought
through...by a custom model, surely you mean extending the Model class
and overriding any incompatible methods, right?  I just checked all of
the methods included in the Model class - that's 120 methods according
to Zend for Eclipse.  Yikes!

Regardless, I believe I left out some pertinent information.  There
will be user data stored in a table on a local database, it's simply
the username and password (used for authentication) that will not be
accessible in this table.  Would the suggested solution still be the
same?


On Apr 29, 2:39 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 29, 2008 at 2:29 PM, BrendonKoz <[EMAIL PROTECTED]> wrote:
>
> >  I'd really like to take advantage of CakePHP v1.2's Auth and ACL
> >  features, but our user authentication is not stored in a database that
> >  I have access to, it is only accessible via a SSL webservice call.
> >  This means that users will not initially have any related model data
> >  in the User model, and they will *never* have a related password.  I'd
> >  like to still use an action of login for the User model.  From what I
> >  can tell, the only ways I can do this are a bit hackish...which would
> >  be the best (or is there better)?
>
> Well, you could always write a custom model that connects to your SSL
> webservice, and make sure to include the methods that it would expect
> from a model.
>
> Inconvenient?  Yes.  Best solution?  Maybe.
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Login for Auth Component?

2008-04-29 Thread mbavio

And dont forget to share it with the community after finished :P

Cheers,
mbavio
mbavio.com.ar

On Apr 29, 3:39 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 29, 2008 at 2:29 PM, BrendonKoz <[EMAIL PROTECTED]> wrote:
>
> >  I'd really like to take advantage of CakePHP v1.2's Auth and ACL
> >  features, but our user authentication is not stored in a database that
> >  I have access to, it is only accessible via a SSL webservice call.
> >  This means that users will not initially have any related model data
> >  in the User model, and they will *never* have a related password.  I'd
> >  like to still use an action of login for the User model.  From what I
> >  can tell, the only ways I can do this are a bit hackish...which would
> >  be the best (or is there better)?
>
> Well, you could always write a custom model that connects to your SSL
> webservice, and make sure to include the methods that it would expect
> from a model.
>
> Inconvenient?  Yes.  Best solution?  Maybe.
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Login for Auth Component?

2008-04-29 Thread Chris Hartjes

On Tue, Apr 29, 2008 at 2:29 PM, BrendonKoz <[EMAIL PROTECTED]> wrote:
>
>  I'd really like to take advantage of CakePHP v1.2's Auth and ACL
>  features, but our user authentication is not stored in a database that
>  I have access to, it is only accessible via a SSL webservice call.
>  This means that users will not initially have any related model data
>  in the User model, and they will *never* have a related password.  I'd
>  like to still use an action of login for the User model.  From what I
>  can tell, the only ways I can do this are a bit hackish...which would
>  be the best (or is there better)?

Well, you could always write a custom model that connects to your SSL
webservice, and make sure to include the methods that it would expect
from a model.

Inconvenient?  Yes.  Best solution?  Maybe.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Custom Login for Auth Component?

2008-04-29 Thread BrendonKoz

I'd really like to take advantage of CakePHP v1.2's Auth and ACL
features, but our user authentication is not stored in a database that
I have access to, it is only accessible via a SSL webservice call.
This means that users will not initially have any related model data
in the User model, and they will *never* have a related password.  I'd
like to still use an action of login for the User model.  From what I
can tell, the only ways I can do this are a bit hackish...which would
be the best (or is there better)?

1. $this->Auth->loginAction = array('admin' => false, 'controller' =>
'members', 'action' => 'someOtherNonUsedActionName');
...then use my login action, calling the Auth login() method.

2. Don't use a User/login route, use something different and call the
Auth login() method; you can then, if you so choose, modify the Router
config file (would that break Auth?)

3. ...and I thought I had a third way with using Auth's
autoRedirect(), but I can't recall what that was at this time.


Surely there's a better, more standardized way to override the default
behavior of the login method when using the Authentication Component
if necessary?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component Question

2008-04-26 Thread Chris Hartjes

On Sat, Apr 26, 2008 at 3:05 AM, Kyle Decot <[EMAIL PROTECTED]> wrote:
>  function login() {
>
>  if ($this->Auth->user()) {
>
>  echo "working so far";
>
>  }
>  else { echo "not working at all"; }
>
>  }
>
>  the page always returns "not working at all". Am I doing something
>  wrong with this tutorial? Is there another way I should be going about
>  this? Thank you as always for the help.

According to the API:

"Returns:
array User record, or null if no user is logged in"

So, if you keep getting null that means you're not successully logged
in, so I suspect that the problem might be somewhere else.  I suggest
you paste your code in http://bin.cakephp.org so others can take a
look at your entire setup.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



<    2   3   4   5   6   7   8   9   >