LibreOffice Module extensions (master) 1
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
extensions::config::ldap::LdapConnection Class Reference

Class encapsulating all LDAP functionality. More...

#include <ldapaccess.hxx>

Collaboration diagram for extensions::config::ldap::LdapConnection:
[legend]

Public Member Functions

 LdapConnection ()
 Default constructor. More...
 
 ~LdapConnection ()
 Destructor, releases the connection. More...
 
void connectSimple (const LdapDefinition &aDefinition)
 Make connection to LDAP server. More...
 
void getUserProfile (const OUString &aUser, LdapData *data)
 Gets LdapUserProfile from LDAP repository for specified user. More...
 
OUString findUserDn (const OUString &aUser)
 finds DN of user More...
 

Private Member Functions

void initConnection ()
 
void disconnect ()
 
bool isValid () const
 Indicates whether the connection is in a valid state. More...
 
void connectSimple ()
 

Private Attributes

LDAP * mConnection
 LDAP connection object. More...
 
LdapDefinition mLdapDefinition
 

Friends

struct LdapMessageHolder
 

Detailed Description

Class encapsulating all LDAP functionality.

Definition at line 75 of file ldapaccess.hxx.

Constructor & Destructor Documentation

◆ LdapConnection()

extensions::config::ldap::LdapConnection::LdapConnection ( )
inline

Default constructor.

Definition at line 81 of file ldapaccess.hxx.

◆ ~LdapConnection()

extensions::config::ldap::LdapConnection::~LdapConnection ( )

Destructor, releases the connection.

Definition at line 48 of file ldapaccess.cxx.

References disconnect(), and isValid().

Member Function Documentation

◆ connectSimple() [1/2]

void extensions::config::ldap::LdapConnection::connectSimple ( )
private

◆ connectSimple() [2/2]

void extensions::config::ldap::LdapConnection::connectSimple ( const LdapDefinition aDefinition)

Make connection to LDAP server.

Exceptions
ldap::LdapConnectionException
ldap::LdapGenericException

Definition at line 98 of file ldapaccess.cxx.

References connectSimple(), disconnect(), isValid(), and mLdapDefinition.

Referenced by extensions::config::ldap::LdapUserProfileBe::LdapUserProfileBe().

◆ disconnect()

void extensions::config::ldap::LdapConnection::disconnect ( )
private

Definition at line 54 of file ldapaccess.cxx.

References mConnection.

Referenced by connectSimple(), and ~LdapConnection().

◆ findUserDn()

OUString extensions::config::ldap::LdapConnection::findUserDn ( const OUString &  aUser)

finds DN of user

Returns
DN of User
Exceptions
lang::IllegalArgumentException
ldap::LdapConnectionException
ldap::LdapGenericException

Definition at line 227 of file ldapaccess.cxx.

References extensions::config::ldap::checkLdapReturnCode(), connectSimple(), isValid(), extensions::config::ldap::LdapDefinition::mBaseDN, mConnection, mLdapDefinition, extensions::config::ldap::LdapDefinition::mUserObjectClass, extensions::config::ldap::LdapDefinition::mUserUniqueAttr, OUStringToOString(), and result.

Referenced by getUserProfile().

◆ getUserProfile()

void extensions::config::ldap::LdapConnection::getUserProfile ( const OUString &  aUser,
LdapData data 
)

Gets LdapUserProfile from LDAP repository for specified user.

Parameters
aUsername of logged on user
aUserProfileMapMap containing LDAP->00o mapping
aUserProfilestruct for holding OOo values
Exceptions
css::ldap::LdapGenericExceptionif an LDAP error occurs.

Definition at line 172 of file ldapaccess.cxx.

References extensions::config::ldap::checkLdapReturnCode(), connectSimple(), findUserDn(), isValid(), mConnection, OUStringToOString(), result, and values.

Referenced by extensions::config::ldap::LdapUserProfileBe::LdapUserProfileBe().

◆ initConnection()

void extensions::config::ldap::LdapConnection::initConnection ( )
private

◆ isValid()

bool extensions::config::ldap::LdapConnection::isValid ( ) const
inlineprivate

Indicates whether the connection is in a valid state.

Returns
sal_True if connection is valid, sal_False otherwise

Definition at line 121 of file ldapaccess.hxx.

References mConnection.

Referenced by connectSimple(), findUserDn(), getUserProfile(), and ~LdapConnection().

Friends And Related Function Documentation

◆ LdapMessageHolder

friend struct LdapMessageHolder
friend

Definition at line 77 of file ldapaccess.hxx.

Member Data Documentation

◆ mConnection

LDAP* extensions::config::ldap::LdapConnection::mConnection
private

LDAP connection object.

Definition at line 128 of file ldapaccess.hxx.

Referenced by connectSimple(), disconnect(), findUserDn(), getUserProfile(), initConnection(), and isValid().

◆ mLdapDefinition

LdapDefinition extensions::config::ldap::LdapConnection::mLdapDefinition
private

Definition at line 129 of file ldapaccess.hxx.

Referenced by connectSimple(), findUserDn(), and initConnection().


The documentation for this class was generated from the following files: