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 <b>var
> $othAuthRestrictions = null;</b>).
>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to