Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

LdapAgent Class Reference

An interface class between YaST2 and Ldap Agent. More...

#include <LdapAgent.h>

Inheritance diagram for LdapAgent:

SCRAgent List of all members.

Public Member Functions

 LdapAgent ()
virtual ~LdapAgent ()
virtual YCPValue Read (const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &opt=YCPNull())
virtual YCPBoolean Write (const YCPPath &path, const YCPValue &arg, const YCPValue &arg2=YCPNull())
virtual YCPValue Execute (const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &arg2=YCPNull())
virtual YCPList Dir (const YCPPath &path)
virtual YCPValue otherCommand (const YCPTerm &term)

Private Member Functions

string getValue (const YCPMap map, const string key)
int getIntValue (const YCPMap map, const string key, int deflt)
bool getBoolValue (const YCPMap map, const string key)
YCPList getListValue (const YCPMap map, const string key)
StringList ycplist2stringlist (YCPList l)
YCPList stringlist2ycplist (StringList sl)
YCPList stringlist2ycplist_low (StringList sl)
YCPMap getGroupEntry (LDAPEntry *entry, string member_attribute)
YCPMap getUserEntry (LDAPEntry *entry)
YCPMap getSearchedEntry (LDAPEntry *entry, bool sinlge_value)
YCPMap getObjectAttributes (string dn)
YCPBoolean deleteSubTree (string dn)
YCPBoolean moveWithSubtree (string dn, string new_dn, string parent_dn)
YCPBoolean copyOneEntry (string dn, string new_dn)
void debug_exception (LDAPException e, string action)
void generate_attr_list (LDAPAttributeList *attrs, YCPMap map)
void generate_mod_list (LDAPModList *modlist, YCPMap map, YCPValue attrs)

Private Attributes

int port
string hostname
string bind_dn
string bind_pw
string ldap_error
string server_error
int ldap_error_code
bool ldap_initialized
string userpw_hash
LDAPConnection * ldap
LDAPConstraints * cons
LDAPSchema * schema
YCPMap users
YCPMap users_by_name
YCPMap usernames
YCPMap userdns
YCPMap uids
YCPMap homes
YCPMap user_items
YCPMap groups
YCPMap groups_by_name
YCPMap groupnames
YCPMap gids
YCPMap group_items

Detailed Description

An interface class between YaST2 and Ldap Agent.


Constructor & Destructor Documentation

LdapAgent::LdapAgent  ) 
 

Default constructor.

LdapAgent::~LdapAgent  )  [virtual]
 

Destructor.


Member Function Documentation

YCPBoolean LdapAgent::copyOneEntry string  dn,
string  new_dn
[private]
 

copy the LDAP entry to new place (+ changes DN-constructing attribute, like cn,uid,ou etc.)

void LdapAgent::debug_exception LDAPException  e,
string  action
[private]
 

YCPBoolean LdapAgent::deleteSubTree string  dn  )  [private]
 

deletes all children of given entry

YCPList LdapAgent::Dir const YCPPath path  )  [virtual]
 

Provides SCR Dir ().

Implements SCRAgent.

YCPValue LdapAgent::Execute const YCPPath path,
const YCPValue arg = YCPNull(),
const YCPValue arg2 = YCPNull()
[virtual]
 

Provides SCR Execute ().

initialization: Execute (.ldap,$[ "host": , "port": , "use_tls": "no"|"yes"|"try" ] )

bind: Execute(.ldap.bind, $[ "bind_dn": binddn, "bindpw": bindpw] ) for anonymous acess, call bind with empty map

Initialize schema: read and parse it

LDAP users search command Read(.ldap.users.search, ) -> result list (more special work is done than in generic search)

Reimplemented from SCRAgent.

void LdapAgent::generate_attr_list LDAPAttributeList *  attrs,
YCPMap  map
[private]
 

creates attributes for new LDAP object and fills their values

void LdapAgent::generate_mod_list LDAPModList *  modlist,
YCPMap  map,
YCPValue  attrs
[private]
 

creates list of modifications for LDAP object for removing attribute, use give it empty value

bool LdapAgent::getBoolValue const YCPMap  map,
const string  key
[private]
 

YCPMap LdapAgent::getGroupEntry LDAPEntry *  entry,
string  member_attribute
[private]
 

int LdapAgent::getIntValue const YCPMap  map,
const string  key,
int  deflt
[private]
 

Search the map for value of given key; key is string and value is integer

YCPList LdapAgent::getListValue const YCPMap  map,
const string  key
[private]
 

YCPMap LdapAgent::getObjectAttributes string  dn  )  [private]
 

searches for one object and gets all his non-empty attributes

Parameters:
dn object's dn
Returns:
map of type $[ attr_name: [] ]

YCPMap LdapAgent::getSearchedEntry LDAPEntry *  entry,
bool  sinlge_value
[private]
 

creates YCPMap describing object returned as a part of LDAP search call

Parameters:
single_values if true, return string when argument has only one value (otherwise return always list)

YCPMap LdapAgent::getUserEntry LDAPEntry *  entry  )  [private]
 

