Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pre populationg password field zend framework

I have created a login form with a remember me checkbox. I have set cookie if the user checks the remember me link. I read the cookie the next time user opens the page. I am able to populate the username field but I'm unable to populate the password field. Is there any way to populate it?

like image 758
anurodh Avatar asked Dec 12 '25 23:12

anurodh


2 Answers

You have to set "true" to the propertie "renderPassword" like:

$password = new Zend_Form_Element_Password('senha');
$password->renderPassword = true;
$password->setValue("Senha");
like image 107
Regis Avatar answered Dec 16 '25 06:12

Regis


You should never pre-populate the password field. You would be taking the user's password and putting it in plain text in the value attribute of the element. Here is an example of implementing remember me functionality in Zend Framework. It may not be 100% current, but its a decent jumping off point.

like image 41
ashurexm Avatar answered Dec 16 '25 08:12

ashurexm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!