]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/upgrade/serv_upgrade.c
* Cleanup and tuning of previous commit
[citadel.git] / citadel / modules / upgrade / serv_upgrade.c
index c7a7b7220c03b7e1d4a05e9bd47c64f6082a4fc7..20497ded7e97eaa86ef0a91b88cb1334d1407834 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Transparently handle the upgrading of server data formats.
  *
- * Copyright (c) 1987-2009 by the citadel.org team
+ * Copyright (c) 1987-2010 by the citadel.org team
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -71,12 +71,12 @@ void fix_sys_user_name(void)
        char usernamekey[USERNAME_SIZE];
 
        /** If we have a user called Citadel rename them to SYS_Citadel */
-       if (getuser(&usbuf, "Citadel") == 0)
+       if (CtdlGetUser(&usbuf, "Citadel") == 0)
        {
                rename_user("Citadel", "SYS_Citadel");
        }
 
-       while (getuserbynumber(&usbuf, 0) == 0)
+       while (CtdlGetUserByNumber(&usbuf, 0) == 0)
        {
                /* delete user with number 0 and no name */
                if (IsEmptyStr(usbuf.fullname))
@@ -84,22 +84,24 @@ void fix_sys_user_name(void)
                else
                { /* temporarily set this user to -1 */
                        usbuf.usernum = -1;
-                       putuser(&usbuf);
+                       CtdlPutUser(&usbuf);
                }
        }
 
        /** Make sure user SYS_* is user 0 */
-       while (getuserbynumber(&usbuf, -1) == 0)
+       while (CtdlGetUserByNumber(&usbuf, -1) == 0)
        {
                if (strncmp(usbuf.fullname, "SYS_", 4))
                {       /** Delete any user 0 that doesn't start with SYS_ */
-                       makeuserkey(usernamekey, usbuf.fullname);
+                       makeuserkey(usernamekey, 
+                                   usbuf.fullname, 
+                                   cutuserkey(usbuf.fullname));
                        cdb_delete(CDB_USERS, usernamekey, strlen(usernamekey));
                }
                else
                {
                        usbuf.usernum = 0;
-                       putuser(&usbuf);
+                       CtdlPutUser(&usbuf);
                }
        }
 }
@@ -185,12 +187,12 @@ void cbtm_backend(struct ctdluser *usbuf, void *data) {
 
        while (uplist != NULL) {
 
-               if (lgetuser(&us, uplist->user) == 0) {
+               if (CtdlGetUserLock(&us, uplist->user) == 0) {
                        CtdlLogPrintf(CTDL_DEBUG, "Processing <%s>...\n", uplist->user);
                        if (us.uid == CTDLUID) {
                                us.uid = (-1);
                        }
-                       lputuser(&us);
+                       CtdlPutUserLock(&us);
                }
 
                ptr = uplist;
@@ -249,7 +251,7 @@ void update_config(void) {
        }
 
        if (CitControl.version < 623) {
-               strcpy(config.c_ip_addr, "0.0.0.0");
+               strcpy(config.c_ip_addr, "*");
        }
 
        if (CitControl.version < 650) {
@@ -265,17 +267,6 @@ void update_config(void) {
                config.c_xmpp_s2s_port = 5269;
        }
 
-       /* Erase LDAP config that might be left over from the old connector
-        * which served a different purpose.
-        */
-       if (CitControl.version < 760) {
-               strcpy(config.c_ldap_host, "");
-               config.c_ldap_port = 389;
-               strcpy(config.c_ldap_base_dn, "");
-               strcpy(config.c_ldap_bind_dn, "");
-               strcpy(config.c_ldap_bind_pw, "");
-       }
-
        if (IsEmptyStr(config.c_default_cal_zone)) {
                guess_time_zone();
        }