Hey,
I am really not sure why you would want this.. but not knowing your
project, I am sure you have your reasons.
One method that comes to mind is forcing the password.
Essentially, assign a common password to all users on creation, and use the
callbacks to force the password to something on login, or use a hidden
field (since you dont really need passwords, making the password completely
readable, but hidden on the form, would not pose a security risk, really).
So, on the UsersController, afterSave() update the password to be some
generic password.
And on your login form:
<?php echo $form->input('password', array('type' => 'hidden', 'value' =>
'genericpassword')); ?>
That should cover you :-)
I dont recommend only requiring a username to login... unless the stored
data is completely trivial.
Cheers
--
Cheers,
Graham Weldon
w. http://grahamweldon.com
e. [email protected]
On Thu, 5 Feb 2009 17:49:48 -0800 (PST), datgs <[email protected]>
wrote:
> Hi everybody,
>
> I've had to rewrite code in AuthComponent class to login with username
> only.
>
> Was it the best way for my purpose. Is there any way without changing
> the code in AuthComponent.
>
> Thanks,
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---