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

Reply via email to