I have a change_password action that when submitted goes to index,
even though it's <form action=/change_password method=post>

I check that in beforeFilter():

        public function beforeFilter() {
                $this->Auth->allow('login', 'logout',
'change_password');
                if ($this->params['action'] != 'change_password') {
                        debug($this->params['action']); exit;
                        $user = $this->Auth->user();
                        if (strtotime($user['password_expiration']) <=
time()) {
                                $this->Session->setFlash(__('Your
password has expired, please change it'));
                                $this->redirect(array('action' =>
'change_password'));
                        }
                }
        }

        public function change_password() {
                if ($this->request->isPost()) {
                         # handle password change request
                }
        }

so when I hit submit $this->params['action'] is somehow NOT
change_password, but index.
Here's my Config/routes.php:
        Router::connect('/:action', array('controller' => 'milli'));
        Router::connect('/', array('controller' => 'milli', 'action'
=> 'index'));

What's going on? How to fix this?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to