[OGo-Users] accessing apache server variables in templates?

Adam Tauno Williams users@opengroupware.org
Thu, 15 Mar 2007 08:37:55 -0400


--=-fOSoVnZ6wmNPlbkJbGV8
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

> > On Mar 14, 2007, at 17:27, Sebastian Reitenbach wrote:
> > > is is possible to read the contents of apache server variables, =20
> > > like the client
> > > IP address, in the .wox or .html templates of ogo?
> > No, but you can forward Apache variables as HTTP headers which you =20
> > can then access, eg:
> >    RequestHeader set ssl_client_s_dn    %{SSL_CLIENT_S_DN}e
> I do not get the whole picture, from where do I forward these variables?

In the Apache configuration, I believe.  I assume this is what he is
talking about: http://httpd.apache.org/docs/2.0/mod/mod_headers.html

Very handy stuff.

> So I have to edit some obj code to make the values available in the webui=
?
> kind regards

I'm not a WO* expert by any means,  but I assume you would have to
trampoline this in code....

- (NSString *)myHeader {
  WORequest *request;
  request  =3D [ctx request];
  return [request headerForKey:@"myHeader"];
}

and then you could access myHeader in the template?

Again,  I'm just pulling this out of the air - could be completely
wrong.


--=-fOSoVnZ6wmNPlbkJbGV8
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBF+T4jLRePpNle04MRAgmwAJ9dquJwjwVsIRD+djkk1foW5+dligCfdFlt
+XsNCKyuEOrp9lLSM1vGIcs=
=rA9E
-----END PGP SIGNATURE-----

--=-fOSoVnZ6wmNPlbkJbGV8--