aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/user.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 3b92077..546f600 100644
--- a/models/user.go
+++ b/models/user.go
@@ -127,6 +127,13 @@ func (u *User) CheckPassword(password string) bool {
return err == nil
}
+func (u *User) Activate() {
+ u.IsDeleted = false
+ u.AccountDisabled = false
+ u.AccountBanned = false
+ u.EmailVerified = true
+}
+
func (u *User) IsActive() bool {
return !u.IsDeleted && !u.AccountDisabled && !u.AccountBanned
}