version 1.2, 2004/05/07 21:34:26
|
version 1.4, 2005/04/07 06:56:20
|
Line 19
|
Line 19
|
</p> |
</p> |
|
|
<h3>Conf Changes</h3> |
<h3>Conf Changes</h3> |
<Location /adm/username> |
|
SetHandler perl-script |
|
PerlHandler Apache::username |
|
</Location> |
|
|
|
<LocationMatch "\.username$"> |
|
SetHandler perl-script |
<Location /adm/username><br /> |
PerlHandler Apache::username |
PerlAccessHandler Apache::lonacc<br /> |
</LocationMatch> |
SetHandler perl-script<br /> |
|
PerlHandler Apache::username<br /> |
|
</Location><br /> |
|
|
|
<LocationMatch "\.username$"><br /> |
|
SetHandler perl-script<br /> |
|
PerlHandler Apache::username<br /> |
|
</LocationMatch><br /> |
|
|
<h3>Example 1</h3> |
<h3>Example 1</h3> |
<pre> |
<pre> |
Line 55 sub handler {
|
Line 58 sub handler {
|
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
<i>$r->print("The username handler is in use by $ENV{'user.name'}");</i> |
<i>$r->print("The username handler is in use by $env{'user.name'}");</i> |
return OK; |
return OK; |
} |
} |
1; |
1; |
Line 72 sub handler {
|
Line 75 sub handler {
|
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
<i>$r->print("The username handler is in use by $ENV{'user.name'} looking for " |
<i>$r->print("The username handler is in use by $env{'user.name'} looking for " |
.$r->uri."<br>");</i> |
.$r->uri."<br>");</i> |
<b>my $file=&Apache::lonnet::filelocation("",$r->uri);</b> |
<b>my $file=&Apache::lonnet::filelocation("",$r->uri);</b> |
<b>my $contents=&Apache::lonnet::getfile($file);</b> |
<b>my $contents=&Apache::lonnet::getfile($file);</b> |
Line 93 sub handler {
|
Line 96 sub handler {
|
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
$r->print("The username handler is in use by $ENV{'user.name'} looking for " |
$r->print("The username handler is in use by $env{'user.name'} looking for " |
.$r->uri."<br>"); |
.$r->uri."<br>"); |
my $file=&Apache::lonnet::filelocation("",$r->uri); |
my $file=&Apache::lonnet::filelocation("",$r->uri); |
my $contents=&Apache::lonnet::getfile($file); |
my $contents=&Apache::lonnet::getfile($file); |
Line 115 sub handler {
|
Line 118 sub handler {
|
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
$r->print("The username handler is in use by $ENV{'user.name'} looking for " |
$r->print("The username handler is in use by $env{'user.name'} looking for " |
.$r->uri."<br>"); |
.$r->uri."<br>"); |
my $file=&Apache::lonnet::filelocation("",$r->uri); |
my $file=&Apache::lonnet::filelocation("",$r->uri); |
my $contents=&Apache::lonnet::getfile($file); |
my $contents=&Apache::lonnet::getfile($file); |
Line 128 sub handler {
|
Line 131 sub handler {
|
} else { |
} else { |
$r->print("<br>Last time you said $hash{'info'}"); |
$r->print("<br>Last time you said $hash{'info'}"); |
} |
} |
if ($ENV{'form.info'}) { |
if ($env{'form.info'}) { |
$r->print("<br>Now you say $ENV{'form.info'}"); |
$r->print("<br>Now you say $env{'form.info'}"); |
$hash{'info'}=$ENV{'form.info'}; |
$hash{'info'}=$env{'form.info'}; |
&Apache::lonnet::put('username',%hash); |
&Apache::lonnet::put('username',%hash); |
}</b> |
}</b> |
return OK; |
return OK; |