cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sonney <ke...@webslingerz.com>
Subject LDAP Processor Modification
Date Wed, 03 May 2000 15:23:44 GMT
So I'm hacking happily away at a site that needs LDAP, XSP and SQL - in
that order. The problem is, I need some HTTP Request info to process the
LDAP query. 

No problem, right? Just use XSP. Can't - I need XSP *AFTER* LDAP in order
to complete the SQL Query. Whic sets the stage for this hack :

What this patch does is it *FIRST* tries to get the requested string out
of the Request Parameters. If the name isn't found there, we then check to
see if it's an request for the REMOTE_USER, and send that. Finally, we
check the rest of the Header for the variable. I'm sure I could add a
couple of other special cases, but don't have a need for them. yet. *grin*

This should also be considered a work-around until someone can hack out
an LDAP TagLib (hey, that someone could be me, but I'm not that motivated
yet *grin*).

Here's the diff :

------------ Begin Diff - Cut Here ------------
--- LdapQueryCreator.java	Wed May  3 11:12:26 2000
+++ LdapQueryCreator.java.kes	Wed May  3 11:12:07 2000
@@ -82,7 +82,14 @@
 				int rindex = query.indexOf(rdelim,offset+llength);
 				if (rindex < 0 || rindex < lindex) break;
 				String name = query.substring(lindex+llength,rindex);
-				String value = req.getParameter(name);
+            String value = req.getParameter(name);
+            if (value == null)  { 
+               if (name.equalsIgnoreCase("remote_user")) {
+                  value = req.getRemoteUser();
+               } else {
+                  value = req.getHeader(name);
+               }
+            }
 				if (value == null) break;
 				query = query.substring(0,lindex)+value+query.substring(rindex+rlength);
 				offset = lindex+value.length();
------------- End Diff - Cut Here -------------


-- 
- Kevin Sonney
  kevin@webslingerZ.com


Mime
View raw message