From 6099b0773c86b382d913782e388bd9a1e6271333 Mon Sep 17 00:00:00 2001 From: MKiselev Date: Tue, 8 Aug 2017 01:12:48 +0500 Subject: [PATCH 1/4] Issue #46 --- src/User/Migration/m000000_000001_create_user_table.php | 4 ++-- src/User/Migration/m000000_000002_create_profile_table.php | 4 ++-- .../Migration/m000000_000003_create_social_account_table.php | 4 ++-- src/User/Migration/m000000_000004_create_token_table.php | 4 ++-- src/User/Migration/m000000_000005_add_last_login_at.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/User/Migration/m000000_000001_create_user_table.php b/src/User/Migration/m000000_000001_create_user_table.php index 4c7432b..2f1b921 100644 --- a/src/User/Migration/m000000_000001_create_user_table.php +++ b/src/User/Migration/m000000_000001_create_user_table.php @@ -16,7 +16,7 @@ use yii\db\Migration; class m000000_000001_create_user_table extends Migration { - public function up() + public function safeUp() { $this->createTable( '{{%user}}', @@ -41,7 +41,7 @@ class m000000_000001_create_user_table extends Migration $this->createIndex('idx_user_email', '{{%user}}', 'email', true); } - public function down() + public function safeDown() { $this->dropTable('{{%user}}'); } diff --git a/src/User/Migration/m000000_000002_create_profile_table.php b/src/User/Migration/m000000_000002_create_profile_table.php index 3f20778..44f0490 100644 --- a/src/User/Migration/m000000_000002_create_profile_table.php +++ b/src/User/Migration/m000000_000002_create_profile_table.php @@ -16,7 +16,7 @@ use yii\db\Migration; class m000000_000002_create_profile_table extends Migration { - public function up() + public function safeUp() { $this->createTable( '{{%profile}}', @@ -39,7 +39,7 @@ class m000000_000002_create_profile_table extends Migration $this->addForeignKey('fk_profile_user', '{{%profile}}', 'user_id', '{{%user}}', 'id', 'CASCADE', $restrict); } - public function down() + public function safeDown() { $this->dropTable('{{%profile}}'); } diff --git a/src/User/Migration/m000000_000003_create_social_account_table.php b/src/User/Migration/m000000_000003_create_social_account_table.php index feb87fb..8561325 100644 --- a/src/User/Migration/m000000_000003_create_social_account_table.php +++ b/src/User/Migration/m000000_000003_create_social_account_table.php @@ -16,7 +16,7 @@ use yii\db\Migration; class m000000_000003_create_social_account_table extends Migration { - public function up() + public function safeUp() { $this->createTable( '{{%social_account}}', @@ -54,7 +54,7 @@ class m000000_000003_create_social_account_table extends Migration ); } - public function down() + public function safeDown() { $this->dropTable('{{%social_account}}'); } diff --git a/src/User/Migration/m000000_000004_create_token_table.php b/src/User/Migration/m000000_000004_create_token_table.php index 10aeb51..e28c7d5 100644 --- a/src/User/Migration/m000000_000004_create_token_table.php +++ b/src/User/Migration/m000000_000004_create_token_table.php @@ -16,7 +16,7 @@ use yii\db\Migration; class m000000_000004_create_token_table extends Migration { - public function up() + public function safeUp() { $this->createTable( '{{%token}}', @@ -36,7 +36,7 @@ class m000000_000004_create_token_table extends Migration $this->addForeignKey('fk_token_user', '{{%token}}', 'user_id', '{{%user}}', 'id', 'CASCADE', $restrict); } - public function down() + public function safeDown() { $this->dropTable('{{%token}}'); } diff --git a/src/User/Migration/m000000_000005_add_last_login_at.php b/src/User/Migration/m000000_000005_add_last_login_at.php index 68807ed..2a0c031 100644 --- a/src/User/Migration/m000000_000005_add_last_login_at.php +++ b/src/User/Migration/m000000_000005_add_last_login_at.php @@ -15,12 +15,12 @@ use yii\db\Migration; class m000000_000005_add_last_login_at extends Migration { - public function up() + public function safeUp() { $this->addColumn('{{%user}}', 'last_login_at', $this->integer()); } - public function down() + public function safeDown() { $this->dropColumn('{{%user}}', 'last_login_at'); } From 1a4bca305e3a09b1f82a405ee8dd067debfb8490 Mon Sep 17 00:00:00 2001 From: MKiselev Date: Wed, 9 Aug 2017 01:16:48 +0500 Subject: [PATCH 2/4] Add changelog lines --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63c7fe6..bea443b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # CHANGELOG ## 1.0.13 - Work in progress - +- Enh #46: Use safeUp()/safeDown() instead up()/down() in migrations (mkiselev) ## 1.0.12 - August 6, 2017 - Bug Fix: Modify ResetPasswordService to forcely update password_hash field (tonydspaniard) From e372fd2f47dcf07bc32f0de4d54ea047dde83c2c Mon Sep 17 00:00:00 2001 From: MKiselev Date: Wed, 9 Aug 2017 01:26:30 +0500 Subject: [PATCH 3/4] Typo fix in nickname --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bea443b..4900163 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # CHANGELOG ## 1.0.13 - Work in progress -- Enh #46: Use safeUp()/safeDown() instead up()/down() in migrations (mkiselev) +- Enh #46: Use safeUp()/safeDown() instead up()/down() in migrations (MKiselev) ## 1.0.12 - August 6, 2017 - Bug Fix: Modify ResetPasswordService to forcely update password_hash field (tonydspaniard) From f1ad7821023018ec792694cd286cc368fd8c073d Mon Sep 17 00:00:00 2001 From: MKiselev Date: Wed, 9 Aug 2017 01:53:05 +0500 Subject: [PATCH 4/4] Typo fix for #51 --- CHANGELOG.md | 1 + src/User/Service/SocialNetworkAuthenticateService.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63c7fe6..bd19007 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG ## 1.0.13 - Work in progress +- Fix #51: Typo fix rememberLoginLifeSpan to rememberLoginLifespan (MKiselev) ## 1.0.12 - August 6, 2017 diff --git a/src/User/Service/SocialNetworkAuthenticateService.php b/src/User/Service/SocialNetworkAuthenticateService.php index bbdcc02..9806276 100644 --- a/src/User/Service/SocialNetworkAuthenticateService.php +++ b/src/User/Service/SocialNetworkAuthenticateService.php @@ -74,7 +74,7 @@ class SocialNetworkAuthenticateService implements ServiceInterface Yii::$app->session->setFlash('danger', Yii::t('usuario', 'Your account has been blocked.')); $this->authAction->setSuccessUrl(Url::to(['/user/security/login'])); } else { - Yii::$app->user->login($account->user, $this->controller->module->rememberLoginLifeSpan); + Yii::$app->user->login($account->user, $this->controller->module->rememberLoginLifespan); $this->authAction->setSuccessUrl(Yii::$app->getUser()->getReturnUrl()); } } else {