Add disableIpLogging option. (#379)

This commit is contained in:
jkmssoft
2020-04-17 18:10:54 +02:00
committed by GitHub
parent e2b041a32a
commit 369c59bbb1
6 changed files with 12 additions and 2 deletions

View File

@ -125,7 +125,7 @@ class User extends ActiveRecord implements IdentityInterface
if ($insert) {
$this->setAttribute('auth_key', $security->generateRandomString());
if (Yii::$app instanceof Application) {
$this->setAttribute('registration_ip', Yii::$app->request->getUserIP());
$this->setAttribute('registration_ip', $this->module->disableIpLogging ? '127.0.0.1' : Yii::$app->request->getUserIP());
}
}