Eat the trailing space we added earlier
[mirror/userdir-ldap-cgi.git] / search.cgi
index ffbc654..2174d52 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: search.cgi,v 1.11 2004/11/18 19:17:00 joey Exp $
+# $Id: search.cgi,v 1.13 2006/06/27 04:37:45 rmurray Exp $
 # (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
 # (c) 2004 Martin Schulze. Licensed under the GPL. <joey@debian.org>
 
@@ -33,7 +33,7 @@ $SIG{__DIE__} = \&DieHandler;
 
 if (!$dosearch) {
   # No action yet, send back the search form...
-  print "Content-type: text/html\n\n";
+  print "Content-type: text/html; charset=utf-8\n\n";
   open (F, "<$config{websearchhtml}") || &Util::HTMLError($!);
   while (<F>) {
     s/~id~/$id/g;
@@ -72,8 +72,8 @@ if (!$dosearch) {
     }
   }
   
-  # Vacation is a special case
-  $filter .= "(onvacation=*)" if ($query->param('vacation'));
+  # Vacation is a special case, support it only when user is authenticated
+  $filter .= "(onvacation=*)" if ($query->param('vacation') && $authtoken && $id);
 
   # AND all the search terms together
   $filter = "(&$filter)";