#endif
-#define MAXSETUP 6 /* How many setup questions to ask */
+#define MAXSETUP 11 /* How many setup questions to ask */
#define UI_TEXT 0 /* Default setup type -- text only */
#define UI_DIALOG 2 /* Use the 'dialog' program */
"Citadel User ID",
"Server IP address",
"Server port number",
- "Authentication mode"
+ "Authentication mode",
+ "LDAP host",
+ "LDAP port number",
+ "LDAP base DN",
+ "LDAP bind DN",
+ "LDAP bind password"
};
/**
"WARNING: do *not* change this setting once your system is installed.\n"
"\n"
"(Answer \"0\" unless you completely understand this option)\n"
-"Which authentication mode do you want to use?\n"
+"Which authentication mode do you want to use?\n",
+
+ "LDAP host FIXME\n",
+ "LDAP port number FIXME\n",
+ "LDAP base DN FIXME\n",
+ "LDAP bind DN FIXME\n",
+ "LDAP bind password FIXME\n"
};
}
break;
+ case 7:
+ if (setup_type == UI_SILENT)
+ {
+ if (getenv("LDAP_HOST")) {
+ strcpy(config.c_ldap_host, getenv("LDAP_HOST"));
+ }
+ }
+ else
+ {
+ set_str_val(curr, config.c_ldap_host);
+ }
+ break;
+
+ case 8:
+ if (setup_type == UI_SILENT)
+ {
+ if (getenv("LDAP_PORT")) {
+ config.c_ldap_port = atoi(getenv("LDAP_PORT"));
+ }
+ }
+ else
+ {
+ set_int_val(curr, &config.c_ldap_port);
+ }
+ break;
+
+ case 9:
+ if (setup_type == UI_SILENT)
+ {
+ if (getenv("LDAP_BASE_DN")) {
+ strcpy(config.c_ldap_base_dn, getenv("LDAP_BASE_DN"));
+ }
+ }
+ else
+ {
+ set_str_val(curr, config.c_ldap_base_dn);
+ }
+ break;
+
+ case 10:
+ if (setup_type == UI_SILENT)
+ {
+ if (getenv("LDAP_BIND_DN")) {
+ strcpy(config.c_ldap_bind_dn, getenv("LDAP_BIND_DN"));
+ }
+ }
+ else
+ {
+ set_str_val(curr, config.c_ldap_bind_dn);
+ }
+ break;
+
+ case 11:
+ if (setup_type == UI_SILENT)
+ {
+ if (getenv("LDAP_BIND_PW")) {
+ strcpy(config.c_ldap_bind_pw, getenv("LDAP_BIND_PW"));
+ }
+ }
+ else
+ {
+ set_str_val(curr, config.c_ldap_bind_pw);
+ }
+ break;
+
}
+
}
/*
/* Go through a series of dialogs prompting for config info */
for (curr = 1; curr <= MAXSETUP; ++curr) {
edit_value(curr);
+ if ((curr == 6) && (config.c_auth_mode != AUTHMODE_LDAP)) curr += 5; /* skip LDAP questions */
}
/***** begin version update section ***** */