/*
* This module handles states which are global to the entire server.
*
- * Copyright (c) 1987-2014 by the citadel.org team
+ * Copyright (c) 1987-2015 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.
+ * 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.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*/
#include <stdio.h>
* index so it doesn't try to use it later.
*/
if (config.c_enable_fulltext == 0) {
- CitControl.fulltext_wordbreaker = 0;
+ CitControl.MM_fulltext_wordbreaker = 0;
put_control();
}
}
/*
* This module handles fulltext indexing of the message base.
- * Copyright (c) 2005-2011 by the citadel.org team
+ * Copyright (c) 2005-2015 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 as published
* Check to see whether the fulltext index is up to date; if there
* are no messages to index, don't waste any more time trying.
*/
- if ((CitControl.MMfulltext >= CitControl.MMhighest) && (CitControl.fulltext_wordbreaker == FT_WORDBREAKER_ID)) {
+ if ((CitControl.MMfulltext >= CitControl.MMhighest) && (CitControl.MM_fulltext_wordbreaker == FT_WORDBREAKER_ID)) {
return; /* nothing to do! */
}
* over.
*/
begin_critical_section(S_CONTROL);
- if (CitControl.fulltext_wordbreaker != FT_WORDBREAKER_ID) {
+ if (CitControl.MM_fulltext_wordbreaker != FT_WORDBREAKER_ID) {
syslog(LOG_DEBUG, "wb ver on disk = %d, code ver = %d",
- CitControl.fulltext_wordbreaker, FT_WORDBREAKER_ID
+ CitControl.MM_fulltext_wordbreaker, FT_WORDBREAKER_ID
);
syslog(LOG_INFO, "(re)initializing full text index");
cdb_trunc(CDB_FULLTEXT);
ft_flush_cache();
begin_critical_section(S_CONTROL);
CitControl.MMfulltext = ft_newhighest;
- CitControl.fulltext_wordbreaker = FT_WORDBREAKER_ID;
+ CitControl.MM_fulltext_wordbreaker = FT_WORDBREAKER_ID;
put_control();
end_critical_section(S_CONTROL);
last_index = time(NULL);
cprintf("<control_flags>%u</control_flags>\n", CitControl.MMflags);
cprintf("<control_nextuser>%ld</control_nextuser>\n", CitControl.MMnextuser);
cprintf("<control_nextroom>%ld</control_nextroom>\n", CitControl.MMnextroom);
- cprintf("<control_version>%d</control_version>\n", CitControl.version);
+ cprintf("<control_version>%d</control_version>\n", CitControl.MM_hosted_upgrade_level);
client_write("</control>\n", 11);
cprintf("<progress>%d</progress>\n", 2);
else if (!strcasecmp(el, "control_flags")) CitControl.MMflags = atoi(ChrPtr(migr_chardata));
else if (!strcasecmp(el, "control_nextuser")) CitControl.MMnextuser = atol(ChrPtr(migr_chardata));
else if (!strcasecmp(el, "control_nextroom")) CitControl.MMnextroom = atol(ChrPtr(migr_chardata));
- else if (!strcasecmp(el, "control_version")) CitControl.version = atoi(ChrPtr(migr_chardata));
+ else if (!strcasecmp(el, "control_version")) CitControl.MM_hosted_upgrade_level = atoi(ChrPtr(migr_chardata));
else if (!strcasecmp(el, "control")) {
CitControl.MMfulltext = (-1L); /* always flush */
/*
* Transparently handle the upgrading of server data formats.
*
- * Copyright (c) 1987-2014 by the citadel.org team
+ * Copyright (c) 1987-2015 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 update_config(void) {
get_config();
- if (CitControl.version < 606) {
+ if (CitControl.MM_hosted_upgrade_level < 606) {
config.c_rfc822_strict_from = 0;
}
- if (CitControl.version < 609) {
+ if (CitControl.MM_hosted_upgrade_level < 609) {
config.c_purge_hour = 3;
}
- if (CitControl.version < 615) {
+ if (CitControl.MM_hosted_upgrade_level < 615) {
config.c_ldap_port = 389;
}
- if (CitControl.version < 623) {
+ if (CitControl.MM_hosted_upgrade_level < 623) {
strcpy(config.c_ip_addr, "*");
}
- if (CitControl.version < 650) {
+ if (CitControl.MM_hosted_upgrade_level < 650) {
config.c_enable_fulltext = 1;
}
- if (CitControl.version < 652) {
+ if (CitControl.MM_hosted_upgrade_level < 652) {
config.c_auto_cull = 1;
}
- if (CitControl.version < 725) {
+ if (CitControl.MM_hosted_upgrade_level < 725) {
config.c_xmpp_c2s_port = 5222;
config.c_xmpp_s2s_port = 5269;
}
- if (CitControl.version < 830) {
+ if (CitControl.MM_hosted_upgrade_level < 830) {
config.c_nntp_port = 119;
config.c_nntps_port = 563;
}
get_control();
syslog(LOG_INFO, "Existing database version on disk is %d.%02d",
- (CitControl.version / 100),
- (CitControl.version % 100)
+ (CitControl.MM_hosted_upgrade_level / 100),
+ (CitControl.MM_hosted_upgrade_level % 100)
);
- if (CitControl.version < REV_LEVEL) {
+ if (CitControl.MM_hosted_upgrade_level < REV_LEVEL) {
syslog(LOG_WARNING,
"Server hosted updates need to be processed at this time. Please wait..."
);
update_config();
- if ((CitControl.version > 000) && (CitControl.version < 555)) {
+ if ((CitControl.MM_hosted_upgrade_level > 000) && (CitControl.MM_hosted_upgrade_level < 555)) {
syslog(LOG_EMERG, "This database is too old to be upgraded. Citadel server will exit.");
exit(EXIT_FAILURE);
}
- if ((CitControl.version > 000) && (CitControl.version < 591)) {
+ if ((CitControl.MM_hosted_upgrade_level > 000) && (CitControl.MM_hosted_upgrade_level < 591)) {
bump_mailbox_generation_numbers();
}
- if ((CitControl.version > 000) && (CitControl.version < 608)) {
+ if ((CitControl.MM_hosted_upgrade_level > 000) && (CitControl.MM_hosted_upgrade_level < 608)) {
convert_ctdluid_to_minusone();
}
- if ((CitControl.version > 000) && (CitControl.version < 659)) {
+ if ((CitControl.MM_hosted_upgrade_level > 000) && (CitControl.MM_hosted_upgrade_level < 659)) {
rebuild_euid_index();
}
- if (CitControl.version < 735) {
+ if (CitControl.MM_hosted_upgrade_level < 735) {
fix_sys_user_name();
}
- if (CitControl.version < 736) {
+ if (CitControl.MM_hosted_upgrade_level < 736) {
rebuild_usersbynumber();
}
- if (CitControl.version < 790) {
+ if (CitControl.MM_hosted_upgrade_level < 790) {
remove_thread_users();
}
- if (CitControl.version < 810) {
+ if (CitControl.MM_hosted_upgrade_level < 810) {
struct ctdlroom QRoom;
if (!CtdlGetRoom(&QRoom, SMTP_SPOOLOUT_ROOM)) {
QRoom.QRdefaultview = VIEW_QUEUE;
}
}
- CitControl.version = REV_LEVEL;
+ CitControl.MM_hosted_upgrade_level = REV_LEVEL;
/*
* Negative values for maxsessions are not allowed.
+/*
+ * Main declarations file for the Citadel server
+ *
+ * Copyright (c) 1987-2015 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
#ifndef SERVER_H
#define SERVER_H
unsigned MMflags; /* Global system flags */
long MMnextuser; /* highest user number on system */
long MMnextroom; /* highest room number on system */
- int version; /* Server-hosted upgrade level */
- int fulltext_wordbreaker; /* ID of wordbreaker in use */
+ int MM_hosted_upgrade_level; /* Server-hosted upgrade level */
+ int MM_fulltext_wordbreaker; /* ID of wordbreaker in use */
long MMfulltext; /* highest message number indexed */
int MMdbversion; /* Version of Berkeley DB used on previous server run */
};
CDB_EUIDINDEX, /* locate msgs by EUID */
CDB_USERSBYNUMBER, /* index of users by number */
CDB_OPENID, /* associates OpenIDs with users */
+ CDB_CONFIG, /* global system configuration */
MAXCDB /* total number of CDB's defined */
};