/*
* Citadel setup utility
*
- * Copyright (c) 1987-2015 by the citadel.org team
+ * Copyright (c) 1987-2017 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.
};
int setup_type = (-1);
-int using_web_installer = 0;
int enable_home = 1;
char admin_name[SIZ];
char admin_pass[SIZ];
break;
case eUID:
-
+ ctdluid = getconf_int("c_ctdluid");
if (setup_type == UI_SILENT)
{
if (default_value) {
char aaa[128];
int relh = 0;
int home = 0;
- int nRetries = 0;
char relhome[PATH_MAX]="";
char ctdldir[PATH_MAX]=CTDLDIR;
struct passwd *pw;
/* set an invalid setup type */
setup_type = (-1);
- /* Check to see if we're running the web installer */
- if (getenv("CITADEL_INSTALLER") != NULL) {
- using_web_installer = 1;
- }
-
/* parse command line args */
for (a = 0; a < argc; ++a) {
if (!strncmp(argv[a], "-u", 2)) {
/*
* Connect to the running Citadel server.
*/
- while ((serv_sock < 0) && (nRetries < 10)) {
+ char *connectingmsg = _("Connecting to Citadel server");
+ for (i=0; ((i<30) && (serv_sock < 0)) ; ++i) { /* wait for server to start up */
+ progress(connectingmsg, i, 30);
serv_sock = uds_connectsock(file_citadel_admin_socket);
- nRetries ++;
- if (serv_sock < 0)
- sleep(1);
+ sleep(1);
}
+ progress(connectingmsg, 30, 30);
+
if (serv_sock < 0) {
display_error(
"%s: %s %s\n",
/*
* Create the administrator account. It's ok if the command fails if this user already exists.
*/
- progress(activity, 1, 5);
- snprintf(buf, sizeof buf, "CREU %s|%s", admin_name, admin_pass);
- serv_puts(buf);
- progress(activity, 2, 5);
- serv_gets(buf);
+ if (getconf_int("c_auth_mode") == AUTHMODE_NATIVE) {
+ progress(activity, 1, 5);
+ snprintf(buf, sizeof buf, "CREU %s|%s", admin_name, admin_pass);
+ serv_puts(buf);
+ progress(activity, 2, 5);
+ serv_gets(buf);
+ }
progress(activity, 3, 5);
/*
* Assign the desired password and access level to the administrator account.
*/
- snprintf(buf, sizeof buf, "AGUP %s", admin_name);
- serv_puts(buf);
- progress(activity, 4, 5);
- serv_gets(buf);
- if (buf[0] == '2') {
- int admin_flags = extract_int(&buf[4], 2);
- int admin_times_called = extract_int(&buf[4], 3);
- int admin_msgs_posted = extract_int(&buf[4], 4);
- snprintf(buf, sizeof buf, "ASUP %s|%s|%d|%d|%d|6",
- admin_name, admin_pass, admin_flags, admin_times_called, admin_msgs_posted
- );
+ if (getconf_int("c_auth_mode") == AUTHMODE_NATIVE) {
+ snprintf(buf, sizeof buf, "AGUP %s", admin_name);
serv_puts(buf);
+ progress(activity, 4, 5);
serv_gets(buf);
+ if (buf[0] == '2') {
+ int admin_flags = extract_int(&buf[4], 2);
+ int admin_times_called = extract_int(&buf[4], 3);
+ int admin_msgs_posted = extract_int(&buf[4], 4);
+ snprintf(buf, sizeof buf, "ASUP %s|%s|%d|%d|%d|6",
+ admin_name, admin_pass, admin_flags, admin_times_called, admin_msgs_posted
+ );
+ serv_puts(buf);
+ serv_gets(buf);
+ }
}
progress(activity, 5, 5);