• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

KLDAP Library

  • kldap
ldapoperation.h
1/*
2 This file is part of libkldap.
3 Copyright (c) 2004-2006 Szombathelyi György <gyurco@freemail.hu>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KLDAP_LDAPOPERATION_H
22#define KLDAP_LDAPOPERATION_H
23
24#include "kldap_export.h"
25#include "ldapconnection.h"
26#include "ldapcontrol.h"
27#include "ldapobject.h"
28#include "ldapdn.h"
29#include "ldapserver.h"
30#include "ldapurl.h"
31
32#include <QtCore/QByteArray>
33#include <QtCore/QList>
34#include <QtCore/QString>
35
36namespace KLDAP {
37
43class KLDAP_EXPORT LdapOperation
44{
45 public:
46 typedef enum {
47 Mod_None, Mod_Add, Mod_Replace, Mod_Del
48 } ModType;
49
50 typedef enum {
51 RES_BIND = 0x61,
52 RES_SEARCH_ENTRY = 0x64,
53 RES_SEARCH_REFERENCE = 0x73,
54 RES_SEARCH_RESULT = 0x65,
55 RES_MODIFY = 0x67,
56 RES_ADD = 0x69,
57 RES_DELETE = 0x69,
58 RES_MODDN = 0x6d,
59 RES_COMPARE = 0x6f,
60 RES_EXTENDED = 0x78,
61 RES_EXTENDED_PARTIAL = 0x79
62 } ResultType;
63
64 typedef struct {
65 ModType type;
66 QString attr;
67 QList<QByteArray> values;
68 } ModOp ;
69
70 typedef QList<ModOp> ModOps;
71
72 enum SASL_Fields {
73 SASL_Authname = 0x1,
74 SASL_Authzid = 0x2,
75 SASL_Realm = 0x4,
76 SASL_Password = 0x8
77 };
78
79 struct SASL_Credentials {
80 int fields;
81 QString authname;
82 QString authzid;
83 QString realm;
84 QString password;
85 };
86
87 typedef int (SASL_Callback_Proc) ( SASL_Credentials &cred, void *data );
88
89 struct SASL_Data {
90 SASL_Callback_Proc *proc;
91 void *data;
92 SASL_Credentials creds;
93 };
94
95 LdapOperation();
96 LdapOperation( LdapConnection &conn );
97 virtual ~LdapOperation();
98
104 void setConnection( LdapConnection &conn );
108 LdapConnection &connection();
112 void setClientControls( const LdapControls &ctrls );
116 void setServerControls( const LdapControls &ctrls );
120 LdapControls clientControls() const;
124 LdapControls serverControls() const;
125
130 int bind( const QByteArray &creds = QByteArray(),
131 SASL_Callback_Proc *saslproc = NULL, void *data = NULL );
132
138 int bind_s( SASL_Callback_Proc *saslproc = NULL, void *data = NULL );
139
144 int search( const LdapDN &base, LdapUrl::Scope scope,
145 const QString &filter, const QStringList &attrs );
151 int add( const LdapObject &object );
157 int add_s( const LdapObject &object );
164 int add( const LdapDN &dn, const ModOps &ops );
172 int add_s( const LdapDN &dn, const ModOps &ops );
179 int rename( const LdapDN &dn, const QString &newRdn,
180 const QString &newSuperior, bool deleteold = true );
187 int rename_s( const LdapDN &dn, const QString &newRdn,
188 const QString &newSuperior, bool deleteold = true );
193 int del( const LdapDN &dn );
199 int del_s( const LdapDN &dn );
205 int modify( const LdapDN &dn, const ModOps &ops );
211 int modify_s( const LdapDN &dn, const ModOps &ops );
217 int compare( const LdapDN &dn, const QString &attr, const QByteArray &value );
225 int compare_s( const LdapDN &dn, const QString &attr, const QByteArray &value );
230 int exop( const QString &oid, const QByteArray &data );
236 int exop_s( const QString &oid, const QByteArray &data );
240 int abandon( int id );
253 int waitForResult( int id, int msecs = -1 );
257 LdapObject object() const;
262 LdapControls controls() const;
267 QByteArray extendedOid() const;
272 QByteArray extendedData() const;
278 QString matchedDn() const;
283 QList<QByteArray> referrals() const;
288 QByteArray serverCred() const;
289
290 private:
291 class LdapOperationPrivate;
292 LdapOperationPrivate *const d;
293
294 Q_DISABLE_COPY( LdapOperation )
295};
296
297}
298
299#endif
KLDAP::LdapConnection
This class represents a connection to an LDAP server.
Definition: ldapconnection.h:37
KLDAP::LdapObject
This class represents an LDAP Object.
Definition: ldapobject.h:42
KLDAP::LdapOperation
This class allows sending an ldap operation (search, rename, modify, delete, compare,...
Definition: ldapoperation.h:44
KLDAP::LdapUrl::Scope
Scope
Describes the scope of the LDAP url.
Definition: ldapurl.h:58
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KLDAP Library

Skip menu "KLDAP Library"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal