]> code.citadel.org Git - citadel.git/blobdiff - citadel/user_ops.c
Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
[citadel.git] / citadel / user_ops.c
index 71c0af3d3ecf4f6683bdc21d640d2c2c5e95861d..c79e87abd04dd40c86e3e23a3c61297aa1ef7bb5 100644 (file)
  */
 
 #include "sysdep.h"
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
 #include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <pwd.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <syslog.h>
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
-#include <string.h>
-#include <limits.h>
 #include <libcitadel.h>
-#include "auth.h"
-#include "citadel.h"
-#include "server.h"
-#include "database.h"
-#include "sysdep_decls.h"
-#include "support.h"
-#include "room_ops.h"
+
 #include "control.h"
-#include "msgbase.h"
-#include "config.h"
+#include "support.h"
 #include "citserver.h"
-#include "citadel_dirs.h"
-#include "genstamp.h"
-#include "threads.h"
 #include "citadel_ldap.h"
-#include "context.h"
 #include "ctdl_module.h"
 #include "user_ops.h"
 #include "internet_addressing.h"
@@ -605,10 +567,12 @@ int CtdlLoginExistingUser(char *authname, const char *trythisname)
 
        /* If a "master user" is defined, handle its authentication if specified */
        CC->is_master = 0;
-       if (strlen(config.c_master_user) > 0) if (strlen(config.c_master_pass) > 0) if (authname) {
-               if (!strcasecmp(authname, config.c_master_user)) {
-                       CC->is_master = 1;
-               }
+       if ((configlen.c_master_user > 0) && 
+           (configlen.c_master_pass > 0) &&
+           (authname != NULL) &&
+           (!strcasecmp(authname, config.c_master_user)))
+       {
+               CC->is_master = 1;
        }
 
        /* Continue attempting user validation... */
@@ -691,7 +655,7 @@ int CtdlLoginExistingUser(char *authname, const char *trythisname)
        else {
                /* native auth mode */
 
-               struct recptypes *valid = NULL;
+               recptypes *valid = NULL;
        
                /* First, try to log in as if the supplied name is a display name */
                found_user = CtdlGetUser(&CC->user, username);