MCPcopy
hub / github.com/gotify/server / RemoveUser

Method RemoveUser

plugin/manager.go:184–208  ·  view source on GitHub ↗

RemoveUser disabled all plugins of a user when the user is disabled.

(userID uint)

Source from the content-addressed store, hash-verified

182
183// RemoveUser disabled all plugins of a user when the user is disabled.
184func (m *Manager) RemoveUser(userID uint) error {
185 for _, p := range m.plugins {
186 pluginConf, err := m.db.GetPluginConfByUserAndPath(userID, p.PluginInfo().ModulePath)
187 if err != nil {
188 return err
189 }
190 if pluginConf == nil {
191 continue
192 }
193 if pluginConf.Enabled {
194 inst, err := m.Instance(pluginConf.ID)
195 if err != nil {
196 continue
197 }
198 m.mutex.Lock()
199 err = inst.Disable()
200 m.mutex.Unlock()
201 if err != nil {
202 return err
203 }
204 }
205 delete(m.instances, pluginConf.ID)
206 }
207 return nil
208}
209
210type pluginFileLoadError struct {
211 Filename string

Calls 4

InstanceMethod · 0.95
PluginInfoMethod · 0.65
DisableMethod · 0.65