From f5a13b9ae7be01263e45c4690f0cc1b224f65256 Mon Sep 17 00:00:00 2001 From: tonydspaniard Date: Mon, 17 Jun 2019 17:30:03 +0200 Subject: [PATCH] re #309 update docs --- docs/contributing/clean-code.md | 2 +- docs/contributing/how-to.md | 2 +- .../how-to-enhance-a-user-model.md | 2 +- .../overriding-classes.md | 2 +- .../overriding-controllers.md | 2 +- .../overriding-views.md | 2 +- docs/events/form-events.md | 2 +- docs/events/mail-events.md | 2 +- docs/events/reset-password-events.md | 2 +- docs/events/social-network-auth-events.md | 2 +- docs/events/social-network-connect-events.md | 22 +++++++++++++++++-- docs/events/user-events.md | 2 +- .../how-to-add-captcha-widget.md | 2 +- .../how-to-implement-two-factor-auth.md | 2 +- .../helpful-guides/how-to-swith-identities.md | 2 +- .../how-to-use-recaptcha-widget.md | 2 +- .../separate-frontend-and-backend-sessions.md | 2 +- .../social-network-authentication.md | 2 +- .../advanced-application-template.md | 2 +- docs/installation/available-actions.md | 2 +- docs/installation/configuration-options.md | 2 +- docs/installation/console-commands.md | 2 +- docs/installation/mailer.md | 2 +- docs/installation/rbac.md | 2 +- .../installation/yii2-application-template.md | 2 +- 25 files changed, 44 insertions(+), 26 deletions(-) diff --git a/docs/contributing/clean-code.md b/docs/contributing/clean-code.md index d052104..c05a6d2 100644 --- a/docs/contributing/clean-code.md +++ b/docs/contributing/clean-code.md @@ -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 `Codeception`. -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/contributing/how-to.md b/docs/contributing/how-to.md index 4205156..2538e14 100644 --- a/docs/contributing/how-to.md +++ b/docs/contributing/how-to.md @@ -29,4 +29,4 @@ All contributions should follow our [templates guidelines](https://github.com/2a - Follow the guidelines at [Clean Code](clean-code.md) -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/enhancing-and-overriding/how-to-enhance-a-user-model.md b/docs/enhancing-and-overriding/how-to-enhance-a-user-model.md index f316a3e..bf7cc78 100644 --- a/docs/enhancing-and-overriding/how-to-enhance-a-user-model.md +++ b/docs/enhancing-and-overriding/how-to-enhance-a-user-model.md @@ -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 > 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 diff --git a/docs/enhancing-and-overriding/overriding-classes.md b/docs/enhancing-and-overriding/overriding-classes.md index 118635f..1a1d307 100644 --- a/docs/enhancing-and-overriding/overriding-classes.md +++ b/docs/enhancing-and-overriding/overriding-classes.md @@ -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. -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/enhancing-and-overriding/overriding-controllers.md b/docs/enhancing-and-overriding/overriding-controllers.md index 7dfc8f6..9f34ca9 100644 --- a/docs/enhancing-and-overriding/overriding-controllers.md +++ b/docs/enhancing-and-overriding/overriding-controllers.md @@ -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 diff --git a/docs/enhancing-and-overriding/overriding-views.md b/docs/enhancing-and-overriding/overriding-views.md index fb9c216..0ee1291 100644 --- a/docs/enhancing-and-overriding/overriding-views.md +++ b/docs/enhancing-and-overriding/overriding-views.md @@ -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 of `view` component as previously mentioned. -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/events/form-events.md b/docs/events/form-events.md index b244381..5de7b94 100644 --- a/docs/events/form-events.md +++ b/docs/events/form-events.md @@ -83,5 +83,5 @@ $application->run(); ``` -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/events/mail-events.md b/docs/events/mail-events.md index b6efa03..d203e29 100644 --- a/docs/events/mail-events.md +++ b/docs/events/mail-events.md @@ -98,4 +98,4 @@ $application->run(); ``` -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/events/reset-password-events.md b/docs/events/reset-password-events.md index 0d9fdb6..c2c2cac 100644 --- a/docs/events/reset-password-events.md +++ b/docs/events/reset-password-events.md @@ -53,4 +53,4 @@ Event::on( ``` -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/events/social-network-auth-events.md b/docs/events/social-network-auth-events.md index b02a175..e7ec97a 100644 --- a/docs/events/social-network-auth-events.md +++ b/docs/events/social-network-auth-events.md @@ -45,4 +45,4 @@ Event::on( > [guide](../helpful-guides/social-network-authentication.md) -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/events/social-network-connect-events.md b/docs/events/social-network-connect-events.md index 3b4d63c..a418975 100644 --- a/docs/events/social-network-connect-events.md +++ b/docs/events/social-network-connect-events.md @@ -28,9 +28,13 @@ This event when triggered will contain a `Da\User\Model\User` model instance and // events.php file use Da\User\Controller\RegistrationController; +use Da\User\Controller\SecurityController; use Da\User\Event\SocialNetworkConnectEvent; +use Da\User\Event\SocialNetworkAuthEvent; use yii\base\Event; +// on RegistrationController + Event::on( RegistrationController::class, SocialNetworkConnectEvent::EVENT_BEFORE_CONNECT, @@ -42,6 +46,20 @@ Event::on( // ... 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 diff --git a/docs/events/user-events.md b/docs/events/user-events.md index 0ceaf56..d6c104f 100644 --- a/docs/events/user-events.md +++ b/docs/events/user-events.md @@ -117,4 +117,4 @@ $application->run(); ``` -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/helpful-guides/how-to-add-captcha-widget.md b/docs/helpful-guides/how-to-add-captcha-widget.md index 3bbefbc..a43c094 100644 --- a/docs/helpful-guides/how-to-add-captcha-widget.md +++ b/docs/helpful-guides/how-to-add-captcha-widget.md @@ -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 diff --git a/docs/helpful-guides/how-to-implement-two-factor-auth.md b/docs/helpful-guides/how-to-implement-two-factor-auth.md index ac508f3..e59a25c 100644 --- a/docs/helpful-guides/how-to-implement-two-factor-auth.md +++ b/docs/helpful-guides/how-to-implement-two-factor-auth.md @@ -51,4 +51,4 @@ process. - [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 diff --git a/docs/helpful-guides/how-to-swith-identities.md b/docs/helpful-guides/how-to-swith-identities.md index 378c0c5..7431917 100644 --- a/docs/helpful-guides/how-to-swith-identities.md +++ b/docs/helpful-guides/how-to-swith-identities.md @@ -58,4 +58,4 @@ if(Yii::$app->session->has($module->switchIdentitySessionKey)) { Check the [switchIdentitySessionKey](../installation/configuration-options.md#switchidentitysessionkey) documentation for further information regarding this configuration option. -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/helpful-guides/how-to-use-recaptcha-widget.md b/docs/helpful-guides/how-to-use-recaptcha-widget.md index 2bb9dd3..4003d45 100644 --- a/docs/helpful-guides/how-to-use-recaptcha-widget.md +++ b/docs/helpful-guides/how-to-use-recaptcha-widget.md @@ -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 diff --git a/docs/helpful-guides/separate-frontend-and-backend-sessions.md b/docs/helpful-guides/separate-frontend-and-backend-sessions.md index e6d246d..e89131b 100644 --- a/docs/helpful-guides/separate-frontend-and-backend-sessions.md +++ b/docs/helpful-guides/separate-frontend-and-backend-sessions.md @@ -4,4 +4,4 @@ Separate Frontend and Backend Sessions - TODO -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/helpful-guides/social-network-authentication.md b/docs/helpful-guides/social-network-authentication.md index 8a9552a..b8d927a 100644 --- a/docs/helpful-guides/social-network-authentication.md +++ b/docs/helpful-guides/social-network-authentication.md @@ -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). -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/installation/advanced-application-template.md b/docs/installation/advanced-application-template.md index 68c44e5..0abc838 100644 --- a/docs/installation/advanced-application-template.md +++ b/docs/installation/advanced-application-template.md @@ -96,4 +96,4 @@ is very convenient way to track new migration classes coming from this and possi > installation version. -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/installation/available-actions.md b/docs/installation/available-actions.md index 8fe7408..dfad23f 100644 --- a/docs/installation/available-actions.md +++ b/docs/installation/available-actions.md @@ -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. -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/installation/configuration-options.md b/docs/installation/configuration-options.md index 1ff98c7..1f5148c 100644 --- a/docs/installation/configuration-options.md +++ b/docs/installation/configuration-options.md @@ -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 diff --git a/docs/installation/console-commands.md b/docs/installation/console-commands.md index 5eac170..952f302 100644 --- a/docs/installation/console-commands.md +++ b/docs/installation/console-commands.md @@ -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 diff --git a/docs/installation/mailer.md b/docs/installation/mailer.md index dd91bb3..9a4a73d 100644 --- a/docs/installation/mailer.md +++ b/docs/installation/mailer.md @@ -102,4 +102,4 @@ public function run() ``` -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/installation/rbac.md b/docs/installation/rbac.md index 6a29b3c..c0b76c4 100644 --- a/docs/installation/rbac.md +++ b/docs/installation/rbac.md @@ -67,4 +67,4 @@ class AdminController extends Controller ``` -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019 diff --git a/docs/installation/yii2-application-template.md b/docs/installation/yii2-application-template.md index 1b9a581..9f0dc3c 100644 --- a/docs/installation/yii2-application-template.md +++ b/docs/installation/yii2-application-template.md @@ -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 > installation version. -© [2amigos](http://www.2amigos.us/) 2013-2017 +© [2amigos](http://www.2amigos.us/) 2013-2019