]> git.sur5r.net Git - contagged/blobdiff - entry.php
Merge pull request #15 from cweiske/master
[contagged] / entry.php
index c14ff2d70dfaf7ab66169b63c80a1dd269902f4b..1e5e7552976de876ee184fccb105b3866df15614 100644 (file)
--- a/entry.php
+++ b/entry.php
@@ -71,7 +71,9 @@ if($_REQUEST['mode']=='vcf'){
   $filename = $entry['givenname'].'_'.$entry['name'].'.vcf';
   header("Content-Disposition: attachment; filename=\"$filename\"");
   header("Content-type: text/x-vcard; name=\"$filename\"; charset=utf-8");
-  $smarty->display($template);
+  $output = $smarty->fetch($template) . "\n";
+  $output = str_replace("\n", "\r\n", $output);
+  echo $output;
 }else{
   header('Content-Type: text/html; charset=utf-8');
   $smarty->display($template);
@@ -134,9 +136,9 @@ function _saveData(){
   $newdn   = 'uid='.$new_uid;
   if (empty($_REQUEST['type'])) { $_REQUEST['type']='public'; }
   if($_REQUEST['type'] == 'private' && $conf['privatebook']){
-    $newdn .= ', '.$conf['privatebook'].', '.$_SESSION['ldapab']['binddn'];
+    $newdn .= ','.$conf['privatebook'].','.$_SESSION['ldapab']['binddn'];
   }else{
-    $newdn .= ', '.$conf['publicbook'];
+    $newdn .= ','.$conf['publicbook'];
   }
   $entry['displayname'] = $entry['givenname'].' '.$entry['name'];;
   $entry = prepare_ldap_entry($entry);
@@ -150,7 +152,7 @@ print '</pre>';
   if(empty($dn)){
     //new entry
     $entry['uid'][] = $new_uid;
-    $r = ldap_add($LDAP_CON,$newdn,$entry);
+    $r = @ldap_add($LDAP_CON,$newdn,$entry);
     tpl_ldaperror();
     return $newdn;
   }else{