CtdlSetConfigInt( "c_managesieve_port" , lconfig->c_managesieve_port );
CtdlSetConfigInt( "c_auth_mode" , lconfig->c_auth_mode );
CtdlSetConfigInt( "c_rbl_at_greeting" , lconfig->c_rbl_at_greeting );
- CtdlSetConfigStr( "c_master_user" , lconfig->c_master_user );
- CtdlSetConfigStr( "c_master_pass" , lconfig->c_master_pass );
CtdlSetConfigStr( "c_pager_program" , lconfig->c_pager_program );
CtdlSetConfigInt( "c_imap_keep_from" , lconfig->c_imap_keep_from );
CtdlSetConfigInt( "c_xmpp_c2s_port" , lconfig->c_xmpp_c2s_port );
int internal_pgm; /* authenticated as internal program */
int nologin; /* not allowed to log in */
int curr_view; /* The view type for the current user/room */
- int is_master; /* Is this session logged in using the master user? */
time_t previous_login; /* Date/time of previous login */
char lastcmdname[5]; /* name of last command executed */
cprintf("\n");
cprintf("\n");
cprintf("%d\n", CtdlGetConfigInt("c_rbl_at_greeting"));
- cprintf("%s\n", CtdlGetConfigStr("c_master_user"));
- cprintf("%s\n", CtdlGetConfigStr("c_master_pass"));
+ cprintf("\n");
+ cprintf("\n");
cprintf("%s\n", CtdlGetConfigStr("c_pager_program"));
cprintf("%d\n", CtdlGetConfigInt("c_imap_keep_from"));
cprintf("%d\n", CtdlGetConfigInt("c_xmpp_c2s_port"));
CtdlSetConfigInt("c_rbl_at_greeting", confbool(buf));
break;
case 58:
- CtdlSetConfigStr("c_master_user", buf);
+ /* niu */
break;
case 59:
- CtdlSetConfigStr("c_master_pass", buf);
+ /* niu */
break;
case 60:
CtdlSetConfigStr("c_pager_program", buf);
void CtdlGetRelationship(visit *vbuf, struct ctdluser *rel_user, struct ctdlroom *rel_room);
void CtdlSetRelationship(visit *newvisit, struct ctdluser *rel_user, struct ctdlroom *rel_room);
void CtdlMailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix);
-int CtdlLoginExistingUser(char *authname, const char *username);
+int CtdlLoginExistingUser(const char *username);
/*
* Values which may be returned by CtdlLoginExistingUser()
/*
* Server functions which perform operations on user objects.
*
- * Copyright (c) 1987-2017 by the citadel.org team
+ * Copyright (c) 1987-2018 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License, version 3.
striplt(username);
syslog(LOG_DEBUG, "user_ops: cmd_user(%s)", username);
- a = CtdlLoginExistingUser(NULL, username);
+ a = CtdlLoginExistingUser(username);
switch (a) {
case login_already_logged_in:
cprintf("%d Already logged in.\n", ERROR + ALREADY_LOGGED_IN);
cprintf("%d Not allowed. Use the 'passwd' command.\n", ERROR + NOT_HERE);
return;
}
- if (CC->is_master) {
- cprintf("%d The master prefix password cannot be changed with this command.\n",
- ERROR + NOT_HERE);
- return;
- }
if (!strcasecmp(new_pw, "GENERATE_RANDOM_PASSWORD")) {
char random_password[17];
/*
* IMAP server for the Citadel system
*
- * Copyright (C) 2000-2017 by Art Cancro and others.
+ * Copyright (C) 2000-2018 by Art Cancro and others.
* This code is released under the terms of the GNU General Public License.
*
* WARNING: the IMAP protocol is badly designed. No implementation of it
return;
}
case 4:
- if (CtdlLoginExistingUser(NULL, Params[2].Key) == login_ok) {
+ if (CtdlLoginExistingUser(Params[2].Key) == login_ok) {
if (CtdlTryPassword(Params[3].Key, Params[3].len) == pass_ok) {
/* hm, thats not doable by IReply :-( */
IAPrintf("%s OK [", Params[0].Key);
Imap->authstate = imap_as_normal;
if (!IsEmptyStr(ident)) {
- result = CtdlLoginExistingUser(user, ident);
+ result = CtdlLoginExistingUser(ident);
}
else {
- result = CtdlLoginExistingUser(NULL, user);
+ result = CtdlLoginExistingUser(user);
}
if (result == login_ok) {
switch (state){
case imap_as_expecting_username:
StrBufDecodeBase64(Imap->Cmd.CmdBuf);
- CtdlLoginExistingUser(NULL, ChrPtr(Imap->Cmd.CmdBuf));
+ CtdlLoginExistingUser(ChrPtr(Imap->Cmd.CmdBuf));
size_t len = CtdlEncodeBase64(PWBuf, "Password:", 9, 0);
if (PWBuf[len - 1] == '\n') {
PWBuf[len - 1] = '\0';
return;
case imap_as_expecting_multilineusername:
extract_token(PWBuf, ChrPtr(Imap->Cmd.CmdBuf), 1, ' ', sizeof(PWBuf));
- CtdlLoginExistingUser(NULL, ChrPtr(Imap->Cmd.CmdBuf));
+ CtdlLoginExistingUser(ChrPtr(Imap->Cmd.CmdBuf));
IAPuts("+ go ahead\r\n");
Imap->authstate = imap_as_expecting_multilinepassword;
return;
* as this draft expires with this writing, you might need to search for
* the new one.
*
- * Copyright (c) 2007-2015 by the citadel.org team
+ * Copyright (c) 2007-2018 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
if ((*username == '\0') && (*(username + 1) != '\0'))
username ++;
- if (login_ok == CtdlLoginExistingUser(NULL, username))
+ if (login_ok == CtdlLoginExistingUser(username))
{
char *pass;
//
// NNTP server module (RFC 3977)
//
-// Copyright (c) 2014-2015 by the citadel.org team
+// Copyright (c) 2014-2018 by the citadel.org team
//
// This program is open source software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 3.
//
void nntp_authinfo_user(const char *username)
{
- int a = CtdlLoginExistingUser(NULL, username);
+ int a = CtdlLoginExistingUser(username);
switch (a) {
case login_already_logged_in:
cprintf("482 Already logged in\r\n");
/*
* POP3 service for the Citadel system
*
- * Copyright (c) 1998-2017 by the citadel.org team
+ * Copyright (c) 1998-2018 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
strcpy(username, argbuf);
striplt(username);
- if (CtdlLoginExistingUser(NULL, username) == login_ok) {
+ if (CtdlLoginExistingUser(username) == login_ok) {
cprintf("+OK Password required for %s\r\n", username);
}
else {
StrBufDecodeBase64(sSMTP->Cmd);
- if (CtdlLoginExistingUser(NULL, ChrPtr(sSMTP->Cmd)) == login_ok) {
+ if (CtdlLoginExistingUser(ChrPtr(sSMTP->Cmd)) == login_ok) {
size_t len = CtdlEncodeBase64(buf, "Password:", 9, 0);
if (buf[len - 1] == '\n') {
sSMTP->command_state = smtp_command;
if (!IsEmptyStr(ident)) {
- result = CtdlLoginExistingUser(user, ident);
+ result = CtdlLoginExistingUser(ident);
}
else {
- result = CtdlLoginExistingUser(NULL, user);
+ result = CtdlLoginExistingUser(user);
}
if (result == login_ok) {
*
* Note: RFC3920 says we "must" support DIGEST-MD5 but we only support PLAIN.
*
- * Copyright (c) 2007-2009 by Art Cancro
+ * Copyright (c) 2007-2018 by Art Cancro
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
char pass[256];
int result;
long len;
-
+ int i;
/* Take apart the authentication string */
memset(pass, 0, sizeof(pass));
* do not allow spaces so we can tell the user to substitute underscores if their
* login name contains spaces.
*/
- convert_spaces_to_underscores(ident);
- convert_spaces_to_underscores(user);
+ for (i=0; ident[i]!=0; ++i) {
+ if (ident[i] == '_') {
+ ident[i] = ' ';
+ }
+ }
+ for (i=0; user[i]!=0; ++i) {
+ if (user[i] == '_') {
+ user[i] = ' ';
+ }
+ }
/* Now attempt authentication */
if (!IsEmptyStr(ident)) {
- result = CtdlLoginExistingUser(user, ident);
+ result = CtdlLoginExistingUser(ident);
}
else {
- result = CtdlLoginExistingUser(NULL, user);
+ result = CtdlLoginExistingUser(user);
}
if (result == login_ok) {
if (CC->logged_in) CtdlUserLogout(); /* Client may try to log in twice. Handle this. */
- result = CtdlLoginExistingUser(NULL, username);
+ result = CtdlLoginExistingUser(username);
if (result == login_ok) {
result = CtdlTryPassword(password, strlen(password));
if (result == pass_ok) {
/*
* Back end for cmd_user() and its ilk
- *
- * NOTE: "authname" should only be used if we are attempting to use the "master user" feature
*/
-int CtdlLoginExistingUser(char *authname, const char *trythisname)
+int CtdlLoginExistingUser(const char *trythisname)
{
char username[SIZ];
int found_user;
- syslog(LOG_DEBUG, "user_ops: CtdlLoginExistingUser(%s, %s)", authname, trythisname);
+ syslog(LOG_DEBUG, "user_ops: CtdlLoginExistingUser(%s)", trythisname);
if ((CC->logged_in)) {
return login_already_logged_in;
return login_not_found;
}
- /* If a "master user" is defined, handle its authentication if specified */
- CC->is_master = 0;
- if ( (!IsEmptyStr(CtdlGetConfigStr("c_master_user"))) &&
- (!IsEmptyStr(CtdlGetConfigStr("c_master_pass"))) &&
- (authname != NULL) &&
- (!strcasecmp(authname, CtdlGetConfigStr("c_master_user"))) )
- {
- CC->is_master = 1;
- }
-
/* Continue attempting user validation... */
safestrncpy(username, trythisname, sizeof (username));
striplt(username);
/* Clear out the user record in memory so we don't behave like a ghost */
memset(&CCC->user, 0, sizeof(struct ctdluser));
CCC->curr_user[0] = 0;
- CCC->is_master = 0;
CCC->cs_inet_email[0] = 0;
CCC->cs_inet_other_emails[0] = 0;
CCC->cs_inet_fn[0] = 0;
return pass_wrong_password;
}
- if (CCC->is_master) {
- code = strcmp(password, CtdlGetConfigStr("c_master_pass"));
- }
-
else if (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_HOST) {
/* host auth mode */
sc[60][0] = 0;
}
- /* Master user account */
- int yes_muacct = 0;
- if (strlen(sc[58]) > 0)
- yes_muacct = 1;
- yes_muacct = boolprompt("Enable a 'master user' account", yes_muacct);
- if (yes_muacct) {
- strprompt("Master user name", &sc[58][0], 31);
- strprompt("Master user password", &sc[59][0], -31);
- } else {
- strcpy(&sc[58][0], "");
- strcpy(&sc[59][0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
- }
-
/* Save it */
scr_printf("Save this configuration? ");
if (yesno()) {
<tr><td><?_("Allow anonymous guest access")></td><td>
<input type="checkbox" NAME="c_guest_logins" VALUE="yes" <?%("COND:SERVCFG", 1, "c_guest_logins", 1, "CHECKED", "")>></td></tr>
-<tr><td><?_("Master user name (blank to disable)")></td><td>
-<input type="text" NAME="c_master_user" MAXLENGTH="31" VALUE='<?SERV:CFG("c_master_user")>'></td></tr>
-
-<tr><td><?_("Master user password")></td><td>
-<input type="password" NAME="c_master_pass" MAXLENGTH="31" VALUE='<?SERV:CFG("c_master_pass")>'></td></tr>
-<tr><td colspan=2><hr></td></tr>
-
-
<tr><td><?_("Initial access level for new users")></td><td>
<select name="c_initax" size="1">
<option <?%("COND:SERVCFG", 1, "c_initax", 0, 'selected="selected"', "")> value="0">0 - <?_("Deleted")></option>