re #309 update docs
This commit is contained in:
@ -57,4 +57,4 @@ We are using `Codeception` for testing the module. To run tests do the following
|
|||||||
We still need to add `unit` tests to the module. Feel free to add your tests to it as long as it makes use of
|
We still need to add `unit` tests to the module. Feel free to add your tests to it as long as it makes use of
|
||||||
`Codeception`.
|
`Codeception`.
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -29,4 +29,4 @@ All contributions should follow our [templates guidelines](https://github.com/2a
|
|||||||
- Follow the guidelines at [Clean Code](clean-code.md)
|
- Follow the guidelines at [Clean Code](clean-code.md)
|
||||||
|
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -74,4 +74,4 @@ class ProfileController extends Controller
|
|||||||
> This is absolutely good way to extend almost any class of the extension. For more information you could
|
> This is absolutely good way to extend almost any class of the extension. For more information you could
|
||||||
> check `Da\User\Bootstrap` class file to see what you have in your control.
|
> check `Da\User\Bootstrap` class file to see what you have in your control.
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -106,4 +106,4 @@ The definition can be any of the following (from Yii2's DI container):
|
|||||||
|
|
||||||
> See [how to enhance a User model](how-to-enhance-a-user-model.md) guide to see a practical example.
|
> See [how to enhance a User model](how-to-enhance-a-user-model.md) guide to see a practical example.
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -77,6 +77,6 @@ Now, the only thing that is missing is to add your brand new controller to the m
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -54,4 +54,4 @@ There is another way, and is by setting the `viewPath` attribute of the module:
|
|||||||
But it will force you to override **ALL** views from the module. The recommended way is throughout the `theme` property
|
But it will force you to override **ALL** views from the module. The recommended way is throughout the `theme` property
|
||||||
of `view` component as previously mentioned.
|
of `view` component as previously mentioned.
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -83,5 +83,5 @@ $application->run();
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|
||||||
|
|||||||
@ -98,4 +98,4 @@ $application->run();
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -53,4 +53,4 @@ Event::on(
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -45,4 +45,4 @@ Event::on(
|
|||||||
> [guide](../helpful-guides/social-network-authentication.md)
|
> [guide](../helpful-guides/social-network-authentication.md)
|
||||||
|
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -28,9 +28,13 @@ This event when triggered will contain a `Da\User\Model\User` model instance and
|
|||||||
// events.php file
|
// events.php file
|
||||||
|
|
||||||
use Da\User\Controller\RegistrationController;
|
use Da\User\Controller\RegistrationController;
|
||||||
|
use Da\User\Controller\SecurityController;
|
||||||
use Da\User\Event\SocialNetworkConnectEvent;
|
use Da\User\Event\SocialNetworkConnectEvent;
|
||||||
|
use Da\User\Event\SocialNetworkAuthEvent;
|
||||||
use yii\base\Event;
|
use yii\base\Event;
|
||||||
|
|
||||||
|
// on RegistrationController
|
||||||
|
|
||||||
Event::on(
|
Event::on(
|
||||||
RegistrationController::class,
|
RegistrationController::class,
|
||||||
SocialNetworkConnectEvent::EVENT_BEFORE_CONNECT,
|
SocialNetworkConnectEvent::EVENT_BEFORE_CONNECT,
|
||||||
@ -42,6 +46,20 @@ Event::on(
|
|||||||
// ... your logic here
|
// ... your logic here
|
||||||
});
|
});
|
||||||
|
|
||||||
```
|
// on SecurityController
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
Event::on(
|
||||||
|
SecurityController::class,
|
||||||
|
SocialNetworkAuthEvent::EVENT_BEFORE_AUTHENTICATE,
|
||||||
|
function (SocialNetworkAuthEvent $event) {
|
||||||
|
|
||||||
|
$client = $event->getClient();
|
||||||
|
$account = $event->getAccount(); // $account is a Da\User\Model\SocialNetworkAccount
|
||||||
|
|
||||||
|
// ... your logic here
|
||||||
|
});
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -117,4 +117,4 @@ $application->run();
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -147,4 +147,4 @@ Finally, we have to configure the module and the application to ensure is using
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -51,4 +51,4 @@ process.
|
|||||||
|
|
||||||
- [2amigos Two Factor Library Docs]()http://2fa-library.readthedocs.io/en/latest/)
|
- [2amigos Two Factor Library Docs]()http://2fa-library.readthedocs.io/en/latest/)
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -58,4 +58,4 @@ if(Yii::$app->session->has($module->switchIdentitySessionKey)) {
|
|||||||
Check the [switchIdentitySessionKey](../installation/configuration-options.md#switchidentitysessionkey) documentation
|
Check the [switchIdentitySessionKey](../installation/configuration-options.md#switchidentitysessionkey) documentation
|
||||||
for further information regarding this configuration option.
|
for further information regarding this configuration option.
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -139,4 +139,4 @@ Finally, we have to configure the module and the application to ensure is using
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -4,4 +4,4 @@ Separate Frontend and Backend Sessions
|
|||||||
- TODO
|
- TODO
|
||||||
|
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -55,4 +55,4 @@ For further information about how to configure the clients, please visit the
|
|||||||
[Official Yii Auth Client Extension documentation](https://github.com/yiisoft/yii2-authclient/blob/master/docs/guide/installation.md).
|
[Official Yii Auth Client Extension documentation](https://github.com/yiisoft/yii2-authclient/blob/master/docs/guide/installation.md).
|
||||||
|
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -96,4 +96,4 @@ is very convenient way to track new migration classes coming from this and possi
|
|||||||
> installation version.
|
> installation version.
|
||||||
|
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -79,4 +79,4 @@ So they become:
|
|||||||
You can override them by setting the module's routes to an empty array. Then, configure the routes as you please.
|
You can override them by setting the module's routes to an empty array. Then, configure the routes as you please.
|
||||||
|
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -201,4 +201,4 @@ Configures the name of the session key that will be used to hold the original ad
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -60,4 +60,4 @@ You can update a user's password whether by using its email or username.
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -102,4 +102,4 @@ public function run()
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -67,4 +67,4 @@ class AdminController extends Controller
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|||||||
@ -85,6 +85,6 @@ is very convenient way to track new migration classes coming from this and possi
|
|||||||
> Namespaced migrations were introduced in Yii 2.0.10, so before using them consider updating your framework
|
> Namespaced migrations were introduced in Yii 2.0.10, so before using them consider updating your framework
|
||||||
> installation version.
|
> installation version.
|
||||||
|
|
||||||
© [2amigos](http://www.2amigos.us/) 2013-2017
|
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user