]> git.sur5r.net Git - contagged/blobdiff - entry.php
Store tags in Thunderbird custom fields
[contagged] / entry.php
index 19b1777367433b3cb25ae927e0d504f6235b90dd..b79bc69680ae49bc1ed2ad62b4e66b856eac25e5 100644 (file)
--- a/entry.php
+++ b/entry.php
@@ -173,6 +173,27 @@ print '</pre>';
         tpl_ldaperror("mod $key");
       }
     }
+
+    // special tag handling for Thunderbird
+    if($conf['tbtaghack'] && in_array('contactPerson',$OCLASSES)){
+        for($i=1;$i<5;$i++){
+            if(empty($entry["custom$i"])){
+                // deletion
+                unset($del);
+                $del["custom$i"]=array();
+                $r = @ldap_mod_replace($LDAP_CON,$dn,$del);
+                tpl_ldaperror("del custom$i");
+            }else{
+                // modification
+                unset($add);
+                $add["custom$i"]=$entry["custom$i"];
+                $r = @ldap_mod_replace($LDAP_CON,$dn,$add);
+                tpl_ldaperror("mod custom$i");
+            }
+        }
+    }
+
+
     return $dn;
   }
 }