CakePHP AppController strange behaviour -


i'm following cakephp (latest) bookmarkers tutorial (part 2 - auth). going correctly until adding following in appcontroller.php file:

'authorize' => 'controller', 

which stops me being able access either users list or tags list. can see bookmarks list. have been through tutorial twice. first time typed out code, did full reinstall of framework , cut'n'pasted code, testing @ each paste , seems line breaks app. controller method in full supposed this:

public function initialize() { $this->loadcomponent('flash'); $this->loadcomponent('auth', [     'authorize'=> 'controller', //added line - breaks stuff     'authenticate' => [         'form' => [             'fields' => [                 'username' => 'email',                 'password' => 'password'             ]         ]     ],     'loginaction' => [         'controller' => 'users',         'action' => 'login'     ],     'unauthorizedredirect' => $this->referer()  // added line - not sure if breaks stuff on own ]);  // allow display action our pages controller // continues work. $this->auth->allow(['display']); 

}

and 'authorized' , 'unauthorizedredirect' values in initialize() method break example. has come across behaviour also? in firefox, page saying page isn't redirecting properly. comment out 2 lines , works fine...

this means need loggedin accessing url of application. if want access url without login add in controller $this->auth->allow('index');


Comments