Module: PrunePlugin
- Extended by:
- Plugin::Run
- Included in:
- AgendavPrune, DavicalPrune, DovecotPrune, RoundcubePrune
- Defined in:
- lib/prune/prune_plugin.rb
Overview
Plugins for pruning users. By “pruning,” we mean the removal of leftover non-PostfixAdmin users after the associated user has been removed from the Postfixadmin database.
Class Method Summary collapse
-
.dummy_runner ⇒ Class
The “dummy” runner class associated with pruning plugins.
-
.runner ⇒ Class
The runner class associated with pruning plugins.
Instance Method Summary collapse
-
#get_leftover_domains(db_domains) ⇒ Array<Domain>
Determine which domains are “left over” for this plugin.
-
#get_leftover_users(db_users) ⇒ Array<User>
Determine which users are “left over” for this plugin.
Methods included from Plugin::Run
dummy_runner, included, includers, run, runner
Class Method Details
.dummy_runner ⇒ Class
The “dummy” runner class associated with pruning plugins.
25 26 27 |
# File 'lib/prune/prune_plugin.rb', line 25 def self.dummy_runner return PruneDummyRunner end |
.runner ⇒ Class
The runner class associated with pruning plugins.
16 17 18 |
# File 'lib/prune/prune_plugin.rb', line 16 def self.runner() return PruneRunner end |
Instance Method Details
#get_leftover_domains(db_domains) ⇒ Array<Domain>
Determine which domains are “left over” for this plugin. A domain is considered “left over” if it has been removed from Postfixadmin but not some other plugin.
The leftovers are determined with respect to the list db_domains of domains that Postfixadmin knows about.
43 44 45 46 |
# File 'lib/prune/prune_plugin.rb', line 43 def get_leftover_domains(db_domains) # WARNING! Array difference doesn't work for some reason. return list_domains().select{ |d| !db_domains.include?(d) } end |
#get_leftover_users(db_users) ⇒ Array<User>
Determine which users are “left over” for this plugin. A user is considered “left over” if it has been removed from Postfixadmin but not some other plugin.
The leftovers are determined with respect to the list db_users of users that Postfixadmin knows about.
62 63 64 65 |
# File 'lib/prune/prune_plugin.rb', line 62 def get_leftover_users(db_users) # WARNING! Array difference doesn't work for some reason. return list_users().select{ |u| !db_users.include?(u) } end |