Re: How to execute OthAuth protected actions with a CRON job?

2007-04-07 Thread CraZyLeGs

log someone without password ? eh talk about security..
maybe a hash of the password and login with some salt

Anyway look here http://bakery.cakephp.org/articles/view/99 in the
comments "11  Howto automaticly sign in a user."

On Apr 6, 11:54 pm, "Bootstrapper" <[EMAIL PROTECTED]>
wrote:
> Excellent! Thanks CraZyLeGs!
>
> Just to verify - I assume the PHP code you're talking about below goes
> into the PHP file that the CRON job calls, right? This is basically
> the code for logging someone directly through code, rather than
> through the login form.
>
> But isn't there a way to directly log someone in without knowing there
> password? I also need my users to be able to link into their account
> by email, so far the only methods I know for doing that require me to
> keep their clear-text passwords, which is obviously not good.
>
> Any suggestions?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: How to execute OthAuth protected actions with a CRON job?

2007-04-07 Thread CraZyLeGs

log someone without password ? eh talk about security..
maybe a hash of the password and login with some salt

Anyway look here http://bakery.cakephp.org/articles/view/99 in the
comments "11  Howto automaticly sign in a user."

On Apr 6, 11:54 pm, "Bootstrapper" <[EMAIL PROTECTED]>
wrote:
> Excellent! Thanks CraZyLeGs!
>
> Just to verify - I assume the PHP code you're talking about below goes
> into the PHP file that the CRON job calls, right? This is basically
> the code for logging someone directly through code, rather than
> through the login form.
>
> But isn't there a way to directly log someone in without knowing there
> password? I also need my users to be able to link into their account
> by email, so far the only methods I know for doing that require me to
> keep their clear-text passwords, which is obviously not good.
>
> Any suggestions?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: How to execute OthAuth protected actions with a CRON job?

2007-04-06 Thread Bootstrapper

Excellent! Thanks CraZyLeGs!

Just to verify - I assume the PHP code you're talking about below goes
into the PHP file that the CRON job calls, right? This is basically
the code for logging someone directly through code, rather than
through the login form.

But isn't there a way to directly log someone in without knowing there
password? I also need my users to be able to link into their account
by email, so far the only methods I know for doing that require me to
keep their clear-text passwords, which is obviously not good.

Any suggestions?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: How to execute OthAuth protected actions with a CRON job?

2007-04-05 Thread CraZyLeGs

Hi,

well, requestAction() goes through the whole pipe and auth is in
there.
if the action protected is in the same controller then do $this-
>myaction() instead of requestAction.
If however it's in another controller then it's problematic.
You can do something though: you need to disable auto redirects in
othAuth, login() and then call requestAction. logout() if you need
afterwards.

something like( not tested):
$this->othAuth->auto_redirect = false;
$this->data[$this->othAuth->user_model][$this->othAuth-
>user_login_var] = 'login';
$this->data[$this->othAuth->user_model][$this->othAuth-
>user_passw_var] = 'password';
if($this->othAuth->login() == 1) // you are logged in now
{
  $this->set('percentage', $this->requestAction('/actions/
get_percentage/'.$user_id));
  $this->othAuth->logout();
}

Note, you need to have permission to the action you're requestAction()-
ing
you can create a user that only have access to this particular action.

maybe there is an easier method but this one is not in state of sin.

On 3 avr, 22:54, "Bootstrapper" <[EMAIL PROTECTED]> wrote:
> I'm generating a view that is emailed to my subscribers regularly
> through a CRON job. It works fine if the CRON job is only accessing
> actions that are unprotected by OthAuth (for example if var
> $othAuthRestrictions = null;).
>
> It's alright if the initial action being called is unprotected, but
> it's critical that this action call other actions which are protected.
> As soon as the action is protected by OthAuth, however, the CRON just
> stops executing with that call.
>
> Any ideas on how to solve this?
>
> I can't be the only one trying to run protected actions wtih a CRON
> job, right?
>
> This is the line where the action stops functioning:
>
> $this->set('percentage', $this->requestAction('/actions/
> get_percentage/'.$user_id));
>
> But if I set  var $othAuthRestrictions = null
> in the ActionsController, then everything runs fine. (But anyone can
> access my ActionController actions without logging in.)
>
> Many thanks for you help!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



How to execute OthAuth protected actions with a CRON job?

2007-04-03 Thread Bootstrapper

I'm generating a view that is emailed to my subscribers regularly
through a CRON job. It works fine if the CRON job is only accessing
actions that are unprotected by OthAuth (for example if var
$othAuthRestrictions = null;).

It's alright if the initial action being called is unprotected, but
it's critical that this action call other actions which are protected.
As soon as the action is protected by OthAuth, however, the CRON just
stops executing with that call.

Any ideas on how to solve this?

I can't be the only one trying to run protected actions wtih a CRON
job, right?

This is the line where the action stops functioning:

$this->set('percentage', $this->requestAction('/actions/
get_percentage/'.$user_id));

But if I set  var $othAuthRestrictions = null
in the ActionsController, then everything runs fine. (But anyone can
access my ActionController actions without logging in.)

Many thanks for you help!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---