Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix conflicts and merge latest improvements from 14 #1105

Open
wants to merge 1 commit into
base: 15.next-cake5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .semver
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
:major: 14
:minor: 1
:patch: 0
:minor: 3
:patch: 1
:special: ''
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ Changelog
=========
Releases for CakePHP 5
-------------
* 14.3.1
* Fix duplicated rule name in rules checker
* 14.3.0
* Update Translations.md by @MarwanSalim in #1089
* Fix named parameter issue in _createSocialUser method for findExistingForSocialLogin #1091 by @robitmoh in #1092
* Bug #1084 Fix issue with avatar images long URL by @flohdez in #1094
* #1096: fixed findExistingForSocialLogin finder by @arusinowski in #1097
* 14.2.1
* Improve documentation about password meter.
* Fix minor bugs
* 14.2.0
* Add password meter to display password quality
* Add integration with google reCaptcha v3, keep default using v2
* 14.1.1
* Add config option to customize the user foreign key field in LockoutHandler
* 14.1
* New feature "Account lockout policy"
* 14.0
Expand Down
1 change: 1 addition & 0 deletions Docs/Documentation/Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ Additionally, you can set number of attempts until lock, lockout time, time wind
'failedPasswordAttemptsModel' => 'CakeDC/Users.FailedPasswordAttempts',
'userLockoutField' => 'lockout_time',//Field in user entity used to lock the user.
'usersModel' => 'Users',
'userForeignKeyField' => 'user_id', //Field defined in the 'failed_password_attempts' table as foreignKey of the model Users.
],
```

Expand Down
20 changes: 20 additions & 0 deletions Docs/Documentation/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ and add this to your config/users.php file:
```php
'Users.reCaptcha.key' => 'YOUR RECAPTCHA KEY',
'Users.reCaptcha.secret' => 'YOUR RECAPTCHA SECRET',
'Users.reCaptcha.version' => '2', //defaults to version 2 (backward compatibility) but you can use version 3 which is recommended
'Users.reCaptcha.registration' => true, //enable on registration
'Users.reCaptcha.login' => true, //enable on login
```
Expand All @@ -64,6 +65,25 @@ Note you'll need to add google/recaptcha to your composer.json file.
$ composer require google/recaptcha:@stable
```

Configuration for Password Meter
---------------------
Password meter is enabled by default but you can disable it or change config options adding this to your config/users.php file:

```php
'Users.passwordMeter.enabled' => true, //enable or disable password meter. Defaults to true
'Users.passwordMeter.requiredScore' => 1, //int value from 1 to 4 (25%,50%,75%,100%). Defaults to 1
'Users.passwordMeter.messagesList' => ['Empty password', 'Too simple', 'Simple', 'That\'s OK', 'Great password!'], //Messages for each password level (0%,25%,50%,75%,100%)
'Users.passwordMeter.pswMinLength' => 8, //Password min length, defaults to 8. It won't affect users validation in backend
'Users.passwordMeter.showMessage' => true, //shows password message
```

Note the score is calculated based on the following rules:

* If you include a lower single character and an upper one ([a-zA-Z]) it increases the score by 1
* If you include an special single character it increases the score by 1
* If you include a digit it increases the score by 1
* If you reaches the `pswMinLength` it increases the score by 1

Configuration options
---------------------

Expand Down
2 changes: 1 addition & 1 deletion Docs/Documentation/Translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ The Plugin is translated into several languages:
* Czech (cs_CZ) by @Mapiiik
* Dutch (nl_NL) by @StefanvanR

**Note:** To overwrite the plugin translations, create a file inside your project 'resources/locales//{$lang}/' folder, with the name 'Users.po' and add the strings with the new translations.
**Note:** To overwrite the plugin translations, create a file inside your project 'resources/locales//{$lang}/' folder, with the name 'cake_d_c_users.po' and add the strings with the new translations.

Remember to clean the translations cache!
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ CakeDC Users Plugin
Versions and branches
---------------------

