$Log$
+ Revision 614.4 2004/01/17 04:23:28 ajc
+ * Sysconfig commands for specifying where the LDAP server lives
+
Revision 614.3 2004/01/17 03:26:17 ajc
* Changed a diagnostic in msgbase.c to a higher logging level so it doesn't
make as much noise.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
* usually more strict because you're not really supposed to dump/load and
* upgrade at the same time.
*/
-#define REV_LEVEL 614 /* This version */
+#define REV_LEVEL 615 /* This version */
#define REV_MIN 591 /* Oldest compatible database */
-#define EXPORT_REV_MIN 614 /* Oldest compatible export files */
+#define EXPORT_REV_MIN 615 /* Oldest compatible export files */
#define SERVER_TYPE 0 /* zero for stock Citadel/UX; other developers please
obtain SERVER_TYPE codes for your implementations */
char c_aideroom[ROOMNAMELEN]; /* Name of aideroom (Aide) */
int c_purge_hour; /* Hour during which db purges run */
struct ExpirePolicy c_mbxep; /* Expire policy for mailbox rooms */
+ char c_ldap_host[128]; /* Host where LDAP service lives */
+ int c_ldap_port; /* Port on host where LDAP lives */
};
/*
case 11: ServInfo->serv_paging_level = atoi(buf);
break;
case 13: ServInfo->serv_supports_qnop = atoi(buf);
+ case 14: ServInfo->serv_supports_ldap = atoi(buf);
break;
}
}
cprintf("1\n"); /* 1 = we support the extended paging options */
cprintf("%s\n", CC->cs_nonce);
cprintf("1\n"); /* 1 = yes, this system supports the QNOP command */
+#ifdef HAVE_LDAP
+ cprintf("1\n"); /* 1 = yes, this server is LDAP-enabled */
+#else
+ cprintf("0\n"); /* 1 = no, this server is not LDAP-enabled */
+#endif
cprintf("000\n");
}
cprintf("%d\n", config.c_disable_newu);
cprintf("%d\n", config.c_aide_mailboxes);
cprintf("%d\n", config.c_purge_hour);
+#ifdef HAVE_LDAP
+ cprintf("%s\n", config.c_ldap_host);
+ cprintf("%d\n", config.c_ldap_port);
+#else
+ cprintf("\n");
+ cprintf("0\n");
+#endif
cprintf("000\n");
}
config.c_purge_hour = atoi(buf);
}
break;
+#ifdef HAVE_LDAP
+ case 32:
+ safestrncpy(config.c_ldap_host, buf,
+ sizeof config.c_ldap_host);
+ break;
+ case 33:
+ config.c_ldap_port = atoi(buf);
+ break;
+#endif
}
++a;
}
int serv_ok_floors;
int serv_paging_level;
int serv_supports_qnop;
+ int serv_supports_ldap;
};
#define QR_PERMANENT 1 /* Room does not purge */
*/
void do_system_configuration(CtdlIPC *ipc)
{
+
+#define NUM_CONFIGS 34
+
char buf[SIZ];
- char sc[32][SIZ];
+ char sc[NUM_CONFIGS][SIZ];
char *resp = NULL;
struct ExpirePolicy *site_expirepolicy = NULL;
struct ExpirePolicy *mbx_expirepolicy = NULL;
while (strlen(resp)) {
extract_token(buf, resp, 0, '\n');
remove_token(resp, 0, '\n');
- if (a < 32) {
+ if (a < NUM_CONFIGS) {
strcpy(&sc[a][0], buf);
}
++a;
a = (a ? 0 : 1);
snprintf(sc[25], sizeof sc[25], "%d", a);
+ /* LDAP settings */
+ if (serv_info.serv_supports_qnop) {
+ a = strlen(&sc[32][0]);
+ a = (a ? 1 : 0); /* Set only to 1 or 0 */
+ a = boolprompt("Connect this Citadel to an LDAP directory", a);
+ if (a) {
+ strprompt("Host name of LDAP server",
+ &sc[32][0], 127);
+ strprompt("Port number of LDAP service",
+ &sc[33][0], 5);
+ }
+ else {
+ strcpy(&sc[32][0], "");
+ }
+ }
+
/* Expiry settings */
strprompt("Default user purge time (days)", &sc[16][0], 5);
strprompt("Default room purge time (days)", &sc[17][0], 5);
scr_printf("Save this configuration? ");
if (yesno()) {
r = 1;
- for (a = 0; a < 32; a++)
+ for (a = 0; a < NUM_CONFIGS; a++)
r += 1 + strlen(sc[a]);
resp = (char *)calloc(1, r);
if (!resp) {
err_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
- for (a = 0; a < 32; a++) {
+ for (a = 0; a < NUM_CONFIGS; a++) {
strcat(resp, sc[a]);
strcat(resp, "\n");
}
config.c_purge_hour = 3;
}
+ if (CitControl.version < 615) {
+ config.c_ldap_port = 389;
+ }
+
put_config();
}
cprintf("%d\n", config.c_purge_hour);
cprintf("%d\n", config.c_mbxep.expire_mode);
cprintf("%d\n", config.c_mbxep.expire_value);
+ cprintf("%s\n", config.c_ldap_host);
+ cprintf("%d\n", config.c_ldap_port);
/* Export the control file */
get_control();
client_gets(buf); config.c_purge_hour = atoi(buf);
client_gets(buf); config.c_mbxep.expire_mode = atoi(buf);
client_gets(buf); config.c_mbxep.expire_value = atoi(buf);
+ client_gets(config.c_ldap_host);
+ client_gets(buf); config.c_ldap_port = atoi(buf);
put_config();
lprintf(7, "Imported config file\n");
}
authentication. If this field is present, clients may authenticate
in this manner.
Line 14 - Set to nonzero if this server supports the QNOP command.
+ Line 15 - Set to nonzero if this server is capable of connecting to a
+ directory service using LDAP.
*** NOTE! *** The "server type" code is intended to promote global
compatibility in a scenario in which developers have added proprietary
30. Flag (0 or 1) - disable self-service new user registration
31. Flag (0 or 1) - Aides are allowed access to all mailboxes
32. Hour (0 through 23) during which database auto-purge jobs are run
+ 33. Name of host where an LDAP service may be found
+ 34. Port number of LDAP service on above host
CONF also accepts two additional commands: GETSYS and PUTSYS followed by an
arbitrary MIME type (such as application/x-citadel-internet-config) which
provides a means of storing generic configuration data in the Global System
Configuration room without the need to add extra get/set commands to the
server.
+
+ Please note that the LDAP-specific configs have no effect on Citadel servers
+in which LDAP support is not enabled.