#include "sysdep_decls.h"
#include "support.h"
#include "room_ops.h"
-#include "logging.h"
#include "file_ops.h"
#include "control.h"
#include "msgbase.h"
/* Enter the lobby */
usergoto(config.c_baseroom, 0, 0, NULL, NULL);
-
- /* Record this login in the Citadel log */
- rec_log(CL_LOGIN, CC->curr_user);
}
#ifdef ENABLE_AUTOLOGIN
- if (CC->usersupp.uid == BBSUID) {
+ /* A uid of BBSUID or -1 indicates that this user exists only in
+ * Citadel, not in the underlying operating system.
+ */
+ if ( (CC->usersupp.uid == BBSUID) || (CC->usersupp.uid == (-1)) ) {
strproc(password);
strproc(CC->usersupp.password);
code = strcasecmp(CC->usersupp.password, password);
}
+ /* Any other uid means we have to check the system password database */
else {
if (validpw(CC->usersupp.uid, password)) {
code = 0;
do_login();
return pass_ok;
} else {
- rec_log(CL_BADPW, CC->curr_user);
+ lprintf(3, "Bad password specified for <%s>\n", CC->curr_user);
return pass_wrong_password;
}
}
extract_token(username, p->pw_gecos, 0, ',');
uid = p->pw_uid;
} else {
- uid = BBSUID;
+ uid = (-1);
}
#else
- uid = BBSUID;
+ uid = (-1);
#endif
if (!getuser(&usbuf, username)) {
MailboxName(mailboxname, sizeof mailboxname, &usbuf, USERCONFIGROOM);
create_room(mailboxname, 5, "", 0, 1, 1);
- if (lgetroom(&qrbuf, USERCONFIGROOM) == 0) {
+ if (lgetroom(&qrbuf, mailboxname) == 0) {
qrbuf.QRflags2 |= QR2_SYSTEM;
lputroom(&qrbuf);
}
if (getuser(&CC->usersupp, CC->curr_user)) {
return (ERROR + INTERNAL_ERROR);
}
-
- rec_log(CL_NEWUSER, CC->curr_user);
}
+ lprintf(3, "New user <%s> created\n", username);
return (0);
}
} else {
cprintf("%d unknown error\n", ERROR);
}
- rec_log(CL_NEWUSER, CC->curr_user);
}
if (CtdlAccessCheck(ac_logged_in)) {
return;
}
-
- if (CC->usersupp.uid != BBSUID) {
+ if ( (CC->usersupp.uid != BBSUID) && (CC->usersupp.uid != (-1)) ) {
cprintf("%d Not allowed. Use the 'passwd' command.\n", ERROR);
return;
}
strcpy(CC->usersupp.password, new_pw);
lputuser(&CC->usersupp);
cprintf("%d Password changed.\n", CIT_OK);
- rec_log(CL_PWCHANGE, CC->curr_user);
+ lprintf(3, "Password changed for user <%s>\n", CC->curr_user);
PerformSessionHooks(EVT_SETPASS);
}
} else {
cprintf("%d An error occured creating the user account.\n", ERROR);
}
- rec_log(CL_NEWUSER, username);
}