[extension] estrongpassword

This thread is for any discussion related to the estrongpassword extension:


I wanted the widget to return the score as captureOutput.

Is it possible?


Nice extension… but… let me suggest some fixes:

in the wrapper change this:


80:    		$reqs = CJavaScript::encode($this->requirementOptions);

So when you need to "customize" the plugin just do that:


  <div class="row">

	<?php echo $form->labelEx($model, 'password'); ?>


	$verdicts = array(Yii::t('textos', 'Unsecure'),

                    	Yii::t('textos', 'Normal'),

                    	Yii::t('textos', 'Medium'),

                    	Yii::t('textos', 'Strong'), 

                    	Yii::t('textos', 'Very Strong'));

	$message = Yii::t('texts', 'You must enter a minimum of %d characters');

	$reqs = array(

 'displayMinChar'=> true,

 'minChar'=> 8,

 'minCharText'=> $message,

 'colors'=> array("#f00", "#c06", "#f60", "#3c0", "#3f0"),

 'scores'=> array(20, 30, 43, 50),

 'verdicts'=>  $verdicts,

 'raisePower'=> 1.4,

 'length'=> 0,

 'lowercase'=> 1,

 'uppercase'=> 3,

 'one_number'=> 3,

 'three_numbers'=> 5,

 'one_special_char'=> 3,

 'two_special_char'=> 5,

 'upper_lower_combo'=> 2,

 'letter_number_combo'=> 2,

 'letter_number_char_combo'=> 2,

 'length'=> true,

 'lowercase'=> true,

 'uppercase'=> true,

 'one_number'=> true,

 'three_numbers'=> true,

 'one_special_char'=> true,

 'two_special_char'=> true,

 'upper_lower_combo'=> true,

 'letter_number_combo'=> true,

 'letter_number_char_combo'=> true);


                         	array('form' => $form,

                                       'model' => $model, 

                                   	'attribute' => 'password', 

                                   	'requirementOptions' => $reqs));


	<?php echo $form->error($model, 'password'); ?>

An Yii will do the hard work!..



I am trying to use the extension, today. By README, I added options. But it doesn’t go well.

	<div class="row">

		<?php echo $form->labelEx($model,'password',array('label'=>'Password (8...20 Letter/Number/Symbol Combination)') ); ?>

		<?php //echo $form->passwordField($model,'password',array('size'=>20,'maxlength'=>256)); ?>

		<?php $this->widget('ext.EStrongPassword.EStrongPassword',

				array('form'=>$form, 'model'=>$model, 'attribute'=>'password', 



		<?php echo $form->error($model,'password'); ?>


error output:


Property "EStrongPassword.requirementsOptions" is not defined. 

Sorry, that example was bad – it should be "requirementOptions" singular on the requirement. I will update the extension documentation.

Hi, Dana.

Very nice extension.

I want to know if there’s any way to use it also on server side validation.

A way to send the strength in order to be used with a model validator, maybe?


Hello Dana,

I have installed the extension and it is very amazing :).

Could you please answer a question?

is there possibility to restrict user to use weak and normal passwords?




I got this error "Object of class EStrongPassword could not be converted to string ".

Below is my code on my form:

echo $this->widget('ext.EStrongPassword.EStrongPassword', array('form'=>$form, 'model'=>$model, 'attribute'=>'password','requirementOptions'=>array('minChar'=>8,'one_special_char'=>true)));

I also put the EStrongPassword folder into /protected/extensions.

Do I need to add some codes on the main config file to make it work?

I would greatly appreciate for your help.