2007-11-09 [colin] 3.0.2cvs129
authorColin Leroy <colin@colino.net>
Fri, 9 Nov 2007 16:59:46 +0000 (16:59 +0000)
committerColin Leroy <colin@colino.net>
Fri, 9 Nov 2007 16:59:46 +0000 (16:59 +0000)
* src/addressbook.c
* src/ldapupdate.c
fix bug 1375, 'Impossible to modify e-mail
                in LDAP addressbook twice'; Try two. update
externalID, don't make display lag, and
fix the cases where dn is not mail.

ChangeLog
PATCHSETS
configure.ac
src/addressbook.c
src/ldapupdate.c

index bdb3a6a052675a06afc215305bef78acf898ea47..af7efdde7c122f8e957b4a598e918912a37b4007 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-11-09 [colin]     3.0.2cvs129
+
+       * src/addressbook.c
+       * src/ldapupdate.c
+               fix bug 1375, 'Impossible to modify e-mail
+                in LDAP addressbook twice'; Try two. update
+               externalID, don't make display lag, and
+               fix the cases where dn is not mail.
+
 2007-11-08 [paul]      3.0.2cvs128
 
        * src/account.c
index 49ad3d02acaf05e53a35141cc0a76551a2d243ab..d7c8d79b09354c4fb5b385ecb73307371044c0d0 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.43.2.93 -r 1.43.2.94 src/toolbar.c;  ) > 3.0.2cvs126.patchset
 ( cvs diff -u -r 1.96.2.191 -r 1.96.2.192 src/textview.c;  ) > 3.0.2cvs127.patchset
 ( cvs diff -u -r 1.61.2.75 -r 1.61.2.76 src/account.c;  cvs diff -u -r 1.382.2.419 -r 1.382.2.420 src/compose.c;  cvs diff -u -r 1.94.2.162 -r 1.94.2.163 src/messageview.c;  cvs diff -u -r 1.105.2.115 -r 1.105.2.116 src/prefs_account.c;  cvs diff -u -r 1.49.2.34 -r 1.49.2.35 src/prefs_account.h;  ) > 3.0.2cvs128.patchset
+( cvs diff -u -r 1.60.2.104 -r 1.60.2.105 src/addressbook.c;  cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/ldapupdate.c;  ) > 3.0.2cvs129.patchset
index b1ebd35518dd4cefe32faa4df9cebaec856fd6fe..e86fb11f74747c84fff3f7ac21fdd3cad52cdad7 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=128
+EXTRA_VERSION=129
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 07275e1d14c90368ea4a3b122a44847826a454e1..f308bcc386ebd0772e180f148f9c893ee9f8f943 100644 (file)
@@ -3199,7 +3199,10 @@ static void addressbook_move_nodes_up( GtkCTree *ctree, GtkCTreeNode *node ) {
 static void addressbook_edit_address_post_cb( ItemPerson *person )
 {
        if( person ) {
-
+#ifdef USE_LDAP
+               if (strcmp2(person->nickName, ADDRITEM_NAME(person)))
+                       addritem_person_set_nick_name( person, ADDRITEM_NAME(person));
+#endif
                addressbook_folder_refresh_one_person( GTK_CTREE(addrbook.clist), person );
                invalidate_address_completion();
        }
index 5769942a51685265aeac2753b5be4c3ebb3f4d67..73f8082f41beca4aaa068dc4b97e916aa521243d 100644 (file)
@@ -195,6 +195,7 @@ gboolean ldapsvr_retrieve_item_person(ItemPerson *person, GHashTable *array) {
        g_hash_table_insert(array, "sn", person->lastName);
        g_hash_table_insert(array, "nickName", person->nickName);
        g_hash_table_insert(array, "dn", person->externalID);
+       g_hash_table_insert(array, "person", person);
        node = person->listEMail;
        attr = NULL;
        while (node) {
@@ -423,7 +424,7 @@ void rdn_free(Rdn *rdn) {
  */
 void update_rdn(Rdn *rdn, gchar *head, gchar *tail) {
        rdn->value = g_strdup(head);
-       rdn->new_dn = g_strdup_printf("mail=%s%s", head, tail);
+       rdn->new_dn = g_strdup_printf("%s=%s%s", rdn->attribute, head, tail);
 }
 
 /**
@@ -1150,6 +1151,7 @@ void ldapsvr_update_contact(LdapServer *server, GHashTable *contact) {
                return;
        }
        dn = g_hash_table_lookup(contact, "dn");
+
        if (dn == NULL) {
                clean_up(ld, server, contact);
                return;
@@ -1179,9 +1181,14 @@ void ldapsvr_update_contact(LdapServer *server, GHashTable *contact) {
                        }
                }
                else {
+                       ItemPerson *person = g_hash_table_lookup(contact, "person");
                        g_free(newRdn);
                        dn = g_strdup(NoRemove->new_dn);
                        g_hash_table_replace(contact, "dn", dn);
+                       if (person) {
+                               g_free(person->externalID);
+                               person->externalID = dn;
+                       }
                }
        }
        else {