Subject: [LON-CAPA-dev] Apache handler question

From: Mark Lucas <[email-masked]>
Date: Wed, 2 Oct 2002 14:18:54 -0400 (EDT)

I'm working with a new handler, but this handler is going to be accessible
without authentication (is that allowed?).

This handler, lonloginhelp.pm, will provide a 'wizard' of sorts for 
debugging access issues, and thus should be accesible without 
authentication.

I created a handler that will give a default page, resubmit to itself
and give an action (via a hidden variable), and complain if the action is
not valid.

When I use the following configuration entry:

<Location /adm/loginhelp>
PerlAccessHandler       Apache::lonacc
SetHandler perl-script
PerlHandler Apache::lonloginhelp
ErrorDocument     500 /adm/errorhandler
</Location>

Everything works fine, but obviously I need authentication.

I pull out the PerlAccessHandler line (which I thought did 
authentication), and now I also lose the form information. The handler 
runs, but I never get the action passed.

Any suggestions from the experts?

 - is there a DIFFERENT access handler that I need? Or need to write?
   is the lack of a handler ripping off the form information or somehow
   affecting the call to     
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});   ?

				Thanks!!!!!
				    Mark

----------------------------------------------------------------------------
Mark Lucas					email: [email-masked]
252D Clippinger Lab  				phone: (740)597-2984
Department of Physics and Astronomy             fax:   (740)593-0433
Ohio University
Athens, OH 45701

---

From: Guy Albertelli <[email-masked]>
Date: Wed, 02 Oct 2002 16:03:38 -0400 (EDT)

> without authentication (is that allowed?).

Sure.

> authentication), 

It does multiple things

- Checks the Cookie
- loads the seeson envirnoment
- Checks if the user has access
- and is allowed to view it
- logs access
- fires up the login page if needed

And

- parses POST parameters into the $ENV{'form.*'} variables

> Any suggestions from the experts?

Modify lonacc, move lines 90 - 149 on lonacc.pm into loncommon.pm

Call it something like 'parse_post_form'

Have lonacc.pm call it, and add a call to it in your handler or

>  - is there a DIFFERENT access handler that I need? Or need to write?

make a simple access hangled that only calls to above new function

> &Apache::loncoommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});   ?

get_unprocessed_cgi

only handles parameters posted in the URL

I.E.
http://machine.com/adm/handler?myvalue=true&myothervalue=false

And it only will pull in calues that it is told to,

I.E, with the above URL and a call to 
&Apache::loncoommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['myvalue']);

Will set $ENV{'form.myvalue'} but ignore the myothervalue

-- 
Guy Albertelli
[email-masked]