Thursday, August 6, 2015

Question about _setDefaults() in AuthComponent

/**
 * Attempts to introspect the correct values for object properties.
 *
 * @return boolean
 */

   
protected function _setDefaults() {
        $defaults
= array(
           
'logoutRedirect' => $this->loginAction,
           
'authError' => __d('cake', 'You are not authorized to access that location.')
       
);
       
foreach ($defaults as $key => $value) {
           
if (empty($this->{$key})) {
                $this
->{$key} = $value;
           
}
       
}
       
return true;
   
}

Enter code here...

My question is about the above method.  I've run IBM AppScan and it's raised an issue with my login page (I believe it to be a false positive), but after looking at the response the auth message on the page is coming from here.  Can someone explain what this method does and why it might have been thrown?  Just trying to understand why an attempt to login in on my page might throw this authError.  I don't know how to replicate the issue myself, but AppScan is doing it.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: