Thanks, I'm trying to use it. Something strange is going on (probably
unrelated to the TinyAuth plugin).
When I visit the root of the site (http://example.org/) I expect Cake
to redirect to operators/login, but it instead gets me to users/login.
There IS a UsersController, but it's prefixed under /admin like this:
Router::connect('/admin', array('controller' => 'users', 'action' =>
'index', 'admin' => true));
Here's my Controller/OperatorsController.php:
class OperatorsController extends AppController # (AppController is
empty)
{
public $components = array(
'Session',
'Auth' => array(
'loginRedirect' => array('controller' =>
'operators', 'action' => 'index'),
'logoutRedirect' => array('controller' =>
'operators', 'action' => 'index')));
public function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('login', 'logout');
}
public function login() {
if ($this->request->isPost()) {
if ($this->Auth->login()) {
$this->redirect($this->Auth-
>redirect());
} else {
$this->Session->setFlash(__('Invalid
username or password, try again'));
}
}
}
public function logout() {
$this->redirect($this->Auth->logout());
}
public function index() {
}
}
Here.s my Config/routes.php
Router::connect('/', array('controller' => 'operators',
'action' => 'index'));
Router::connect('/admin', array('controller' => 'users',
'action' => 'index', 'admin' => true));
Router::connect('/:action', array('controller' =>
'operators'));
#Router::connect('/pages/*', array('controller' => 'pages',
'action' => 'display'));
CakePlugin::routes();
require CAKE . 'Config' . DS . 'routes.php';
Can you tell me why it keeps throwing me to an unrelated users/login?
I'm not even accessing that controller.
--
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