]> code.citadel.org Git - citadel.git/blobdiff - citadel/server/modules/upgrade/serv_upgrade.c
Blockquotes are now rendered to console as dim instead of italic
[citadel.git] / citadel / server / modules / upgrade / serv_upgrade.c
index 2c662245f62a51d6bc3f9d4b722716c4212b15b5..4d9b176a6b331fdb8ffc84aba0c70df8c146b7c4 100644 (file)
 // We keep this value around for the entire duration of the program run because we'll need it during several stages of startup.
 int oldver = 0;
 
-// Try to remove any extra users with number 0
-void fix_sys_user_name(void) {
-       struct ctdluser usbuf;
-       char usernamekey[USERNAME_SIZE];
-
-       while (CtdlGetUserByNumber(&usbuf, 0) == 0) {
-               // delete user with number 0 and no name
-               if (IsEmptyStr(usbuf.fullname)) {
-                       cdb_delete(CDB_USERS, "", 0);
-               }
-               else {
-                       // temporarily set this user to -1
-                       usbuf.usernum = -1;
-                       CtdlPutUser(&usbuf);
-               }
-       }
-
-       // Delete any "user 0" accounts
-       while (CtdlGetUserByNumber(&usbuf, -1) == 0) {
-               makeuserkey(usernamekey, usbuf.fullname);
-               cdb_delete(CDB_USERS, usernamekey, strlen(usernamekey));
-       }
-}
-
-
-// These accounts may have been created by code that ran between mid 2008 and early 2011.
-// If present they are no longer in use and may be deleted.
-void remove_thread_users(void) {
-       char *deleteusers[] = {
-               "SYS_checkpoint",
-               "SYS_extnotify",
-               "SYS_IGnet Queue",
-               "SYS_indexer",
-               "SYS_network",
-               "SYS_popclient",
-               "SYS_purger",
-               "SYS_rssclient",
-               "SYS_select_on_master",
-               "SYS_SMTP Send"
-       };
-
-       int i;
-       struct ctdluser usbuf;
-       for (i=0; i<(sizeof(deleteusers)/sizeof(char *)); ++i) {
-               if (CtdlGetUser(&usbuf, deleteusers[i]) == 0) {
-                       usbuf.axlevel = 0;
-                       strcpy(usbuf.password, "deleteme");
-                       CtdlPutUser(&usbuf);
-                       syslog(LOG_INFO,
-                               "System user account <%s> is no longer in use and will be deleted.",
-                               deleteusers[i]
-                       );
-               }
-       }
-}
-
 
 // Attempt to guess the name of the time zone currently in use
 // on the underlying host system.
@@ -283,31 +227,12 @@ void ingest_old_roominfo_and_roompic_files(void) {
 // For new installations (oldver == 0) also set default values.
 void update_config(void) {
 
-       if (oldver < 606) {
+       if (oldver < 811) {
                CtdlSetConfigInt("c_rfc822_strict_from", 0);
-       }
-
-       if (oldver < 609) {
                CtdlSetConfigInt("c_purge_hour", 3);
-       }
-
-       if (oldver < 615) {
                CtdlSetConfigInt("c_ldap_port", 389);
-       }
-
-       if (oldver < 623) {
                CtdlSetConfigStr("c_ip_addr", "*");
-       }
-
-       if (oldver < 650) {
                CtdlSetConfigInt("c_enable_fulltext", 1);
-       }
-
-       if (oldver < 652) {
-               CtdlSetConfigInt("c_auto_cull", 1);
-       }
-
-       if (oldver < 725) {
                CtdlSetConfigInt("c_xmpp_c2s_port", 5222);
                CtdlSetConfigInt("c_xmpp_s2s_port", 5269);
        }
@@ -468,29 +393,16 @@ void pre_startup_upgrades(void) {
                return;
        }
 
-       if ((oldver > 000) && (oldver < 591)) {
+       // After 2026-may-06 we will do the following:
+       // 1. Set the oldest upgradable version to 902 (it will then be ten years old)
+       // 2. Remove support for upgrading from the legacy config and control file formats.
+
+       // Currently, the oldest upgradable version is 811, which was released on 2012-may-21
+
+       if ((oldver > 000) && (oldver < 811)) {
                syslog(LOG_EMERG, "This database is too old to be upgraded.  Citadel server will exit.");
                exit(EXIT_FAILURE);
        }
-       if ((oldver > 000) && (oldver < 659)) {
-               rebuild_euid_index();
-       }
-       if (oldver < 735) {
-               fix_sys_user_name();
-       }
-       if (oldver < 736) {
-               rebuild_usersbynumber();
-       }
-       if (oldver < 790) {
-               remove_thread_users();
-       }
-       if (oldver < 810) {
-               struct ctdlroom QRoom;
-               if (!CtdlGetRoom(&QRoom, SMTP_SPOOLOUT_ROOM)) {
-                       QRoom.QRdefaultview = VIEW_QUEUE;
-                       CtdlPutRoom(&QRoom);
-               }
-       }
        if ((oldver > 000) && (oldver < 902)) {
                ingest_old_roominfo_and_roompic_files();
        }