Re: odd form field behavior when implementing auth

2010-04-09 Thread Jeremy Burns
Try:

echo $this->Form->input('employee_id', array('type' => 'text'));

I think the reason it is hiding it is because Cake usually hides id fields on 
add/edit views - probably does the same for a login form too? But I'm guessing 
a bit.

Jeremy Burns
jeremybu...@me.com
On 9 Apr 2010, at 18:39, Ben W. wrote:

> hello -
> 
> I am trying to figure out why a form page for login refuses to display
> a field with the name employee_id.
> 
> code is as follows:
> 
> model:
> class User extends AppModel {
>var $useTable = 'employees';
>var $primaryKey = 'employee_id';
> }
> 
> controller:
> class UsersController extends AppController {
> 
>   var $name = 'Users';
>   var $helpers = array('Html', 'Form');
>   var $components = array('Auth');
> 
>function beforeFilter() {
>Security::setHash("md5");
>$this->Auth->fields = array('password' =>
> 'employee_password','username' => 'employee_id');
>$this->Auth->loginAction = array('controller' => 'users',
> 'action' => 'login');
>$this->Auth->loginRedirect = array('controller' =>
> 'dashboard', 'action' => 'index');
>$this->Auth->loginError = 'No username and password was
> found with that combination.';
>$this->Auth->logoutRedirect = '/';
> 
>}
> 
>function login() {
> 
>}
> 
>function logout() {
>$this->redirect($this->Auth->logout());
>}
> }
> 
> view:
>$session->flash('auth');
>echo $form->create('User', array('action' => 'login'));
>echo $form->input('employee_id');
>echo $form->input('employee_password');
>echo $form->end('Login');
> 
> 
> Yet the result is http://dl.dropbox.com/u/178319/cake-arg.jpeg
> 
> Any ideas why it refuses to show the input form field employee_id ?
> 
> Thanks
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
> 
> To unsubscribe, reply using "remove me" as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


odd form field behavior when implementing auth

2010-04-09 Thread Ben W.
hello -

I am trying to figure out why a form page for login refuses to display
a field with the name employee_id.

code is as follows:

model:
class User extends AppModel {
var $useTable = 'employees';
var $primaryKey = 'employee_id';
}

controller:
class UsersController extends AppController {

var $name = 'Users';
var $helpers = array('Html', 'Form');
var $components = array('Auth');

function beforeFilter() {
Security::setHash("md5");
$this->Auth->fields = array('password' =>
'employee_password','username' => 'employee_id');
$this->Auth->loginAction = array('controller' => 'users',
'action' => 'login');
$this->Auth->loginRedirect = array('controller' =>
'dashboard', 'action' => 'index');
$this->Auth->loginError = 'No username and password was
found with that combination.';
$this->Auth->logoutRedirect = '/';

}

function login() {

}

function logout() {
$this->redirect($this->Auth->logout());
}
}

view:
$session->flash('auth');
echo $form->create('User', array('action' => 'login'));
echo $form->input('employee_id');
echo $form->input('employee_password');
echo $form->end('Login');


Yet the result is http://dl.dropbox.com/u/178319/cake-arg.jpeg

Any ideas why it refuses to show the input form field employee_id ?

Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.