summaryrefslogtreecommitdiff
path: root/extensions/source/config/ldap/ldapaccess.hxx
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2009-10-02 13:56:08 +0200
committersb <sb@openoffice.org>2009-10-02 13:56:08 +0200
commitbb35ec279351b63104a1edbb4033693387d774b2 (patch)
treefc3c525da6aead92fa3747d3090cc85066061818 /extensions/source/config/ldap/ldapaccess.hxx
parent3055127b0b0389e8ca0f5d4de40033dc3eb9ea0d (diff)
#i101955# adapted LDAP backend to new interface, dropped registry/ldap/*-attr.map files, replaced registry/data/org/openoffice/LDAP.xcu.sample with registry/oo-ldap.xcd.sample and registry/oo-ad-ldap.xcd.sample
Diffstat (limited to 'extensions/source/config/ldap/ldapaccess.hxx')
-rw-r--r--extensions/source/config/ldap/ldapaccess.hxx33
1 files changed, 12 insertions, 21 deletions
diff --git a/extensions/source/config/ldap/ldapaccess.hxx b/extensions/source/config/ldap/ldapaccess.hxx
index 47022bb0d615..3951d8645e6d 100644
--- a/extensions/source/config/ldap/ldapaccess.hxx
+++ b/extensions/source/config/ldap/ldapaccess.hxx
@@ -31,6 +31,10 @@
#ifndef EXTENSIONS_CONFIG_LDAP_LDAPACCESS_HXX_
#define EXTENSIONS_CONFIG_LDAP_LDAPACCESS_HXX_
+#include "sal/config.h"
+
+#include <map>
+
#include "wrapldapinclude.hxx"
#include <com/sun/star/ldap/LdapGenericException.hpp>
@@ -57,6 +61,8 @@ typedef LDAP_API(LDAP *) (LDAP_CALL *t_ldap_init)( const char *defhost, int defp
typedef LDAP_API(int) (LDAP_CALL *t_ldap_msgfree)( LDAPMessage *lm );
typedef LDAP_API(char *) (LDAP_CALL *t_ldap_get_dn)( LDAP *ld, LDAPMessage *entry );
typedef LDAP_API(LDAPMessage *) (LDAP_CALL *t_ldap_first_entry)( LDAP *ld, LDAPMessage *chain );
+typedef LDAP_API(char *) (LDAP_CALL *t_ldap_first_attribute)( LDAP *ld, LDAPMessage *entry, void **ptr );
+typedef LDAP_API(char *) (LDAP_CALL *t_ldap_next_attribute)( LDAP *ld, LDAPMessage *entry, void *ptr );
typedef LDAP_API(int) (LDAP_CALL *t_ldap_search_s)( LDAP *ld, const char *base, int scope, const char *filter, char **attrs, int attrsonly, LDAPMessage **res );
typedef LDAP_API(void) (LDAP_CALL *t_ldap_value_free)( char **vals );
typedef LDAP_API(char **) (LDAP_CALL *t_ldap_get_values)( LDAP *ld, LDAPMessage *entry, const char *target );
@@ -79,10 +85,10 @@ struct LdapDefinition
rtl::OString mUserObjectClass;
/** User Entity Unique Attribute */
rtl::OString mUserUniqueAttr;
- /** Mapping File */
- rtl::OString mMapping;
} ;
+typedef std::map< rtl::OUString, rtl::OUString > LdapData; // key/value pairs
+
/** Class encapulating all LDAP functionality */
class LdapConnection
{
@@ -98,36 +104,19 @@ public:
throw (ldap::LdapConnectionException,
ldap::LdapGenericException);
- /** query connection status */
- bool isConnected() const { return isValid(); }
-
/**
Gets LdapUserProfile from LDAP repository for specified user
@param aUser name of logged on user
@param aUserProfileMap Map containing LDAP->00o mapping
- @param aUserProfile struct for holding OOo values
+ @param aUserProfile struct for holding OOo values
@throws com::sun::star::ldap::LdapGenericException
if an LDAP error occurs.
*/
- void getUserProfile(const rtl::OUString& aUser,
- const LdapUserProfileMap& aUserProfileMap,
- LdapUserProfile& aUserProfile)
+ void getUserProfile(const rtl::OUString& aUser, LdapData * data)
throw (lang::IllegalArgumentException,
ldap::LdapConnectionException,
ldap::LdapGenericException);
- /**
- Retrieves a single attribute from a single entry.
- @param aDn entry DN
- @param aAttribute attribute name
-
- @throws com::sun::star::ldap::LdapGenericException
- if an LDAP error occurs.
- */
- rtl::OString getSingleAttribute(const rtl::OString& aDn,
- const rtl::OString& aAttribute)
- throw (ldap::LdapConnectionException,
- ldap::LdapGenericException);
/** finds DN of user
@return DN of User
@@ -169,6 +158,8 @@ private:
static t_ldap_msgfree s_p_msgfree;
static t_ldap_get_dn s_p_get_dn;
static t_ldap_first_entry s_p_first_entry;
+ static t_ldap_first_attribute s_p_first_attribute;
+ static t_ldap_next_attribute s_p_next_attribute;
static t_ldap_search_s s_p_search_s;
static t_ldap_memfree s_p_memfree;