This extension by default will return 8 characters long password and you can also provide optional parameters to make the password more complex.
Requirements ¶
Tested with Yii 1.1.10 and 1.1.12. may work on other versions
Installation ¶
- Extract the file under protected/extensions folder.
- In main.php file:
'components' => array(
....
'epassgen' => array(
'class' => 'ext.epasswordgenerator.EPasswordGenerator',
),
....
Default Usage ¶
$passowrd = Yii::app()->epassgen->generate();
Usage with optional parameters ¶
$passowrd = Yii::app()->epassgen->generate(10, 2, 3, 2);
diceware
In my usr extension I'm using a diceware passphrase generator, generating passwords using words instead of chars that are supposed to be remembered more easily. Check out the Diceware component.
It's not advertising, just a tip of other methods of generating passwords.
Thanks for the info :)
For easy to remember passphrase, the 'Diceware component' is a good component to use.
Default usage
this default usage we can used in the _form.php like this,
"$passowrd = Yii::app()->epassgen->generate();" & $passowrd = Yii::app()->epassgen->generate(10, 2, 3, 2);
$passowrd = Yii::app()->epassgen->generate(); <div class="row"> <?php echo $form->labelEx($model,'password'); ?> <?php echo $form->textField($model,'password',array('size'=>20,'maxlength'=>20, value=$password)); ?> <?php echo $form->error($model,'password'); ?> </div>
am using textfield because i want to know the auto generated password for my reference.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.