mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-11-17 01:44:23 +08:00
fix(user): revoke tunnel access when disabling accounts
Pause every reachable entry without self-healing missing services, aggregate unconfirmed nodes for retry, and show persistent partial-disable feedback. Refs #562.
This commit is contained in:
@@ -151,6 +151,13 @@ func (r *Repository) PropagateUserFlowToTunnels(userID int64, flow int64, num in
|
||||
}).Error
|
||||
}
|
||||
|
||||
func (r *Repository) DisableUserTunnels(userID int64) error {
|
||||
if r == nil || r.db == nil {
|
||||
return errors.New("repository not initialized")
|
||||
}
|
||||
return r.db.Model(&model.UserTunnel{}).Where("user_id = ?", userID).Update("status", 0).Error
|
||||
}
|
||||
|
||||
func (r *Repository) DeleteUserCascade(userID int64) error {
|
||||
if r == nil || r.db == nil {
|
||||
return errors.New("repository not initialized")
|
||||
|
||||
Reference in New Issue
Block a user