Skip to content

Commit 8926349

Browse files
committed
Merge branch '14.next-cake5' into 15.next-cake5
2 parents b3b7b22 + dfb1b4c commit 8926349

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1618
-1011
lines changed

.semver

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
:major: 14
3-
:minor: 1
4-
:patch: 0
3+
:minor: 3
4+
:patch: 4
55
:special: ''

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@ Changelog
22
=========
33
Releases for CakePHP 5
44
-------------
5+
* 14.3.4
6+
* Replace usage of 'admin' by UsersTable::ROLE_ADMIN constant across the plugin.
7+
* Fix role in UsersAddSuperuserCommand to be 'admin' instead of 'superadmin'.
8+
* 14.3.3
9+
* Add compatibility with CakePHP 5.1
10+
* 14.3.2
11+
* Fix missing spanish translations
12+
* 14.3.1
13+
* Fix duplicated rule name in rules checker
14+
* 14.3.0
15+
* Update Translations.md by @MarwanSalim in #1089
16+
* Fix named parameter issue in _createSocialUser method for findExistingForSocialLogin #1091 by @robitmoh in #1092
17+
* Bug #1084 Fix issue with avatar images long URL by @flohdez in #1094
18+
* #1096: fixed findExistingForSocialLogin finder by @arusinowski in #1097
19+
* 14.2.1
20+
* Improve documentation about password meter.
21+
* Fix minor bugs
22+
* 14.2.0
23+
* Add password meter to display password quality
24+
* Add integration with google reCaptcha v3, keep default using v2
25+
* 14.1.1
26+
* Add config option to customize the user foreign key field in LockoutHandler
527
* 14.1
628
* New feature "Account lockout policy"
729
* 14.0

Docs/Documentation/Authentication.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Additionally, you can set number of attempts until lock, lockout time, time wind
141141
'failedPasswordAttemptsModel' => 'CakeDC/Users.FailedPasswordAttempts',
142142
'userLockoutField' => 'lockout_time',//Field in user entity used to lock the user.
143143
'usersModel' => 'Users',
144+
'userForeignKeyField' => 'user_id', //Field defined in the 'failed_password_attempts' table as foreignKey of the model Users.
144145
],
145146
```
146147

Docs/Documentation/Configuration.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ and add this to your config/users.php file:
5454
```php
5555
'Users.reCaptcha.key' => 'YOUR RECAPTCHA KEY',
5656
'Users.reCaptcha.secret' => 'YOUR RECAPTCHA SECRET',
57+
'Users.reCaptcha.version' => '2', //defaults to version 2 (backward compatibility) but you can use version 3 which is recommended
5758
'Users.reCaptcha.registration' => true, //enable on registration
5859
'Users.reCaptcha.login' => true, //enable on login
5960
```
@@ -64,6 +65,25 @@ Note you'll need to add google/recaptcha to your composer.json file.
6465
$ composer require google/recaptcha:@stable
6566
```
6667

68+
Configuration for Password Meter
69+
---------------------
70+
Password meter is enabled by default but you can disable it or change config options adding this to your config/users.php file:
71+
72+
```php
73+
'Users.passwordMeter.enabled' => true, //enable or disable password meter. Defaults to true
74+
'Users.passwordMeter.requiredScore' => 1, //int value from 1 to 4 (25%,50%,75%,100%). Defaults to 1
75+
'Users.passwordMeter.messagesList' => ['Empty password', 'Too simple', 'Simple', 'That\'s OK', 'Great password!'], //Messages for each password level (0%,25%,50%,75%,100%)
76+
'Users.passwordMeter.pswMinLength' => 8, //Password min length, defaults to 8. It won't affect users validation in backend
77+
'Users.passwordMeter.showMessage' => true, //shows password message
78+
```
79+
80+
Note the score is calculated based on the following rules:
81+
82+
* If you include a lower single character and an upper one ([a-zA-Z]) it increases the score by 1
83+
* If you include an special single character it increases the score by 1
84+
* If you include a digit it increases the score by 1
85+
* If you reaches the `pswMinLength` it increases the score by 1
86+
6787
Configuration options
6888
---------------------
6989

Docs/Documentation/Translations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ The Plugin is translated into several languages:
1616
* Czech (cs_CZ) by @Mapiiik
1717
* Dutch (nl_NL) by @StefanvanR
1818

19-
**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.
19+
**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.
2020

2121
Remember to clean the translations cache!

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ CakeDC Users Plugin
1010
Versions and branches
1111
---------------------
1212

