Started prepping for the move from LDAP Access to LDAP Sync
authorArt Cancro <ajc@citadel.org>
Fri, 27 Oct 2017 04:48:42 +0000 (00:48 -0400)
committerArt Cancro <ajc@citadel.org>
Fri, 27 Oct 2017 04:48:42 +0000 (00:48 -0400)
citadel/citadel_ldap.h
citadel/housekeeping.c
citadel/ldap.c
citadel/user_ops.c

index ed93734553674e34e560b0cbbbaae10ff3f3a8e8..a8e03292fb6d0f15bd09c7e90a4ebd063705fda3 100644 (file)
@@ -16,4 +16,4 @@ int CtdlTryUserLDAP(char *username, char *found_dn, int found_dn_size, char *ful
 int CtdlTryPasswordLDAP(char *user_dn, const char *password);
 int Ctdl_LDAP_to_vCard(char *ldap_dn, struct vCard *v);
 int extract_email_addresses_from_ldap(char *ldap_dn, char *emailaddrs);
-void CtdlPopulateUsersFromLDAP(void);
+void CtdlSynchronizeUsersFromLDAP(void);
index ee12b16a7b690832eee9eda67999c166abf07a0a..f3577c0cf60956090fee39c2747b2e9a0a6b4ec0 100644 (file)
@@ -127,7 +127,9 @@ void do_housekeeping(void) {
        /* Then, do the "once per minute" stuff... */
        if (do_perminute_housekeeping_now) {
                cdb_check_handles();
-               //CtdlPopulateUsersFromLDAP();          // This one isn't from a module so we put it here
+#ifdef HAVE_LDAP
+               CtdlSynchronizeUsersFromLDAP();         // This one isn't from a module so we put it here
+#endif
                PerformSessionHooks(EVT_TIMER);         // Run all registered TIMER hooks
        }
 
index 2a770f839c66bf108fd908e06d0d7c55b080c124..9855fb7b7d45278d198a843d1272da7d74f3784f 100644 (file)
@@ -549,7 +549,7 @@ int extract_email_addresses_from_ldap(char *ldap_dn, char *emailaddrs)
 /*
  * Scan LDAP for users and populate Citadel's user database with everyone
  */
-void CtdlPopulateUsersFromLDAP(void)
+void CtdlSynchronizeUsersFromLDAP(void)
 {
        LDAP *ldserver = NULL;
        int i;
index 0a61cb0e28a01dc6c6b7788e7be1eab8b5f40332..5cdd4977a6881c1692755ccfc3bfe23845c17034 100644 (file)
@@ -461,8 +461,10 @@ void rebuild_usersbynumber(void) {
  * getuserbyuid()  -     get user by system uid (for PAM mode authentication)
  *                    returns 0 if user was found
  *
- * WARNING: don't use this function unless you absolutely have to.  It does
- *       a sequential search and therefore is computationally expensive.
+ * WARNING:    don't use this function unless you absolutely have to.  It does
+ *             a sequential search and therefore is computationally expensive.
+ *
+ * FIXME:      build an index, dummy.
  */
 int getuserbyuid(struct ctdluser *usbuf, uid_t number)
 {