From 9f773d45076a667269ef270a3f1287c7257d9bef Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 2 Mar 2006 03:49:15 +0000 Subject: [PATCH] Don't offer to create new user accounts if the server disables it. --- citadel/citadel.c | 11 ++++++++--- citadel/citadel_ipc.c | 2 ++ citadel/citadel_ipc.h | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/citadel/citadel.c b/citadel/citadel.c index 8a7adc5ae..d7875992b 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -1303,11 +1303,16 @@ int main(int argc, char **argv) goto GSTA; NEWUSR: if (strlen(rc_password) == 0) { - scr_printf("'%s' not found.\n" - "Do you want to create a new account with this name? ", + scr_printf("'%s' not found.\n", fullname); + scr_printf("Type 'off' if you would like to exit.\n"); + if (ipc->ServInfo.newuser_disabled == 1) { + goto GSTA; + } + scr_printf("Do you want to create a new user account called '%s'? ", fullname); - if (yesno() == 0) + if (yesno() == 0) { goto GSTA; + } } r = CtdlIPCCreateUser(ipc, fullname, 1, aaa); diff --git a/citadel/citadel_ipc.c b/citadel/citadel_ipc.c index cee446ed9..840c4f2c6 100644 --- a/citadel/citadel_ipc.c +++ b/citadel/citadel_ipc.c @@ -668,6 +668,8 @@ int CtdlIPCServerInfo(CtdlIPC *ipc, char *cret) break; case 14: ipc->ServInfo.supports_ldap = atoi(buf); break; + case 15: ipc->ServInfo.newuser_disabled = atoi(buf); + break; } } diff --git a/citadel/citadel_ipc.h b/citadel/citadel_ipc.h index 1bd48dafb..d16689e20 100644 --- a/citadel/citadel_ipc.h +++ b/citadel/citadel_ipc.h @@ -46,6 +46,7 @@ struct CtdlServInfo { int paging_level; int supports_qnop; int supports_ldap; + int newuser_disabled; }; /* This class is responsible for the server connection */ -- 2.39.2