- if self.get_config_value('enabled') is True:
- # and enable self
- self._enable(site)
-
- def _enable(self, site):
- root = site[FACILITY]['root']
- root.add_subtree(self.name, self.tree)
- self._debug('IdP Provider enabled: %s' % self.name)
- self.is_enabled = True
- self.on_enable()
-
- def enable(self, site):
- if self.is_enabled:
- return
-
- self._enable(site)
- self.set_config_value('enabled', True)
- self.save_plugin_config(FACILITY)
-
- def disable(self, site):
- if not self.is_enabled:
- return
-
- # remove self to the root
- root = site[FACILITY]['root']
- root.del_subtree(self.name)