citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
  Fossies Dox: citadel.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ldap.c File Reference
#include <stdio.h>
#include <libcitadel.h>
#include "citserver.h"
#include "citadel_ldap.h"
#include "ctdl_module.h"
#include "user_ops.h"
#include "internet_addressing.h"
#include "config.h"
#include <ldap.h>
Include dependency graph for ldap.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 

Functions

int ldap_simple_bind_s (LDAP *, const char *, const char *)
 
int ldap_unbind (LDAP *)
 
void derive_fullname_from_ldap_result (char *fullname, int fullname_size, LDAP *ldserver, LDAPMessage *search_result)
 
uid_t derive_uid_from_ldap (LDAP *ldserver, LDAPMessage *entry)
 
int ctdl_ldap_initialize (LDAP **ld)
 
LDAP * ctdl_ldap_bind (void)
 
int CtdlTryUserLDAP (char *username, char *found_dn, int found_dn_size, char *fullname, int fullname_size, uid_t *uid)
 
int CtdlTryPasswordLDAP (char *user_dn, const char *password)
 
int vcard_set_props_iff_different (struct vCard *v, char *propname, int numvals, char **vals)
 
int vcard_set_one_prop_iff_different (struct vCard *v, char *propname, char *newfmt,...)
 
int Ctdl_LDAP_to_vCard (char *ldap_dn, struct vCard *v)
 
int extract_email_addresses_from_ldap (char *ldap_dn, char *emailaddrs)
 
void ldap_note_user_in_citadel (char *username, void *data)
 
void CtdlSynchronizeUsersFromLDAP (void)
 

Variables

int ctdl_require_ldap_version = 3
 

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 14 of file ldap.c.

Function Documentation

◆ ctdl_ldap_bind()

◆ ctdl_ldap_initialize()

int ctdl_ldap_initialize ( LDAP **  ld)

Definition at line 100 of file ldap.c.

References CtdlGetConfigInt(), and CtdlGetConfigStr().

Referenced by ctdl_ldap_bind(), and CtdlTryPasswordLDAP().

◆ Ctdl_LDAP_to_vCard()

int Ctdl_LDAP_to_vCard ( char *  ldap_dn,
struct vCard *  v 
)

◆ CtdlSynchronizeUsersFromLDAP()

◆ CtdlTryPasswordLDAP()

int CtdlTryPasswordLDAP ( char *  user_dn,
const char *  password 
)

◆ CtdlTryUserLDAP()

int CtdlTryUserLDAP ( char *  username,
char *  found_dn,
int  found_dn_size,
char *  fullname,
int  fullname_size,
uid_t *  uid 
)

◆ derive_fullname_from_ldap_result()

void derive_fullname_from_ldap_result ( char *  fullname,
int  fullname_size,
LDAP *  ldserver,
LDAPMessage *  search_result 
)

Definition at line 36 of file ldap.c.

References AUTHMODE_LDAP_AD, and CtdlGetConfigInt().

Referenced by CtdlSynchronizeUsersFromLDAP(), and CtdlTryUserLDAP().

◆ derive_uid_from_ldap()

uid_t derive_uid_from_ldap ( LDAP *  ldserver,
LDAPMessage *  entry 
)

Definition at line 71 of file ldap.c.

References AUTHMODE_LDAP_AD, and CtdlGetConfigInt().

Referenced by CtdlSynchronizeUsersFromLDAP(), and CtdlTryUserLDAP().

◆ extract_email_addresses_from_ldap()

int extract_email_addresses_from_ldap ( char *  ldap_dn,
char *  emailaddrs 
)

Definition at line 448 of file ldap.c.

References ctdl_ldap_bind(), IsDirectory(), and ldap_unbind().

Referenced by CtdlSynchronizeUsersFromLDAP(), and do_login().

◆ ldap_note_user_in_citadel()

void ldap_note_user_in_citadel ( char *  username,
void *  data 
)

Definition at line 525 of file ldap.c.

◆ ldap_simple_bind_s()

int ldap_simple_bind_s ( LDAP *  ,
const char *  ,
const char *   
)

◆ ldap_unbind()

◆ vcard_set_one_prop_iff_different()

int vcard_set_one_prop_iff_different ( struct vCard *  v,
char *  propname,
char *  newfmt,
  ... 
)

Definition at line 282 of file ldap.c.

References free(), and vcard_set_props_iff_different().

Referenced by Ctdl_LDAP_to_vCard().

◆ vcard_set_props_iff_different()

int vcard_set_props_iff_different ( struct vCard *  v,
char *  propname,
int  numvals,
char **  vals 
)

Definition at line 261 of file ldap.c.

Referenced by vcard_set_one_prop_iff_different().

Variable Documentation

◆ ctdl_require_ldap_version

int ctdl_require_ldap_version = 3

Definition at line 12 of file ldap.c.

Referenced by ctdl_ldap_bind(), and CtdlTryPasswordLDAP().