Verify confirmed hmac in web display, showing status as either 'confirmed'
[mirror/userdir-ldap-cgi.git] / search.cgi
index 96d8135..e3eb882 100755 (executable)
@@ -84,6 +84,7 @@ if (!$dosearch) {
 
   # Now, we are ready to connect to the LDAP server.
   $ldap = Net::LDAP->new($config{ldaphost}) || &Util::HTMLError($!);
+  &Util::UpgradeConnection($ldap) unless $config{usessl} eq 'False';
   my $auth = 0;
   my $mesg;
 
@@ -117,6 +118,9 @@ if (!$dosearch) {
   foreach $dn (sort {$entries->{$a}->{sn}->[0] <=> $entries->{$b}->{sn}->[0]} keys(%$entries)) {
     my $ok = 0;
     $data = $entries->{$dn};
+    for my $key (keys %{$data}) {
+      @{$data->{$key}} = map { CGI::escapeHTML($_); } @{$data->{$key}};
+    }
 
     # These are local variables.. i have enough global vars as it is... <sigh>
     my ($ufdn, $login, $name, $icquin, $jabberjid, $email, $fingerprint,
@@ -222,7 +226,7 @@ if (!$dosearch) {
       $outsub{searchresults} .= FormatEntry($dataspecref->{latlong}, $latlong);
       $outsub{searchresults} .= FormatEntry($dataspecref->{phone}, $data->{telephonenumber}->[0] || "- unlisted -");
       $outsub{searchresults} .= FormatEntry($dataspecref->{fax}, $data->{fascimiletelephonenumber}->[0] || "- unlisted -");
-      $outsub{searchresults} .= FormatEntry($dataspecref->{VoIP}, $data->{VoIP}->[0] || "- unlisted -");
+      $outsub{searchresults} .= FormatEntry($dataspecref->{VoIP}, $data->{voip}->[0] || "- unlisted -");
       $outsub{searchresults} .= FormatEntry($dataspecref->{lastseen}, $lastseen);
 #     $outsub{searchresults} .= FormatEntry($dataspecref->{created}, $created);
 #     $outsub{searchresults} .= FormatEntry($dataspecref->{modified}, $modified);