--- doc/homework/worktime.html 2002/06/07 06:39:18 1.1 +++ doc/homework/worktime.html 2005/04/07 06:56:20 1.4 @@ -14,7 +14,25 @@ "username" appears it should be replaced by your specific username.

-

Example 1

+

+ Please add this to your /etc/httpd/conf/loncapa_apache.conf file +

+ +

Conf Changes

+ + +<Location /adm/username>
+PerlAccessHandler Apache::lonacc
+SetHandler perl-script
+PerlHandler Apache::username
+</Location>
+ +<LocationMatch "\.username$">
+SetHandler perl-script
+PerlHandler Apache::username
+</LocationMatch>
+ +

Example 1

 package Apache::username;
 use strict;
@@ -40,7 +58,7 @@ sub handler {
 	$r->content_type('text/html');
 	$r->send_http_header;
 	return OK if $r->header_only;
-	$r->print("The username handler is in use by $ENV{'user.name'}");
+	$r->print("The username handler is in use by $env{'user.name'}");
 	return OK;
 }
 1;
@@ -57,7 +75,7 @@ sub handler {
 	$r->content_type('text/html');
 	$r->send_http_header;
 	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>");
 	my $file=&Apache::lonnet::filelocation("",$r->uri);
 	my $contents=&Apache::lonnet::getfile($file);
@@ -78,7 +96,7 @@ sub handler {
 	$r->content_type('text/html');
 	$r->send_http_header;
 	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>");
 	my $file=&Apache::lonnet::filelocation("",$r->uri);
 	my $contents=&Apache::lonnet::getfile($file);
@@ -100,7 +118,7 @@ sub handler {
         $r->content_type('text/html');
         $r->send_http_header;
         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>");
         my $file=&Apache::lonnet::filelocation("",$r->uri);
         my $contents=&Apache::lonnet::getfile($file);
@@ -113,9 +131,9 @@ sub handler {
         } else {
                 $r->print("<br>Last time you said $hash{'info'}");
         }
-        if ($ENV{'form.info'}) {
-                $r->print("<br>Now you say $ENV{'form.info'}");
-                $hash{'info'}=$ENV{'form.info'};
+        if ($env{'form.info'}) {
+                $r->print("<br>Now you say $env{'form.info'}");
+                $hash{'info'}=$env{'form.info'};
                 &Apache::lonnet::put('username',%hash);
         }
         return OK;