$smarty->assign('lang',$lang);
$smarty->assign('fields',$FIELDS);
$smarty->assign('lettertabs',explode(' ',$lang['lettertabs']));
+
+ if(isset($FIELDS['country'])){
+ include dirname(__FILE__).'/iso3166.php';
+ $smarty->assign('iso3166',$iso3166);
+ }
}
/**
$out['dn'] = normalize_dn($out['dn']);
$conf['publicbook'] = normalize_dn($conf['publicbook']);
if($out['dn']){
- if(strstr($out['dn'],$conf['publicbook'])){
+ if(stristr($out['dn'],$conf['publicbook'])){
$out['type'] = 'public';
}else{
$out['type'] = 'private';
// join marker field to markers
if(is_array($out['marker'])) $out['markers'] = join(', ',$out['marker']);
+ $out['qrcode'] = tpl_qrcode($out);
+
/*
print '<pre>';
print_r($out);
$smarty->assign('entry',$out);
}
+function tpl_qrcode($in){
+ $data = "BEGIN:VCARD\n";
+ $data .= "N:{$in['name']};{$in['givenname']}\n";
+ if($in['mobile']) $data .= "TEL;CELL:{$in['mobile']}\n";
+ if($in['phone']) $data .= "TEL;WORK:{$in['phone']}\n";
+ if($in['homephone']) $data .= "TEL;HOME:{$in['homephone']}\n";
+ if($in['mail'][0]) $data .= "EMAIL:{$in['mail'][0]}\n";
+ $data .= "END:VCARD";
+ $data = rawurlencode($data);
+
+ return 'http://chart.apis.google.com/chart?cht=qr&chld=L|5&chs=500x500&chl='.$data.'&.png';
+}
+
+
/**
* assigns the last LDAP error to the template
*/