Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
[citadel.git] / citadel / user_ops.c
index e55807dd33196103c1537c27ed5670d9dbcaf4cf..270ca87dbe48590d1093f81e34cee0c5b226dec9 100644 (file)
@@ -567,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... */
@@ -743,7 +745,7 @@ void do_login(void)
        PerformSessionHooks(EVT_LOGIN);
 
        /* Enter the lobby */
-       CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL);
+       CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL, NULL, NULL);
 }
 
 
@@ -1291,7 +1293,7 @@ int CtdlForgetThisRoom(void) {
        CtdlPutUserLock(&CC->user);
 
        /* Return to the Lobby, so we don't end up in an undefined room */
-       CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL);
+       CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL, NULL, NULL);
        return(0);
 
 }