#6127: undefined index by using Security Component
---------------------------+------------------------------------------------
Reporter: amarradi | Type: Bug
Status: new | Priority: Medium
Milestone: 1.2.x.x | Component: General
Version: 1.2 Final | Severity: Normal
Keywords: | Php_version: PHP 5
Cake_version: 1.2.1.8004 |
---------------------------+------------------------------------------------
Hello together,
[[BR]][[BR]]
i'm writing a very simple cakePHP Application for my personal study...
So all Action are running very good CakePHP is a great Framework :) Also
the Auth Component runs very good, i get an very simple user
Authentication.
But when i add and use the security Component i get always an error in the
controller the use it.
{{{
Notice (8): Undefined index: User [APP/controllers/users_controller.php,
line 48]
}}}
{{{
var $components = array('Dievocap','Auth','Security');
function add() {
$iTotal = $this->User->find('count',
array(
'conditions' => array(
// 'user_id' => $iUserId*/ //A step for usermanagement
'username' => $this->data['User']['username']
// ,'language2' => $this->data['Translate']['language2']
)
)
);
if ( $iTotal > 0 ) { /// User exists
...
}
}}}
The line 48
is
{{{
'username' => $this->data['User']['username']
}}}
my beforeFilter Action looks so
{{{
function beforeFilter() {
parent::beforeFilter();
$this->Security->requireAuth('add');
$this->Auth->allow('add');
$this->set('ids',$this->Auth->user('id'));
$this->set('username',$this->Auth->user('username'));
}
}}}
When i remove the Component in the $components Array it runs normally.
Is it an bug, or is it an failure by me?
many greetings
Marcus Radisch
--
Ticket URL: <https://trac.cakephp.org/ticket/6127>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---