13-
| CakePHP | CakeDC Users Plugin | Tag | Notes |
14-
|:--------------:|:----------------------------------------------------------:|:-----------------:| :---- |
15-
| ^5.0 | [14.1](https://github.com/cakedc/users/tree/14.next-cake5) | 14.next-cake5-dev | beta |
16-
| ^4.5 | [13.0](https://github.com/cakedc/users/tree/13.next-cake4) | 13.0.1 | stable |
17-
| ^5.0 | [12.0](https://github.com/cakedc/users/tree/12.next-cake5) | 12.0 | beta |
18-
| ^4.3 | [11.0](https://github.com/cakedc/users/tree/11.next-cake4) | 11.1.0 | stable |
19-
| ^4.0 | [9.0](https://github.com/cakedc/users/tree/9.next) | 9.0.5 | stable |
20-
| ^3.7 <4.0 | [8.5](https://github.com/cakedc/users/tree/8.next) | 8.5.1 | stable |
21-
| ^3.7 <4.0 | [develop](https://github.com/cakedc/users/tree/develop) | - | unstable |
22-
| 3.6 | [8.1](https://github.com/cakedc/users/tree/8.1.0) | 8.1.0 | stable |
23-
| 3.5 | [6.x](https://github.com/cakedc/users/tree/6.x) | 6.0.1 | stable |
24-
| 3.4 | [5.x](https://github.com/cakedc/users/tree/5.x) | 5.2.0 | stable |
25-
| >=3.2.9 <3.4.0 | [4.x](https://github.com/cakedc/users/tree/4.x) | 4.2.1 | stable |
26-
| ^2.10 | [2.x](https://github.com/cakedc/users/tree/2.x) | 2.2.0 |stable |
13+
| CakePHP | CakeDC Users Plugin | Tag | Notes |
14+
|:--------------:|:----------------------------------------------------------:|:------:|:---------|
15+
| ^5.0 | [14.3](https://github.com/cakedc/users/tree/14.next-cake5) | 14.3.2 | stable |
16+
| ^4.5 | [13.0](https://github.com/cakedc/users/tree/13.next-cake4) | 13.0.1 | stable |
17+
| ^5.0 | [12.0](https://github.com/cakedc/users/tree/12.next-cake5) | 12.0 | beta |
18+
| ^4.3 | [11.0](https://github.com/cakedc/users/tree/11.next-cake4) | 11.1.0 | stable |
19+
| ^4.0 | [9.0](https://github.com/cakedc/users/tree/9.next) | 9.0.5 | stable |
20+
| ^3.7 <4.0 | [8.5](https://github.com/cakedc/users/tree/8.next) | 8.5.1 | stable |
21+
| ^3.7 <4.0 | [develop](https://github.com/cakedc/users/tree/develop) | - | unstable |
22+
| 3.6 | [8.1](https://github.com/cakedc/users/tree/8.1.0) | 8.1.0 | stable |
23+
| 3.5 | [6.x](https://github.com/cakedc/users/tree/6.x) | 6.0.1 | stable |
24+
| 3.4 | [5.x](https://github.com/cakedc/users/tree/5.x) | 5.2.0 | stable |
25+
| >=3.2.9 <3.4.0 | [4.x](https://github.com/cakedc/users/tree/4.x) | 4.2.1 | stable |
26+
| ^2.10 | [2.x](https://github.com/cakedc/users/tree/2.x) | 2.2.0 | stable |
2727

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

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

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

config/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
];
3737
foreach ($oldConfigs as $configKey) {
3838
if (Configure::check($configKey)) {
39-
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));
39+
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));
4040
}
4141
}

config/permissions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
],
9595
//admin role allowed to all the things
9696
[
97-
'role' => 'admin',
97+
'role' => \CakeDC\Users\Model\Table\UsersTable::ROLE_ADMIN,
9898
'prefix' => '*',
9999
'extension' => '*',
100100
'plugin' => '*',

config/users.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,31 @@
7171
'key' => null,
7272
// reCaptcha secret
7373
'secret' => null,
74+
// reCaptcha version. keep 2 for backward compatibility
75+
'version' => 2,
7476
// use reCaptcha in registration
7577
'registration' => false,
7678
// use reCaptcha in login, valid values are false, true
7779
'login' => false,
7880
],
81+
'passwordMeter' => [
82+
//enable or disable password meter
83+
'enabled' => true,
84+
//int value from 1 to 4 (25%,50%,75%,100%). Defaults to 3
85+
'requiredScore' => 1,
86+
//Messages for each password level (0%,25%,50%,75%,100%)
87+
'messagesList' => [
88+
__d('cake_d_c/users', 'Empty password'),
89+
__d('cake_d_c/users', 'Too simple'),
90+
__d('cake_d_c/users','Simple'),
91+
__d('cake_d_c/users', 'That\'s OK'),
92+
__d('cake_d_c/users', 'Great password!')
93+
],
94+
//Password min length
95+
'pswMinLength' => 8,
96+
//shows message for password score
97+
'showMessage' => true,
98+
],
7999
'Tos' => [
80100
// determines if the user should include tos accepted
81101
'required' => true,

0 commit comments

Comments
 (0)