Removed the remaining code where LDAP was optional.
authorArt Cancro <ajc@citadel.org>
Mon, 15 Nov 2021 23:56:29 +0000 (18:56 -0500)
committerArt Cancro <ajc@citadel.org>
Mon, 15 Nov 2021 23:56:29 +0000 (18:56 -0500)
citadel/config.c
citadel/control.c
citadel/housekeeping.c
citadel/ldap.c
citadel/modules/ctdlproto/serv_session.c
citadel/modules/vcard/serv_vcard.c
citadel/user_ops.c

index bd915f4c4a6a9bad03b992cfa16342cc2dc1497a..d04f87434a50096502272fb26c3ed5e8e3273757 100644 (file)
@@ -265,15 +265,6 @@ void initialize_config_system(void) {
                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.
index 9e790e5b07b70946b48dead32f28bebd3e435442..645904267539e6a166b9e0d70c0ac6ba39581790 100644 (file)
@@ -295,19 +295,11 @@ void cmd_conf(char *argbuf)
                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"));
index 4de8e4baf497317e3ab23578755a7ab6474c4d05..54cfe11b83fa0888917d8c384c683ef4844748cb 100644 (file)
@@ -146,13 +146,12 @@ void do_housekeeping(void) {
                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();
        }
index 73e45ba23c2a777ee6072fe155b6a482c207edee..f78130f9580a19747b77eb2c60f998a59f8f51ac 100644 (file)
@@ -1,17 +1,15 @@
-/*
- * 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;
 
@@ -24,10 +22,9 @@ 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>
 
 
 /*
@@ -632,5 +629,3 @@ void CtdlSynchronizeUsersFromLDAP(void)
        /* unbind so we can go back in as the authenticating user */
        ldap_unbind(ldserver);
 }
-
-#endif /* HAVE_LDAP */
index 739de3fa9adb9a721d4cf429d13825bbfcbcc6b7..697cc93716f820f392dab20518410a512a8d4d7e 100644 (file)
@@ -66,12 +66,7 @@ void cmd_info(char *cmdbuf) {
        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))
        {
index 413be56ff08fc7ac0c72f751c147bbef4d5625ea..63cbb64223fadf89c81b4db1703d2280c8e46d3f 100644 (file)
@@ -2,7 +2,7 @@
  * 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.
@@ -721,8 +721,6 @@ void vcard_newuser(struct ctdluser *usbuf) {
        }
 #endif
 
-
-#ifdef HAVE_LDAP
        /*
         * Is this an LDAP session?  If so, copy various LDAP attributes from the directory entry
         * into the user's vCard.
@@ -745,7 +743,7 @@ syslog(LOG_DEBUG, "\033[31m FIXME BORK BORK BORK try lookup by uid , or maybe dn
                        }
                }
        }
-#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"));
@@ -995,7 +993,6 @@ void vcard_CtdlCreateRoom(void)
 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.
@@ -1010,7 +1007,6 @@ void vcard_session_login_hook(void) {
                        }
                }
        }
-#endif
 
        /*
         * Extract the user's friendly/screen name
index 473e83a80a8783c62ba938653a5e0c91599fbc5e..a8f7b34233039dd41e7cc9d736fd53410c60995c 100644 (file)
@@ -1,16 +1,14 @@
-/* 
- * 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>
@@ -595,7 +593,6 @@ int CtdlLoginExistingUser(const char *trythisname)
 
        }
 
-#ifdef HAVE_LDAP
        else if ((CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP) || (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP_AD)) {
        
                /* LDAP auth mode */
@@ -621,7 +618,6 @@ int CtdlLoginExistingUser(const char *trythisname)
                }
 
        }
-#endif
 
        else {
                /* native auth mode */
@@ -685,7 +681,6 @@ void do_login(void)
        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) {
@@ -694,7 +689,6 @@ void do_login(void)
                        }
                }
        }
-#endif
 
        /* If the user does not have any email addresses assigned, generate one. */
        if (IsEmptyStr(CC->user.emailaddrs)) {
@@ -917,7 +911,6 @@ int CtdlTryPassword(const char *password, long len)
                }
        }
 
-#ifdef HAVE_LDAP
        else if ((CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP) || (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP_AD)) {
 
                /* LDAP auth mode */
@@ -929,7 +922,6 @@ int CtdlTryPassword(const char *password, long len)
                        code = (-1);
                }
        }
-#endif
 
        else {