Fixes #4131: Security adjustments

This commit is contained in:
tom--
2014-07-26 03:29:30 +04:00
committed by Alexander Makarov
parent 8f81e231da
commit 2c5c2c101b
9 changed files with 547 additions and 262 deletions

View File

@ -159,7 +159,7 @@ class User extends ActiveRecord implements IdentityInterface
*/
public function generateAuthKey()
{
$this->auth_key = Yii::$app->security->generateRandomKey();
$this->auth_key = Yii::$app->security->generateRandomString();
}
/**
@ -167,7 +167,7 @@ class User extends ActiveRecord implements IdentityInterface
*/
public function generatePasswordResetToken()
{
$this->password_reset_token = Yii::$app->security->generateRandomKey() . '_' . time();
$this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();
}
/**

View File

@ -3,7 +3,7 @@
return [
'username' => 'userName',
'auth_key' => function ($fixture, $faker, $index) {
$fixture['auth_key'] = Yii::$app->getSecurity()->generateRandomKey();
$fixture['auth_key'] = Yii::$app->getSecurity()->generateRandomString();
return $fixture;
},
@ -13,7 +13,7 @@ return [
return $fixture;
},
'password_reset_token' => function ($fixture, $faker, $index) {
$fixture['password_reset_token'] = Yii::$app->getSecurity()->generateRandomKey() . '_' . time();
$fixture['password_reset_token'] = Yii::$app->getSecurity()->generateRandomString() . '_' . time();
return $fixture;
},