]> git.sur5r.net Git - contagged/blobdiff - entry.php
minor english lang file fix
[contagged] / entry.php
index e22452267af40da0d26eaf22ced382c8dec81c77..bb207ceb10e62d40a22faade43995ac6e9dfe9dd 100644 (file)
--- a/entry.php
+++ b/entry.php
@@ -2,6 +2,11 @@
 require_once('inc/init.php');
 ldap_login();
 
+if ($conf['userlogreq'] && $user == ''){
+  header('Location: login.php');
+  exit();
+}
+
 $users = get_users();
 
 //select template to use
@@ -11,6 +16,8 @@ if( $_SESSION['ldapab']['username'] &&
   $template='entry_edit.tpl';
 }elseif($_REQUEST['mode']=='vcf'){
   $template='entry_vcf.tpl';
+}elseif($_REQUEST['mode']=='map'){
+  $template='entry_map.tpl';
 }else{
   $template='entry_show.tpl';
 }
@@ -26,7 +33,8 @@ if (empty($_REQUEST['dn'])) {
 if($_SESSION['ldapab']['username'] && !empty($_REQUEST['save']) && $_REQUEST['save']){
   // prepare special data
   $_REQUEST['entry']['photo']  = _getUploadData();
-  $_REQUEST['entry']['marker'] = explode(',',$_REQUEST['entry']['markers']);
+  if($_REQUEST['entry']['markers'])
+    $_REQUEST['entry']['marker'] = explode(',',$_REQUEST['entry']['markers']);
   unset($_REQUEST['entry']['markers']);
 
   foreach(array_keys($_REQUEST['entry']) as $field){
@@ -170,6 +178,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;
   }
 }