Skip to content

Commit

Permalink
Updates to release v1.5.7 fixes #79
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed May 16, 2022
1 parent 9c72cfd commit 59910c8
Show file tree
Hide file tree
Showing 11 changed files with 198 additions and 98 deletions.
7 changes: 7 additions & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change Log: `yii2-password`
===========================

## Version 1.5.7

**Date:** 16-May-2022

- PHP 8.1 enhancements for native functions.
- (enh #79): Enhancement to input group addons for Bootstrap 5.x.

## Version 1.5.6

**Date:** 15-Jun-2020
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 - 2020, Kartik Visweswaran
Copyright (c) 2014 - 2022, Kartik Visweswaran
Krajee.com
All rights reserved.

Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@
yii2-password
<hr>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU"
title="Donate via Paypal" target="_blank">
<img src="http://kartik-v.github.io/bootstrap-fileinput-samples/samples/donate.png" alt="Donate"/>
</a>
title="Donate via Paypal" target="_blank"><img height="60" src="https://kartik-v.github.io/bootstrap-fileinput-samples/samples/donate.png" alt="Donate"/></a>
&nbsp; &nbsp; &nbsp;
<a href="https://www.buymeacoffee.com/kartikv" title="Buy me a coffee" ><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" height="60" alt="kartikv" /></a>
</h1>

<div align="center">

[![Stable Version](https://poser.pugx.org/kartik-v/yii2-password/v/stable)](https://packagist.org/packages/kartik-v/yii2-password)
[![Untable Version](https://poser.pugx.org/kartik-v/yii2-password/v/unstable)](https://packagist.org/packages/kartik-v/yii2-password)
[![License](https://poser.pugx.org/kartik-v/yii2-password/license)](https://packagist.org/packages/kartik-v/yii2-password)
[![Total Downloads](https://poser.pugx.org/kartik-v/yii2-password/downloads)](https://packagist.org/packages/kartik-v/yii2-password)
[![Monthly Downloads](https://poser.pugx.org/kartik-v/yii2-password/d/monthly)](https://packagist.org/packages/kartik-v/yii2-password)
[![Daily Downloads](https://poser.pugx.org/kartik-v/yii2-password/d/daily)](https://packagist.org/packages/kartik-v/yii2-password)

</div>

This extension provides a couple of great password management utilities for Yii Framework 2.0. The extension allows password strength validation through your model. In addition, it provides an advanced password input widget, that allows you to display/hide text and show the password strength.

### Release Changes
Expand Down
74 changes: 37 additions & 37 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{
"name": "kartik-v/yii2-password",
"description": "Useful password strength validation utilities for Yii Framework 2.0",
"keywords": [
"yii",
"yii2",
"extension",
"password",
"strength",
"auth",
"input",
"form",
"bootstrap",
"jquery"
],
"homepage": "https://github.com/kartik-v/yii2-password",
"type": "yii2-extension",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Kartik Visweswaran",
"email": "kartikv2@gmail.com",
"homepage": "http://www.krajee.com/"
}
],
"require": {
"kartik-v/strength-meter": "~1.1",
"kartik-v/yii2-krajee-base": ">=2.0"
},
"autoload": {
"psr-4": {
"kartik\\password\\": "src"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.5.x-dev"
}
"name": "kartik-v/yii2-password",
"description": "Useful password strength validation utilities for Yii Framework 2.0",
"keywords": [
"yii",
"yii2",
"extension",
"password",
"strength",
"auth",
"input",
"form",
"bootstrap",
"jquery"
],
"homepage": "https://github.com/kartik-v/yii2-password",
"type": "yii2-extension",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Kartik Visweswaran",
"email": "kartikv2@gmail.com",
"homepage": "http://www.krajee.com/"
}
],
"require": {
"kartik-v/strength-meter": "~1.1",
"kartik-v/yii2-krajee-base": ">=3.0.4"
},
"autoload": {
"psr-4": {
"kartik\\password\\": "src"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.5.x-dev"
}
}
}
41 changes: 31 additions & 10 deletions src/PasswordInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
/**
* @package yii2-password
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @version 1.5.6
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2022
* @version 1.5.7
*/

namespace kartik\password;

use Exception;
use kartik\base\InputWidget;
use ReflectionException;
use Yii;
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
Expand All @@ -19,6 +21,23 @@
* input into a widget with an advanced strength validation meter and toggle mask to show/hide the password. The
* password strength is validated as you type.
*
* For example,
*
* ```php
* // add this in your view
* use kartik\password\PasswordInput;
* use kartik\widgets\ActiveForm; // optional
*
* $form = ActiveForm::begin(['id' => 'login-form']);
* echo $form->field($model,'username');
* echo $form->field($model, 'password')->widget(PasswordInput::classname(), [
* 'pluginOptions' => [
* 'showMeter' => true,
* 'toggleMask' => false
* ]
* ]);
* ```
*
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @since 1.0
* @see http://plugins.krajee.com/strength-meter
Expand Down Expand Up @@ -50,8 +69,8 @@ class PasswordInput extends InputWidget

/**
* @inheritdoc
* @throws \ReflectionException
* @throws \yii\base\InvalidConfigException
* @throws ReflectionException
* @throws Exception
*/
public function run()
{
Expand All @@ -76,29 +95,31 @@ public function run()
* Renders the input template
*
* @return string
* @throws \yii\base\InvalidConfigException
* @throws Exception
*/
protected function renderInputTemplate()
{
$isLeft = $this->togglePlacement === 'left';
$css = 'input-group-addon';
$css = $this->isBs(5) ? 'input-group-text' : 'input-group-addon';
$tog = '{toggle}';
if ($this->isBs4()) {
if ($this->isBs(4)) {
$css = $isLeft ? 'input-group-prepend' : 'input-group-append';
$tog = '<span class="input-group-text">{toggle}</span>';
}
$groupOptions = ['class' => 'input-group'];
$toggle = Html::tag('span', $tog, ['class' => $css]);
if ($this->size === 'lg' || $this->size === 'sm') {
Html::addCssClass($groupOptions, 'input-group-' . $this->size);
Html::addCssClass($groupOptions, 'input-group-'.$this->size);
}
$content = $isLeft ? $toggle . '{input}' : '{input}' . $toggle;
$content = $isLeft ? $toggle.'{input}' : '{input}'.$toggle;

return Html::tag('div', $content, $groupOptions);
}

/**
* Registers the needed assets
* @throws \ReflectionException
*
* @throws Exception
*/
public function registerAssets()
{
Expand Down
6 changes: 3 additions & 3 deletions src/PasswordInputAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
/**
* @package yii2-password
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @version 1.5.6
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2022
* @version 1.5.7
*/

namespace kartik\password;

use kartik\base\AssetBundle;

/**
* Asset bundle for PasswordInput Widget
* Asset bundle for the [[PasswordInput]] widget.
*
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @since 1.0
Expand Down
Loading

0 comments on commit 59910c8

Please sign in to comment.