docs/guide-ja/security reviewed [ci skip]

This commit is contained in:
Nobuo Kihara
2015-02-21 17:28:47 +09:00
parent 9f6cb3cfe4
commit 92cbb083d2
5 changed files with 21 additions and 21 deletions

View File

@ -20,10 +20,10 @@ class User extends ActiveRecord implements IdentityInterface
// ...
/**
* 与えられた ID によって識別子を探す
* 与えられた ID によってユーザ識別情報を探す
*
* @param string|integer $id 探すための ID
* @return IdentityInterface|null 与えられた ID に合致する識別子オブジェクト
* @return IdentityInterface|null 与えられた ID に合致する Identity オブジェクト
*/
public static function findIdentity($id)
{
@ -31,10 +31,10 @@ class User extends ActiveRecord implements IdentityInterface
}
/**
* 与えられたトークンによって識別子を探す
* 与えられたトークンによってユーザ識別情報を探す
*
* @param string $token 探すためのトークン
* @return IdentityInterface|null 与えられたトークンに合致する識別子オブジェクト
* @return IdentityInterface|null 与えられたトークンに合致する Identity オブジェクト
*/
public static function findIdentityByAccessToken($token, $type = null)
{
@ -74,7 +74,7 @@ class User extends ActiveRecord implements IdentityInterface
その他のメソッドのうち、二つのもの - `getAuthKey``validateAuthKey` - は、「次回から自動ログイン ("remember me")」のクッキーに対して追加のセキュリティを提供するために使われます。
`getAuthKey` メソッドは全てのユーザに対してユニークな文字列を返さなければなりません。
`Yii::$app->getSecurity()->generateRandomString()` を使うと、信頼性の高い方法でユニークな文字列を生成することが出来ます。
これをユーザのレコードの一部として保存しておくの良いアイデアです。
これをユーザのレコードの一部として保存しておくの良いアイデアです。
```php
public function beforeSave($insert)