Add gdpr, session history, captcha

This commit is contained in:
2026-01-28 20:40:38 +01:00
parent 4389470233
commit 98a0e33939
28 changed files with 1994 additions and 4 deletions

View File

@@ -33,6 +33,8 @@ use yii\web\IdentityInterface;
* @property string $created_at
* @property string $updated_at
* @property string|null $gdpr_consent_at
* @property string|null $gdpr_consent_version
* @property string|null $gdpr_marketing_consent_at
* @property string|null $gdpr_deleted_at
*
* @property-read bool $isAdmin
@@ -40,6 +42,7 @@ use yii\web\IdentityInterface;
* @property-read bool $isConfirmed
* @property-read Profile $profile
* @property-read Token[] $tokens
* @property-read Session[] $sessions
*/
class User extends ActiveRecord implements IdentityInterface, UserInterface
{
@@ -262,6 +265,14 @@ class User extends ActiveRecord implements IdentityInterface, UserInterface
return $this->hasMany(Token::class, ['user_id' => 'id']);
}
/**
* Get user sessions relation.
*/
public function getSessions(): ActiveQuery
{
return $this->hasMany(Session::class, ['user_id' => 'id']);
}
// Helper methods
/**