Yii2 Password


(Kvisweswaran) #1

This is a discussion forum for the yii2-password extension. The extension provides a couple of great password management utilities for Yii Framework 2.0. It has a separate StrengthValidator that allows password strength validation through your model. In addition, it also provides an advanced password input widget, that allows you to display/hide text and show the password strength. You can view the documentation and demos of the StrengthValidator and the PasswordInput widget in action.


(Cornernote) #2

Awesome to see Yii2 extensions being created already. Thanks for the release!


(Kvisweswaran) #3

Thanks. Yes. This should be a much better and expected release of Yii to work with.


(Kvisweswaran) #4

Resolved issue of toggle mask not validating/showing Password with multiple widgets on same page (as pointed out by DocSnyder).

Currently, the widget allows multiple widgets on same page in which you can control the display of the strength meter and toggle Mask.


(Kvisweswaran) #5

Translation into languages will be taken up as an enhancement. Will appreciate anyone volunteering for translations into languages.


(Pascalbrewing) #6

i can spend German …


(Kvisweswaran) #7

Internationalization and translations for both StrengthValidator and PasswordInput have been implemented. Tested for French messages (translations courtesy Google translate) and the message files are included. You can submit a Pull Request for other languages. I have included a skeleton template for German (DE) messages.


(Kvisweswaran) #8

[size="3"]PasswordInput[/size] has been enhanced now to work with ActiveField in a better way (no more need of passing $form property). In addition, you can now use this widget with or without an ActiveForm or model. Please change your codes in case you are using these widgets.

For example:




// add this in your view

use kartik\password\PasswordInput;


// Usage with ActiveForm

echo $form->field($model, 'password')->widget(

    PasswordInput::classname(),

    ['showMeter' => true]

);


// Usage with model and without ActiveForm 

echo PasswordInput::widget([

    'model' => $model, 

    'attribute' => 'password_1',

    'showMeter' => true,

]);


// Usage without a model or ActiveForm

echo PasswordInput::widget([

    'name' => 'password_2',

    'showMeter' => true,

]);




(Kvisweswaran) #9

Extension upgraded to version 2.0. PasswordInput widget uses the newly created Strength Meter JQuery plugin. View the plugin documentation and/or demo.

For the PasswordInput widget, check documentation or view a demo.

Older version has been relegated to a version1.0 branch on github. Users upgrading to version 2.0 — please see the documentation for usage.