brand_new_installation_set_defaults();
}
- /* Only allow LDAP auth mode if we actually have LDAP support */
-#ifndef HAVE_LDAP
- if ((CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP) || (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP_AD)) {
- fprintf(stderr, "Your system is configured for LDAP authentication,\n"
- "but you are running a server built without OpenLDAP support.\n");
- exit(CTDL_EXIT_UNSUP_AUTH);
- }
-#endif
-
/* Default maximum message length is 10 megabytes. This is site
* configurable. Also check to make sure the limit has not been
* set below 8192 bytes.
cprintf("%d\n", CtdlGetConfigInt("c_disable_newu"));
cprintf("1\n"); /* niu */
cprintf("%d\n", CtdlGetConfigInt("c_purge_hour"));
-#ifdef HAVE_LDAP
cprintf("%s\n", CtdlGetConfigStr("c_ldap_host"));
cprintf("%d\n", CtdlGetConfigInt("c_ldap_port"));
cprintf("%s\n", CtdlGetConfigStr("c_ldap_base_dn"));
cprintf("%s\n", CtdlGetConfigStr("c_ldap_bind_dn"));
cprintf("%s\n", CtdlGetConfigStr("c_ldap_bind_pw"));
-#else
- cprintf("\n");
- cprintf("0\n");
- cprintf("\n");
- cprintf("\n");
- cprintf("\n");
-#endif
cprintf("%s\n", CtdlGetConfigStr("c_ip_addr"));
cprintf("%d\n", CtdlGetConfigInt("c_msa_port"));
cprintf("%d\n", CtdlGetConfigInt("c_imaps_port"));
cdb_check_handles();
PerformSessionHooks(EVT_TIMER); // Run all registered TIMER hooks
-#ifdef HAVE_LDAP // LDAP sync isn't in a module so we can put it here
+ // LDAP sync isn't in a module so we can put it here
static time_t last_ldap_sync = 0L;
if ( (now - last_ldap_sync) > (time_t)CtdlGetConfigLong("c_ldap_sync_freq") ) {
CtdlSynchronizeUsersFromLDAP();
last_ldap_sync = time(NULL);
}
-#endif
keep_an_eye_on_memory_usage();
}
-/*
- * These functions implement the portions of AUTHMODE_LDAP and AUTHMODE_LDAP_AD which
- * actually speak to the LDAP server.
- *
- * Copyright (c) 2011-2017 by the citadel.org development team.
- *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+// These functions implement the portions of AUTHMODE_LDAP and AUTHMODE_LDAP_AD which
+// actually speak to the LDAP server.
+//
+// Copyright (c) 2011-2021 by the citadel.org development team.
+//
+// This program is open source software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 3.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
int ctdl_require_ldap_version = 3;
#include "user_ops.h"
#include "internet_addressing.h"
#include "config.h"
+#include <ldap.h>
-#ifdef HAVE_LDAP
#define LDAP_DEPRECATED 1 // Suppress libldap's warning that we are using deprecated API calls
-#include <ldap.h>
/*
/* unbind so we can go back in as the authenticating user */
ldap_unbind(ldserver);
}
-
-#endif /* HAVE_LDAP */
cprintf("1\n"); /* 1 = we support the extended paging options */
cprintf("\n"); /* no longer used */
cprintf("1\n"); /* 1 = yes, this system supports the QNOP command */
-
-#ifdef HAVE_LDAP
cprintf("1\n"); /* 1 = yes, this server is LDAP-enabled */
-#else
- cprintf("0\n"); /* 1 = no, this server is not LDAP-enabled */
-#endif
if ((CtdlGetConfigInt("c_auth_mode") == AUTHMODE_NATIVE) && (CtdlGetConfigInt("c_disable_newu") == 0))
{
* A server-side module for Citadel which supports address book information
* using the standard vCard format.
*
- * Copyright (c) 1999-2020 by the citadel.org team
+ * Copyright (c) 1999-2021 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
}
#endif
-
-#ifdef HAVE_LDAP
/*
* Is this an LDAP session? If so, copy various LDAP attributes from the directory entry
* into the user's vCard.
}
}
}
-#endif
+
if (need_default_vcard!=0) {
/* Everyone gets an email address based on their display name */
snprintf(buf, sizeof buf, "%s@%s", usbuf->fullname, CtdlGetConfigStr("c_fqdn"));
void vcard_session_login_hook(void) {
struct vCard *v = NULL;
-#ifdef HAVE_LDAP
/*
* Is this an LDAP session? If so, copy various LDAP attributes from the directory entry
* into the user's vCard.
}
}
}
-#endif
/*
* Extract the user's friendly/screen name
-/*
- * Server functions which perform operations on user objects.
- *
- * Copyright (c) 1987-2020 by the citadel.org team
- *
- * This program is open source software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+// Server functions which perform operations on user objects.
+//
+// Copyright (c) 1987-2021 by the citadel.org team
+//
+// This program is open source software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License, version 3.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
#include <stdlib.h>
#include <unistd.h>
}
-#ifdef HAVE_LDAP
else if ((CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP) || (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP_AD)) {
/* LDAP auth mode */
}
}
-#endif
else {
/* native auth mode */
CtdlPutUserLock(&CC->user);
/* If we are using LDAP authentication, extract the user's email addresses from the directory. */
-#ifdef HAVE_LDAP
if ((CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP) || (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP_AD)) {
char new_emailaddrs[512];
if (CtdlGetConfigInt("c_ldap_sync_email_addrs") > 0) {
}
}
}
-#endif
/* If the user does not have any email addresses assigned, generate one. */
if (IsEmptyStr(CC->user.emailaddrs)) {
}
}
-#ifdef HAVE_LDAP
else if ((CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP) || (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP_AD)) {
/* LDAP auth mode */
code = (-1);
}
}
-#endif
else {