+ # Remove the *target* domain or user. This is a generic version of
+ # the {#remove_user} and {#remove_domain} operations that will
+ # dispatch based on the type of *target*.
+ #
+ # @param target [User,Domain] the user or domain to remove.
+ #
+ def remove(target)
+ # A generic version of remove_user/remove_domain that
+ # dispatches base on the class of the target.
+ if target.is_a?(User)
+ return remove_user(target)
+ elsif target.is_a?(Domain)
+ return remove_domain(target)
+ else
+ raise NotImplementedError
+ end
+ end
+
+
+ # Remove the given *domain*. Some plugins don't have a concept of
+ # domains, so the default implementation here removes all users that
+ # look like they belong to *domain*. Subclasses can be smarter.
+ #
+ # @param domain [Domain] the domain to remove.
+ #
+ def remove_domain(domain)
+ users = list_domains_users([domain])