Skip to content

Commit 2def42e

Browse files
authored
Merge pull request #530 from CakeDC/develop
Upgrade to CakePHP 3.4
2 parents b0e2463 + 18f5fe8 commit 2def42e

File tree

164 files changed

+3058
-4030
lines changed

Some content is hidden

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

164 files changed

+3058
-4030
lines changed

Diff for: .semver

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
:major: 4
3-
:minor: 1
4-
:patch: 3
2+
:major: 5
3+
:minor: 0
4+
:patch: 0
55
:special: ''

Diff for: CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ Changelog
44
Releases for CakePHP 3
55
-------------
66

7+
* 5.0.0
8+
* Some Auth objects refactored into https://github.com/CakeDC/auth
9+
* Upgrade to CakePHP 3.4
10+
11+
* 4.2.1
12+
* Improvements in unit tests
13+
14+
* 4.2.0
15+
* New configuration param `Users.Registration.defaultRole` to set the default role on user registration or addUser Shell action
16+
717
* 4.1.3
818
* Configurable rememberMe checkbox status
919
* Update brazilian portuguese translations

Diff for: CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Contributing
22
============
33

4-
This repository follows the [CakeDC Plugin Standard](http://cakedc.com/plugin-standard). If you'd like to contribute new features, enhancements or bug fixes to the plugin, please read our [Contribution Guidelines](http://cakedc.com/contribution-guidelines) for detailed instructions.
4+
This repository follows the [CakeDC Plugin Standard](https://www.cakedc.com/plugin-standard). If you'd like to contribute new features, enhancements or bug fixes to the plugin, please read our [Contribution Guidelines](https://www.cakedc.com/contribution-guidelines) for detailed instructions.

Diff for: Docs/Documentation/ApiKeyAuthenticate.md

-37
This file was deleted.

Diff for: Docs/Documentation/Configuration.md

+26-21
Original file line numberDiff line numberDiff line change
@@ -69,40 +69,44 @@ NOTE: SOME keys were hidden in this doc page, please refer to `vendor/cakedc/use
6969

7070
```
7171
'Users' => [
72-
//Table used to manage users
72+
// Table used to manage users
7373
'table' => 'CakeDC/Users.Users',
74-
//configure Auth component
74+
// Controller used to manage users plugin features & actions
75+
'controller' => 'CakeDC/Users.Users',
76+
// configure Auth component
7577
'auth' => true,
7678
'Email' => [
77-
//determines if the user should include email
79+
// determines if the user should include email
7880
'required' => true,
79-
//determines if registration workflow includes email validation
81+
// determines if registration workflow includes email validation
8082
'validate' => true,
8183
],
8284
'Registration' => [
83-
//determines if the register is enabled
85+
// determines if the register is enabled
8486
'active' => true,
85-
//determines if the reCaptcha is enabled for registration
87+
// determines if the reCaptcha is enabled for registration
8688
'reCaptcha' => true,
8789
//ensure user is active (confirmed email) to reset his password
88-
'ensureActive' => false
90+
'ensureActive' => false,
91+
// default role name used in registration
92+
'defaultRole' => 'user',
8993
],
9094
'Tos' => [
91-
//determines if the user should include tos accepted
95+
// determines if the user should include tos accepted
9296
'required' => true,
9397
],
9498
'Social' => [
95-
//enable social login
99+
// enable social login
96100
'login' => false,
97101
],
98-
//Avatar placeholder
102+
// Avatar placeholder
99103
'Avatar' => ['placeholder' => 'CakeDC/Users.avatar_placeholder.png'],
100104
'RememberMe' => [
101-
//configure Remember Me component
105+
// configure Remember Me component
102106
'active' => true,
103107
],
104108
],
105-
//default configuration used to auto-load the Auth Component, override to change the way Auth works
109+
// default configuration used to auto-load the Auth Component, override to change the way Auth works
106110
'Auth' => [
107111
'authenticate' => [
108112
'all' => [
@@ -112,8 +116,8 @@ NOTE: SOME keys were hidden in this doc page, please refer to `vendor/cakedc/use
112116
'Form',
113117
],
114118
'authorize' => [
115-
'CakeDC/Users.Superuser',
116-
'CakeDC/Users.SimpleRbac',
119+
'CakeDC/Auth.Superuser',
120+
'CakeDC/Auth.SimpleRbac',
117121
],
118122
],
119123
];
@@ -126,11 +130,12 @@ Default Authenticate and Authorize Objects used
126130
Using the UsersAuthComponent default initialization, the component will load the following objects into AuthComponent:
127131
* Authenticate
128132
* 'Form'
129-
* 'Social' check [SocialAuthenticate](SocialAuthenticate.md) for configuration options
130-
* 'RememberMe' check [SocialAuthenticate](RememberMeAuthenticate.md) for configuration options
133+
* 'CakeDC/Users.Social' check [SocialAuthenticate](SocialAuthenticate.md) for configuration options
134+
* 'CakeDC/Auth.RememberMe' check [RememberMeAuthenticate](https://github.com/CakeDC/auth/blob/master/src/RememberMeAuthenticate.php) for configuration options
131135
* Authorize
132-
* 'Users.Superuser' check [SuperuserAuthorize](SuperuserAuthorize.md) for configuration options
133-
* 'Users.SimpleRbac' check [SimpleRbacAuthorize](SimpleRbacAuthorize.md) for configuration options
136+
* 'CakeDC/Auth.Superuser' check [SuperuserAuthorize](https://github.com/CakeDC/auth/blob/master/Docs/Documentation/SuperuserAuthorize.md) for configuration options
137+
* 'CakeDC/Auth.SimpleRbac' check [SimpleRbacAuthorize](https://github.com/CakeDC/auth/blob/master/Docs/Documentation/SimpleRbacAuthorize.md) for configuration options
138+
* 'CakeDC/Auth.ApiKey' check [ApiKeyAuthenticate](https://github.com/CakeDC/auth/blob/master/Docs/Documentation/ApiKeyAuthenticate.md) for configuration options
134139

135140
## Using the user's email to login
136141

@@ -141,12 +146,12 @@ You need to configure 2 things:
141146
Configure::write('Auth.authenticate.Form.fields.username', 'email');
142147
```
143148

144-
* Override the login.ctp template to change the Form->input to "email". Add (or copy from the https://github.com/CakeDC/users/blob/master/src/Template/Users/login.ctp) the file login.ctp to path /src/Template/Plugin/CakeDC/Users/Users/login.ctp and ensure it has the following content
149+
* Override the login.ctp template to change the Form->control to "email". Add (or copy from the https://github.com/CakeDC/users/blob/master/src/Template/Users/login.ctp) the file login.ctp to path /src/Template/Plugin/CakeDC/Users/Users/login.ctp and ensure it has the following content
145150

146151
```php
147152
// ... inside the Form
148-
<?= $this->Form->input('email', ['required' => true]) ?>
149-
<?= $this->Form->input('password', ['required' => true]) ?>
153+
<?= $this->Form->control('email', ['required' => true]) ?>
154+
<?= $this->Form->control('password', ['required' => true]) ?>
150155
// ... rest of your login.ctp code
151156
```
152157

Diff for: Docs/Documentation/Extending-the-Plugin.md

+12
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ Extending the Controller
8383
You want to use one of your controllers to handle all the users features in your app, and keep the
8484
login/register/etc actions from Users Plugin,
8585

86+
First create a new controller class:
87+
8688
```php
8789
<?php
8890
namespace App\Controller;
@@ -103,6 +105,16 @@ class MyUsersController extends AppController
103105
}
104106
```
105107

108+
Don't forget to update the `Users.controller` configuration in `users.php`
109+
110+
```php
111+
'Users' => [
112+
// ...
113+
// Controller used to manage users plugin features & actions
114+
'controller' => 'MyUsers',
115+
// ...
116+
```
117+
106118
Note you'll need to **copy the Plugin templates** you need into your project src/Template/MyUsers/[action].ctp
107119

108120
Extending the Features in your controller

Diff for: Docs/Documentation/Installation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ composer require league/oauth1-client:@stable
1919
```
2020

2121
NOTE: you'll need to enable social login in your bootstrap.php file if you want to use it, social
22-
login is disabled by default. Check the [Configuration](Configuration.md) page for more details.
22+
login is disabled by default. Check the [Configuration](Configuration.md#configuration-for-social-login) page for more details.
2323

2424
```
2525
Configure::write('Users.Social.login', true); //to enable social login

Diff for: Docs/Documentation/Migration/4.1.x-5.0.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Migration 4.1.x to 5.0
2+
======================
3+
4+
5.0 is compatible with CakePHP ^3.4 and refactored some Auth objects into a new plugin
5+
* Fix your Users configuration file for Auth object references
6+
7+
in `users.php`
8+
9+
```php
10+
$config = [
11+
// ...
12+
'Auth' => [
13+
// ...
14+
'authenticate' => [
15+
'all' => [
16+
'finder' => 'auth',
17+
],
18+
'CakeDC/Auth.ApiKey',
19+
'CakeDC/Auth.RememberMe',
20+
'Form',
21+
],
22+
'authorize' => [
23+
'CakeDC/Auth.Superuser',
24+
'CakeDC/Auth.SimpleRbac',
25+
],
26+
// ...
27+
```
28+
29+
* Add a new configuration key to specify the controller name you are using to handle auth in your project
30+
31+
in `users.php`
32+
33+
```php
34+
$config = [
35+
'Users' => [
36+
// ...
37+
// Controller used to manage users plugin features & actions
38+
'controller' => 'CakeDC/Users.Users',
39+
// ...
40+
```
41+

Diff for: Docs/Documentation/OwnerRule.md

-86
This file was deleted.

0 commit comments

Comments
 (0)