lib/adauth/ad_objects/user.rb in adauth-2.0.1 vs lib/adauth/ad_objects/user.rb in adauth-2.0.2

- old
+ new

@@ -46,9 +46,21 @@ Adauth.logger.info("password management") { "Attempting password reset for #{self.login}" } password = microsoft_encode_password(new_password) modify([[:replace, :unicodePwd, password]]) end + # Add the user to the supplied group + def add_to_group(group) + expects group, Adauth::AdObjects::Group + group.modify([[:add, :member, @ldap_object.dn]]) + end + + # Remove the user from the supplied group + def remove_from_group(group) + expects group, Adauth::AdObjects::Group + group.modify([[:delete, :member, @ldap_object.dn]]) + end + private def microsoft_encode_password(password) out = "" password = "\"" + password + "\"" \ No newline at end of file