Example #1
0
	def move(self, dn, newdn):
		newrdn = get_rdn (newdn)
		parent1 = get_parent_dn (dn)
		parent2 = get_parent_dn (newdn)
		
		if parent1 != parent2:
			self.lo.rename_s(s4.compatible_modstring (unicode (dn)),
							 s4.compatible_modstring (unicode (newrdn)),
							 s4.compatible_modstring (unicode (parent2)))
		else:
			self.lo.modrdn_s(s4.compatible_modstring (unicode (dn)),
							 s4.compatible_modstring (unicode (newrdn)))
Example #2
0
	def delete(self, dn):
		self.lo.delete_s(s4.compatible_modstring (unicode (dn)))
Example #3
0
	def create(self, dn, attrs):
		ldif = modlist.addModlist(attrs)
		self.lo.add_s(s4.compatible_modstring (unicode (dn)),ldif)
Example #4
0
	def remove_from_attribute(self, dn, key, value):
		self.lo.modify_s (s4.compatible_modstring (unicode (dn)),
						  [(ldap.MOD_DELETE, key, s4.compatible_modstring (unicode (value)))])
Example #5
0
	def append_to_attribute(self, dn, key, value):
		self.lo.modify_s (s4.compatible_modstring (unicode (dn)),
						  [(ldap.MOD_ADD, key, s4.compatible_modstring (unicode (value)))])
Example #6
0
	def delete_attribute(self, dn, key):
		self.lo.modify_s (s4.compatible_modstring (unicode (dn)),
						  [(ldap.MOD_DELETE, key, None)])
Example #7
0
	def set_attribute(self, dn, key, value):
		self.lo.modify_s (s4.compatible_modstring (unicode (dn)),
						  [(ldap.MOD_REPLACE, key, s4.compatible_modstring (unicode (value)))])