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 users_by_uidnumber
YCPMap usernames
YCPMap userdns
YCPMap uids
YCPMap homes
YCPMap user_items
YCPMap groups
YCPMap groups_by_name
YCPMap groups_by_gidnumber
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.)

Parameters:
dn DN of original entry
new_dn new DN (= new place)

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

log the output of an exception and set the return value from agent's call

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 ().

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]
 

Return YCP of group, given as LDAP object

Parameters:
entry LDAP object of the group [item of search result]
member_attribute name of attribute with members ("member"/"uniquemember")

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

Search the map for value of given key

Parameters:
map YCP Map to look in
key key we are looking for
deflt the default value to be returned if key is not found

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]
 

Return YCP of user, given as LDAP object

Parameters:
entry LDAP object of the user [item of search result]

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

search the map for value of given key; both key and value have to be strings when key is not present, empty string is returned

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

move the entry in LDAP tree with all its children

Parameters:
dn DN of original entry
new_dn new DN (= new place)
parent_dn DN of the new parent of the entry

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.

Implements SCRAgent.

YCPList LdapAgent::stringlist2ycplist StringList  sl  )  [private]
 

converts StringList object to YCPList value

YCPList LdapAgent::stringlist2ycplist_low StringList  sl  )  [private]
 

converts StringList object to YCPList value + each item is lowercased

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

Provides SCR Write ().

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_gidnumber [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]
 

YCPMap LdapAgent::users_by_uidnumber [private]
 


The documentation for this class was generated from the following files:
Generated on Thu Jul 6 00:30:59 2006 for yast2-ldap by  doxygen 1.4.6