string LdapAgent::getValue const YCPMap  map,
const string  key
[private]
 

YCPBoolean LdapAgent::moveWithSubtree string  dn,
string  new_dn,
string  parent_dn
[private]
 

move the entry in LDAP tree with all its children

YCPValue LdapAgent::otherCommand const YCPTerm term  )  [virtual]
 

Used for mounting the agent.

Reimplemented from SCRAgent.

YCPValue LdapAgent::Read const YCPPath path,
const YCPValue arg = YCPNull(),
const YCPValue opt = YCPNull()
[virtual]
 

Provides SCR Read ().

Parameters:
path Path that should be read.
arg Additional parameter.

error: Read(.ldap.error) -> returns last error message

generic LDAP search command Read(.ldap.search, ) -> result list/map of objects (return value depends on value of "return_map" parameter

get the users map (previously searched by users.search) Read(.ldap.users) -> map

get the groups map (previously searched by users.search) Read(.ldap.groups) -> map

get the map of object class with given name Read(.ldap.schema.oc, $[ "name": name]) -> map

get the map of attribute type with given name Read(.ldap.schema.at, $[ "name": name]) -> map

get the mapping of usernames to uid's (used for users module) Read(.ldap.users.by_name) -> map

get the list of home directories (used for users module) Read(.ldap.users.homes) -> list of homes

get the list of UID's (used for users module) Read(.ldap.users.uids) -> list

get the list of user names (used for users module) Read(.ldap.users.usernames) -> list

get the list of user DN's (used for users module) Read(.ldap.users.userdns) -> list

get the items for user table (used for users module) Read(.ldap.users.itemlist) -> list of items

get the map of groups indexed by group names (used for users module) Read(.ldap.groups.by_name) -> map

get the list of GID's (used for users module) Read(.ldap.groups.gids) -> list

get the list of group names (used for users module) Read(.ldap.groups.groupnames) -> list

get the items for group table (used for users module) Read(.ldap.groups.itemlist) -> list of items

check if given object class exists in schema Read(.ldap.schema.oc.check, $[ "name": name]) -> boolean

Implements SCRAgent.

YCPList LdapAgent::stringlist2ycplist StringList  sl  )  [private]
 

converts StringList object to YCPList value

YCPList LdapAgent::stringlist2ycplist_low StringList  sl  )  [private]
 

YCPBoolean LdapAgent::Write const YCPPath path,
const YCPValue arg,
const YCPValue arg2 = YCPNull()
[virtual]
 

Provides SCR Write ().

generic LDAP add command Write(.ldap.add, $[ "dn": dn ], ) -> boolean

generic LDAP modify command Write(.ldap.modify, , ) -> boolean

  • modify_map is list of attributes and its values to add or modify.
  • To remove some attribute, use empty value ("" or []) for it.
  • arg_map has to contain "dn" entry.
  • If arg_map contains "rdn" key, object will be renamed using the value of "rdn" as new Relative Distinguished Name. For moving, use "newParentDN" value for new parent DN of object.
  • "new_dn" new DN of renamed object
  • If arg_map contains "check_attrs" key (with true value), there will be done search for current object's attributes before modify. When some attribute in modify_map has empty value it will be ignored, if object currently has not this attribute. Otherwise ("check_attrs" is false as default), this situation leads to error message, because non-existent attribute is set for deletion.

generic LDAP delete command Write(.ldap.delete, $[ "dn" : dn ]) -> boolean

Implements SCRAgent.

StringList LdapAgent::ycplist2stringlist YCPList  l  )  [private]
 

converts YCPList to StringList object


Member Data Documentation

string LdapAgent::bind_dn [private]
 

string LdapAgent::bind_pw [private]
 

LDAPConstraints* LdapAgent::cons [private]
 

YCPMap LdapAgent::gids [private]
 

YCPMap LdapAgent::group_items [private]
 

YCPMap LdapAgent::groupnames [private]
 

YCPMap LdapAgent::groups [private]
 

YCPMap LdapAgent::groups_by_name [private]
 

YCPMap LdapAgent::homes [private]
 

string LdapAgent::hostname [private]
 

LDAPConnection* LdapAgent::ldap [private]
 

string LdapAgent::ldap_error [private]
 

int LdapAgent::ldap_error_code [private]
 

bool LdapAgent::ldap_initialized [private]
 

int LdapAgent::port [private]
 

Agent private variables

LDAPSchema* LdapAgent::schema [private]
 

string LdapAgent::server_error [private]
 

YCPMap LdapAgent::uids [private]
 

YCPMap LdapAgent::user_items [private]
 

YCPMap LdapAgent::userdns [private]
 

YCPMap LdapAgent::usernames [private]
 

string LdapAgent::userpw_hash [private]
 

YCPMap LdapAgent::users [private]
 

YCPMap LdapAgent::users_by_name [private]
 


The documentation for this class was generated from the following files:
Generated on Tue Jan 4 17:02:11 2005 for yast2-ldap by doxygen 1.3.6