| CakePHP | CakeDC Users Plugin | Tag | Notes |
|:--------------:|:----------------------------------------------------------:|:-----------------:| :---- |
| ^5.0 | [14.1](https://github.com/cakedc/users/tree/14.next-cake5) | 14.next-cake5-dev | beta |
| ^4.5 | [13.0](https://github.com/cakedc/users/tree/13.next-cake4) | 13.0.1 | stable |
| ^5.0 | [12.0](https://github.com/cakedc/users/tree/12.next-cake5) | 12.0 | beta |
| ^4.3 | [11.0](https://github.com/cakedc/users/tree/11.next-cake4) | 11.1.0 | stable |
| ^4.0 | [9.0](https://github.com/cakedc/users/tree/9.next) | 9.0.5 | stable |
| ^3.7 <4.0 | [8.5](https://github.com/cakedc/users/tree/8.next) | 8.5.1 | stable |
| ^3.7 <4.0 | [develop](https://github.com/cakedc/users/tree/develop) | - | unstable |
| 3.6 | [8.1](https://github.com/cakedc/users/tree/8.1.0) | 8.1.0 | stable |
| 3.5 | [6.x](https://github.com/cakedc/users/tree/6.x) | 6.0.1 | stable |
| 3.4 | [5.x](https://github.com/cakedc/users/tree/5.x) | 5.2.0 | stable |
| >=3.2.9 <3.4.0 | [4.x](https://github.com/cakedc/users/tree/4.x) | 4.2.1 | stable |
| ^2.10 | [2.x](https://github.com/cakedc/users/tree/2.x) | 2.2.0 |stable |
| CakePHP | CakeDC Users Plugin | Tag | Notes |
|:--------------:|:----------------------------------------------------------:|:------:|:---------|
| ^5.0 | [14.2](https://github.com/cakedc/users/tree/14.next-cake5) | 14.3.1 | stable |
| ^4.5 | [13.0](https://github.com/cakedc/users/tree/13.next-cake4) | 13.0.1 | stable |
| ^5.0 | [12.0](https://github.com/cakedc/users/tree/12.next-cake5) | 12.0 | beta |
| ^4.3 | [11.0](https://github.com/cakedc/users/tree/11.next-cake4) | 11.1.0 | stable |
| ^4.0 | [9.0](https://github.com/cakedc/users/tree/9.next) | 9.0.5 | stable |
| ^3.7 <4.0 | [8.5](https://github.com/cakedc/users/tree/8.next) | 8.5.1 | stable |
| ^3.7 <4.0 | [develop](https://github.com/cakedc/users/tree/develop) | - | unstable |
| 3.6 | [8.1](https://github.com/cakedc/users/tree/8.1.0) | 8.1.0 | stable |
| 3.5 | [6.x](https://github.com/cakedc/users/tree/6.x) | 6.0.1 | stable |
| 3.4 | [5.x](https://github.com/cakedc/users/tree/5.x) | 5.2.0 | stable |
| >=3.2.9 <3.4.0 | [4.x](https://github.com/cakedc/users/tree/4.x) | 4.2.1 | stable |
| ^2.10 | [2.x](https://github.com/cakedc/users/tree/2.x) | 2.2.0 | stable |

The **Users** plugin covers the following features:

Expand All @@ -36,6 +36,8 @@ The **Users** plugin covers the following features:
* Admin management
* One-Time Password for Two-Factor Authentication
* Webauthn for Two-Factor Authentication (Yubico Key compatible)
* reCaptcha v3 (14.2 only) and v2 supported in all versions
* Password Meter

The plugin is here to provide users related features following 2 approaches:

Expand Down
2 changes: 1 addition & 1 deletion config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
];
foreach ($oldConfigs as $configKey) {
if (Configure::check($configKey)) {
trigger_error(__("Users plugin configuration key \"{0}\" was removed, please check migration guide https://github.com/CakeDC/users/blob/master/Docs/Documentation/Migration/8.x-9.0.md", $configKey));
trigger_error(__d('cake_d_c/users', "Users plugin configuration key \"{0}\" was removed, please check migration guide https://github.com/CakeDC/users/blob/master/Docs/Documentation/Migration/8.x-9.0.md", $configKey));
}
}
20 changes: 20 additions & 0 deletions config/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,31 @@
'key' => null,
// reCaptcha secret
'secret' => null,
// reCaptcha version. keep 2 for backward compatibility
'version' => 2,
// use reCaptcha in registration
'registration' => false,
// use reCaptcha in login, valid values are false, true
'login' => false,
],
'passwordMeter' => [
//enable or disable password meter
'enabled' => true,
//int value from 1 to 4 (25%,50%,75%,100%). Defaults to 3
'requiredScore' => 1,
//Messages for each password level (0%,25%,50%,75%,100%)
'messagesList' => [
__d('cake_d_c/users', 'Empty password'),
__d('cake_d_c/users', 'Too simple'),
__d('cake_d_c/users','Simple'),
__d('cake_d_c/users', 'That\'s OK'),
__d('cake_d_c/users', 'Great password!')
],
//Password min length
'pswMinLength' => 8,
//shows message for password score
'showMessage' => true,
],
'Tos' => [
// determines if the user should include tos accepted
'required' => true,
Expand Down
Loading
Loading