config migration endless typing meow
[citadel.git] / citadel / modules / upgrade / serv_upgrade.c
index 1ce073f78b911b8572e42f8de8504ec40265537c..7cd9c10b5e5e34336081b5cee83563e6104c3f7f 100644 (file)
@@ -245,8 +245,8 @@ void guess_time_zone(void) {
        if (fp) {
                if (fgets(buf, sizeof buf, fp) && (strlen(buf) > 2)) {
                        buf[strlen(buf)-1] = 0;
-                       safestrncpy(config.c_default_cal_zone, buf, sizeof config.c_default_cal_zone);
-                       syslog(LOG_INFO, "Configuring timezone: %s", config.c_default_cal_zone);
+                       CtdlSetConfigStr("c_default_cal_zone", buf);
+                       syslog(LOG_INFO, "Configuring timezone: %s", buf);
                }
                fclose(fp);
        }
@@ -260,38 +260,39 @@ void guess_time_zone(void) {
  * Note that if the previous version was 0 then this is a new installation running for the first time.
  */
 void update_config(void) {
-       get_config();
 
-       if (CitControl.MM_hosted_upgrade_level < 606) {
+       oldver = CitControl.MM_hosted_upgrade_level;
+
+       if (oldver < 606) {
                config.c_rfc822_strict_from = 0;
        }
 
-       if (CitControl.MM_hosted_upgrade_level < 609) {
+       if (oldver < 609) {
                config.c_purge_hour = 3;
        }
 
-       if (CitControl.MM_hosted_upgrade_level < 615) {
+       if (oldver < 615) {
                config.c_ldap_port = 389;
        }
 
-       if (CitControl.MM_hosted_upgrade_level < 623) {
+       if (oldver < 623) {
                strcpy(config.c_ip_addr, "*");
        }
 
-       if (CitControl.MM_hosted_upgrade_level < 650) {
+       if (oldver < 650) {
                config.c_enable_fulltext = 1;
        }
 
-       if (CitControl.MM_hosted_upgrade_level < 652) {
+       if (oldver < 652) {
                config.c_auto_cull = 1;
        }
 
-       if (CitControl.MM_hosted_upgrade_level < 725) {
+       if (oldver < 725) {
                config.c_xmpp_c2s_port = 5222;
                config.c_xmpp_s2s_port = 5269;
        }
 
-       if (CitControl.MM_hosted_upgrade_level < 830) {
+       if (oldver < 830) {
                config.c_nntp_port = 119;
                config.c_nntps_port = 563;
        }
@@ -299,8 +300,6 @@ void update_config(void) {
        if (IsEmptyStr(config.c_default_cal_zone)) {
                guess_time_zone();
        }
-
-       put_config();
 }