Redirect Question

2016-04-06 Thread MikeK
I have used $this->redirect($url, null, TRUE) for years in cakephp 1.2 and 
1.3 when needing to cross a controller boundary.

I recently for the first time tried to use redirect with the 3rd parm set 
to FALSE so it will return to the calling controller for further 
processing, however for some reason when I set the 3rd parm to FALSE the 
target controller is not called at all.

I went into controller.php and traced the code and it indeed is attempting 
to set $this->header to the correct "Location: url" and the url looks 
perfect etc - however there is no actual redirection.

What am I missing? Is there something going on with route caching perhaps?

I am processing an array and redirecting to another controller for each 
element, and if I change the 3rd parm to TRUE, indicating I want the action 
stopped after the redirect completes the target controller is indeed 
called, but of course control does not return to my controller processing 
the array. Also the aforementioned trace looks identical when I set the 3rd 
parm to TRUE...

Any ideas would be greatly appreciated.

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirect Question

2009-06-04 Thread Miles J

$this->redirect(array('controller' => 'posts', 'action'  =>
'comment', $post['Post']['id']));

On Jun 4, 2:29 pm, Andreas Derksen  wrote:
> $this->redirect($this->referer());
>
> greets
> Andreas
>
> cakephp_rocks schrieb:
>
> > $this->redirect(array('controller' => 'posts', 'action'  =>
> > 'comment'));
>
> > is there anyway i could put
>
> > $this->redirect(posts/comment/ $post['Post']['id'] ));
> > whats a good sloution to do that i want my user to  comment and
> > redirect back to there post the commented
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Redirect Question

2009-06-04 Thread Andreas Derksen

$this->redirect($this->referer());

greets
Andreas

cakephp_rocks schrieb:
> $this->redirect(array('controller' => 'posts', 'action'  =>
> 'comment'));
>
>
> is there anyway i could put
>
> $this->redirect(posts/comment/ $post['Post']['id'] ));
> whats a good sloution to do that i want my user to  comment and
> redirect back to there post the commented
>
> >
>   

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Redirect Question

2009-06-04 Thread cakephp_rocks

$this->redirect(array('controller' => 'posts', 'action'  =>
'comment'));


is there anyway i could put

$this->redirect(posts/comment/ $post['Post']['id'] ));
whats a good sloution to do that i want my user to  comment and
redirect back to there post the commented

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: redirect question - FIXED

2009-05-15 Thread Dave Maharaj :: WidePixels.com
Sorry to bother minor oversight.
 
 
$this->Auth->autoRedirect = true; was the problem
 
changed to
 
$this->Auth->autoRedirect = false;

  _  

From: Dave Maharaj :: WidePixels.com [mailto:d...@widepixels.com] 
Sent: May-15-09 11:54 AM
To: cake-php@googlegroups.com
Subject: redirect question


I am trying to direct a user upon successful login. It was working but now
its just going directly to the default case.
 
Is there something missing?
 
function login()
  {
  if ($this->Auth->user()) {
  if (!empty($this->data)) {
  $san = new Sanitize();
  $this->data['User']['username'] =
$san->paranoid($this->data['User']['username']);
  
$group = $this->Auth->user('group_id');
  switch ($group) {
  case 1:
  $this->redirect(array('controller' =>
'admin/users', 'action' => 'index'));
  break;
  case 2:
  $this->redirect(array('controller' => managers',
'action' => 'index'));
  break;
  case 3:
  $slug = $this->Auth->user('slug');
  $this->redirect(array('controller' => 'investors',
'action' => 'profile/' . $slug));
  break;
  case 4:
  $slug = $this->Auth->user('slug');
  $this->redirect(array('controller' => 'agents',
'action' => 'profile/' . $slug));
  break;
  default:
//should never get here
  $this->redirect(array('controller' => 'posts',
'action' => 'index'));
  }

  }
  }
  if (empty($this->data)) {
  // Check to see if they are logged in
..
  }
  // Perform other checks on the empty data and set up the form.
 ...  }
  }
  }
  }
 
Dave 




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



redirect question

2009-05-15 Thread Dave Maharaj :: WidePixels.com
I am trying to direct a user upon successful login. It was working but now
its just going directly to the default case.
 
Is there something missing?
 
function login()
  {
  if ($this->Auth->user()) {
  if (!empty($this->data)) {
  $san = new Sanitize();
  $this->data['User']['username'] =
$san->paranoid($this->data['User']['username']);
  
$group = $this->Auth->user('group_id');
  switch ($group) {
  case 1:
  $this->redirect(array('controller' =>
'admin/users', 'action' => 'index'));
  break;
  case 2:
  $this->redirect(array('controller' => managers',
'action' => 'index'));
  break;
  case 3:
  $slug = $this->Auth->user('slug');
  $this->redirect(array('controller' => 'investors',
'action' => 'profile/' . $slug));
  break;
  case 4:
  $slug = $this->Auth->user('slug');
  $this->redirect(array('controller' => 'agents',
'action' => 'profile/' . $slug));
  break;
  default:
//should never get here
  $this->redirect(array('controller' => 'posts',
'action' => 'index'));
  }

  }
  }
  if (empty($this->data)) {
  // Check to see if they are logged in
..
  }
  // Perform other checks on the empty data and set up the form.
 ...  }
  }
  }
  }
 
Dave 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Route Redirect question

2008-05-03 Thread simonb

I think in your htaccess file. Something along the lines of


RewriteEngine on
RewriteRule ^/foo/(*) webroot/$1 [L]
RewriteRule^$webroot/[L]
RewriteRule(.*) webroot/$1[L]
 

On May 3, 1:49 pm, MikeK <[EMAIL PROTECTED]> wrote:
> The specific route to fix our payment gateway issue for payments
> initiated before we restructured the site appears to work. The other
> bit I am wondering if we need something in .htaccess to generally
> rewrite these requests? And if that's the better place to do it, how?
> the rewrite rules are something we've never quite mastered.
--~--~-~--~~~---~--~~
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: Route Redirect question

2008-05-03 Thread MikeK

The specific route to fix our payment gateway issue for payments
initiated before we restructured the site appears to work. The other
bit I am wondering if we need something in .htaccess to generally
rewrite these requests? And if that's the better place to do it, how?
the rewrite rules are something we've never quite mastered.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Route Redirect question

2008-05-03 Thread MikeK

We used to have our cake app running in a subdir off our public_html
called "foo". SO all cake paths were
http://mysite.com/foo/controller/action/

We moved the app to the root sirectory and restructured the site to
let everything else hang from the cake app's webroot. As a result we
have some users with old links that will 404 - one of these users is a
payment gateway that has been missing us (oops).

I put in a route for the payment gateway routine specifically:
Router::connect('/foo/user/paid', array('controller' => 'user',
'action' => 'paid'));

How can I make that route or another generall route all the old
requests to our site with foo in the path work properly? IE translate:
http://mysite.com/foo/controller/action/p1/p2/

into
http://mysite.com/controller/action/p1/p2/

For any controller with any number of arguments?

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