Adding fix for Ticket #2773, fixes Security Component requireAuth

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5306 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-06-20 03:10:15 +00:00
parent 32c092ecff
commit 902c6fa173

View file

@ -356,14 +356,14 @@ class SecurityComponent extends Object {
* @access private
*/
function __authRequired(&$controller) {
if(is_array($this->requireAuth) && !empty($this->requireAuth) && !empty($controller->params)) {
if(is_array($this->requireAuth) && !empty($this->requireAuth) && !empty($controller->data)) {
if(in_array($controller->action, $this->requireAuth) || $this->requireAuth == array('*')) {
if(!isset($controller->params['_Token'] )) {
if(!isset($controller->data['__Token'] )) {
if(!$this->blackHole($controller, 'auth')) {
return null;
}
}
$token = $controller->params['_Token']['key'];
$token = $controller->data['__Token']['key'];
if($this->Session->check('_Token')) {
$tData = unserialize($this->Session->read('_Token'));