Home | Trees | Indices | Help |
---|
|
easyLDAP_class_base.easyLDAP --+ | easyLDAP_object
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
Method Details |
|
Creates a deepcopy of the easyLDAP object class.
|
thisClass.get_parent_dn ('myDN') returns the parent absolute DN of 'myDN' from the LDAP server's directory tree.
|
returns the relative DN of the cached easyLDAPobject (i.e. the first protion of the object's DN). |
get_attrtype_values('myATTRTYPE') returns a dictionary that contains all attribute descriptions in the easyLDAP object cache that contain the attribute type 'myATTRTYPE'. This method is handy for e.g. viewing all attribute type's translations. On failure, the method returns an empty dictionary. |
returns a list of attribute types that are used in the current easyLDAP object. If - by some reason - the cache is empty, an empty list is returned. Another LDAP object than the one currently cached can be analyzed by passing 'mySINGLELDAPOBJECT'. The lengths of the passed LDAP object has to be 1.
|
thisClass.get_used_attroptions('myATTRDESC', [mySINGLELDAPOBJECT]) returns a list of all attribute options used with attribute type same as in 'myATTRDESC'. The comparison is performed on an OID basis. So, if an alias of an 'myATTRDESC' is used, it will be taken into account.
|
returns a list of objectClasses that are used in the current easyLDAP object. If - by some reason - the cache is empty, an empty list is returned. Another LDAP object than the one currently cached can be analyzed by passing 'mySINGLELDAPOBJECT'. The lengths of the passed LDAP object has to be 1. |
thisClass.has_objectclass_set('myOBJECTCLASS'): returns True, if the objectClass 'myOBJECTCLASS' is set in the cached easyLDAP object. |
thisClass.has_attrtype_set('myATTRTYPE'): returns True, if the attribute type 'myATTRTYPE' is set in the cached easyLDAP object. The attribute type is checked on an OID basis. |
thisClass.has_attrdesc_set('myATTRDESC'): returns True, if the attribute 'myATTRDESC' is set in the cached easyLDAP object. The attribute type is checked on an OID basis. |
thisClass.has_value('myVALUE'): returns True, if the value 'myVALUE' is set in the cached easyLDAP object, regardless from the attribute it is set for. |
thisClass.has_attrdesc_values_set('myATTRDESC', 'myVALUE'): returns True, if the list of values 'myVALUES' is identical to those found in the cached easyLDAP object's attribute description 'myATTRDESC'. |
thisClass.has_attrdesc_value_set_in_values('myVALUE','myATTRDESC'): returns True, if the value 'myVALUE' is set in the cached easyLDAP object's attribute description 'myATTRDESC' (amongst other possible values). |
loads/refreshes the easyLDAP object cache. This method should be the only easyLDAP module code that performs a read operation on the actual LDAP directory server. BEWARE: This method is called, when thisClass is initiated. If the given DN (at __init__ time) exists in the LDAP directory, this method: - reads the DN's data LDAP directory from the LDAP directory, - checks and repairs objectClass dependencies violations, - moves the data in the easyLDAP cache. If the given DN is new to the LDAP directory, this method: - creates an empty easyLDAP object cache, - marks the object as a new object, so the first thisClass.flush_cache() operation will be 'ldap.add_s' as opposed to 'ldap.modify_s' Once the easyLDAP cache is filled with the DN data all modification will be performed in the easyLDAP object cache. Once you are done, use thisClass.flush_cache() to update the LDAP directory's data. WARNING: this method tries to repair buggy LDAP objects. If it finds an attribute that does not have an objectClass set, the method will try to find a usable objectClass (it will take the first it finds, which might not be wanted). If there is no such objectClass in the server's LDAP schema, the invalid attributes will be purged from the object. This is a repair functionality and should not come to use...
|
returns a list of changes that have been applied to the easyLDAP object chache. The format of this list is conformant with the modlist structure in python- ldap that is used for the methods ldap.modify() / ldap.modify_s() |
returns a list of changes applied to the easyLDAP object cache that these changes can be undone with. The format of this list is conformant with the modlist structure in python-ldap that is used for the methods ldap.modify() / ldap.modify_s() |
returns the changes applied to the easyLDAP object cache in ldif format. The method returns a python list in which each item represents a line of the text base ldif format. |
returns ldif output that can undo the changes applied to the easyLDAP object cache. The method returns a python list in which each item represents a line of the text base ldif format. |
writes the easyLDAP object cache to the LDAP directory. This method should be the only easyLDAP module code that performs a write operation on the actual LDAP directory server. If the given DN existed in the LDAP directory at __init__ time, this method: - checks, if the cached DN still exists in the LDAP directory (otherwise, it switches to object creation mode). - flushes modifications and additions to the easyLDAP object cache to the server's LDAP directory. If the given DN was new to the LDAP directory at __init__ time, this method: - checks, if the cached DN is still new to the LDAP directory (otherwise, it switches to object modification mode). - checks, if the underlying DN still exists in the directory. If not the flush_cache() operation will fail. - adds easyLDAP object cache to the LDAP directory. If the easyLDAP object cache does not need a flush_cache() operation (as it is up-to-date), the flush will not be performed (i.e. fail). |
thisClass.add_objectclass('myOBJECTCLASS'|['myOBJECTCLASS1', 'myOBJECTCLASS2', ...]) adds one ore more objectClass(es) and all needed SUPerior objectClasses to the cached easyLDAP object. Attributes that - according to the server's LDAP schema - MUST be present will be set to default values regarding their proposed syntaxes in thisClass.LDAPSyntaxes. The default values are stored in thisClass.templateLDAPSyntaxValues. |
returns a list of those attribute OIDs, that are used the LDAP object 'mySINGLEOBJECT'. This list is taken from the server's LDAP schema. |
thisClass.has_oid_set('myOID') checks if the given OID 'myOID' is set in the LDAP object 'mySINGLELDAPOBJECT'. If so, the method's result is True.
|
thisClass.del_objectclass('myOBJECTCLASS'|['myOBJECTCLASS1', 'myOBJECTCLASS2', ...]) deletes one ore more objectClass(es) from the cached easyLDAP object. All attributes that only occur in the deleted objectClass(es) are also removed - so be careful! The method will abort ... if one of the given objectClass names are not set in the easyLDAP object cache. The method ignores ... objectClasses that are to be deleted, but are needed as a SUPerior objectClass by another objectClass. |
thisClass.del_attrdesc_value('myATTRDESC', 'myVALUE' ignore_case={True|FALSE}) deletes the value 'myVALUE' from the LDAP attribute description 'myATTRDESC' in the currently cached object. If 'myVALUE' is the only value for 'myATTRDESC', the whole attribute is removed from the cached easyLDAP object. The method returns True on successful deletion. |
thisClass.del_attrdesc('myATTRDESC') deletes the whole entry for attribute description 'myATTRDESC' from the cached easyLDAP object. The method returns True on successful deletion. |
thisClass.del_attrtype('myATTRTYPE') deletes all entries for attribute type 'myATTRTYPE' from the cached easyLDAP object. Be aware that all subentries of the attribute type 'myATTRTYPE' will be removed (e.g. all language options with one shot). The method returns True on successful deletion. |
thisClass.set_attr('myLDAP_ATTRDESC', 'myVALUE'|['myVALUE1', 'myVALUE2', ...]) is a wrapper for thisClass._modify_attrdesc('myLDAP_ATTRDESC', 'myVALUE'|['myVALUE1', 'myVALUE2', ...], easyLDAP_REPLACEATTR) or thisClass.del_attrdesc('myLDAP_ATTRIBUTE') depending on the attribute description's context... |
thisClass.set_attr('myATTRDESCDICT) helps copy+pasting a whole attribute type from one easyLDAP object into another easyLDAP object. Little HOWTO: o connect to two easyLDAP objects. Let's call them ,,source" and ,,target". o retrieve all attribute descriptions (including all subentries) of a certain attribute type 'myATTRTYPE' from easyLDAPobject ,,source" with my_attrtype = source.get_attrtype_values('myATTRTYPE') o paste the retrieved data (a python dictionary) into easyLDAPobject ,,target" with target.set_attrtype(my_attrtype) o flush the easyLDAP object cache of ,,target" with target.flush_cache() If necessary objectClasses can be detected automagically they will be added silently. If not, the method returns a list of possible objectClasses that all provide the attribute type of your interest. The structure of myATTRDESCDICT is expected to be an excerpt from a python-ldap object { 'attrtype;attropt1': ['val1','val2'], 'attrtype;attropt2': [...], ... } Keys of myATTRDESCDICT must alwasy have the same attribute type. The attribute options must be supported by LDAPv3 protocol. Attribute description values must be given as multi-valued or single-valued lists (depending on the attribute's properties in the server's schema). |
thisClass.add_attrdesc('myLDAP_ATTRDESC', 'myVALUE'|['myVALUE1', 'myVALUE2', ...]) is a wrapper for thisClass._modify_attrdesc('myLDAP_ATTRDESC', 'myVALUE'|['myVALUE1', 'myVALUE2', ...], easyLDAP_ADDATTR) |
will display the cached easyLDAP object just like the console tool 'ldapsearch' does... unset but possible attributes are not listed. |
thisClass.new_object(['myOBJ_CLASS1', 'myOBJ_CLASS2'], { 'myATTR1': ['myVAL1_1', 'myVAL1_2', ...], 'myATTR2': ['myVAL2_1', 'myVAL2_2', ...], ' ... } ) creates an empty object in the easyLDAP object cache. The object will only be uploaded to the LDAP directory, until the method thisClass.flush_cash() is evoked. This action overwrites the current easyLDAP object cache and creates a new cache object if the used DN was not existent in the LDAP directory at the time of thisClass.__init__ ('myDN'). This newly created object can be modified by several easyLDAP methods. Use dir(thisClass). To view the contents of the new easyLDAP object cache, use thisClass.show(). |
thisClass.set_userPassword('myUNIXPASSWORD','myHASH') sets the user's unix password to 'myUNIXPASSWORD'. As encryption hash 'myHASH' you can additionally pass CLEAR CRYPT The default hash is 'CRYPT'. If the easyLDAP object has the shadowAccount objectclass set, the attribute shadowLastChange will be set to the current date (in days since 1970). |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sun Oct 3 15:37:36 2010 | http://epydoc.sourceforge.net |