]> code.citadel.org Git - citadel.git/blobdiff - citadel/user_ops.c
* Merge LDAP code; bindings are not yet complete
[citadel.git] / citadel / user_ops.c
index 894548cab31326c5ffaaba19121b2ceff9c10440..b574fbd02fde850c39447eb2a9c5211f814d7faf 100644 (file)
@@ -50,6 +50,7 @@
 #include "citadel_dirs.h"
 #include "genstamp.h"
 #include "threads.h"
+#include "citadel_ldap.h"
 
 /* These pipes are used to talk to the chkpwd daemon, which is forked during startup */
 int chkpwd_write_pipe[2];
@@ -541,6 +542,13 @@ int CtdlLoginExistingUser(char *authname, char *trythisname)
 
        }
 
+#ifdef HAVE_LDAP
+       else if (config.c_auth_mode == AUTHMODE_LDAP) {
+
+               /* LDAP auth mode FIXME_LDAP */
+       }
+#endif
+
        else {
                /* native auth mode */
 
@@ -728,9 +736,7 @@ void logout(void)
                purge_user(CCC->user.fullname);
 
        /* Free any output buffers */
-       if (CCC->output_buffer != NULL) {
-               unbuffer_output();
-       }
+       unbuffer_output();
 }
 
 /*
@@ -862,6 +868,13 @@ int CtdlTryPassword(char *password)
                }
        }
 
+#ifdef HAVE_LDAP
+       else if (config.c_auth_mode == AUTHMODE_LDAP) {
+
+               /* LDAP auth mode FIXME_LDAP */
+       }
+#endif
+
        else {
 
                /* native auth mode */
@@ -1062,20 +1075,15 @@ int create_user(char *newusername, int become_user)
                        uid = pd.pw_uid;
                        if (IsEmptyStr (username))
                        {
-                               CtdlLogPrintf (CTDL_EMERG, 
-                                        "Can't find Realname for user %s [%d] in the Host Auth Database; giving up.\n", 
-                                        newusername, pd.pw_uid);
-                               snprintf(buf, SIZ, 
-                                        "Can't find Realname for user %s [%d] in the Host Auth Database; giving up.\n",
-                                        newusername, pd.pw_uid);
-                               aide_message(buf, "User Creation Failure Notice");
-
+                               safestrncpy(username, pd.pw_name, sizeof username);
                        }
                }
                else {
                        return (ERROR + NO_SUCH_USER);
                }
        }
+
+       /* FIXME_LDAP put something here */
        
        if ((retval = internal_create_user(username, &usbuf, uid)) != 0)
                return retval;