Annotation of loncom/auth/lonacc.pm, revision 1.87
1.1 albertel 1: # The LearningOnline Network
2: # Cookie Based Access Handler
1.22 www 3: #
1.87 ! albertel 4: # $Id: lonacc.pm,v 1.86 2006/07/14 21:38:26 albertel Exp $
1.22 www 5: #
6: # Copyright Michigan State University Board of Trustees
7: #
8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9: #
10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
14: #
15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
1.25 harris41 28: ###
1.1 albertel 29:
30: package Apache::lonacc;
31:
32: use strict;
1.8 www 33: use Apache::Constants qw(:common :http :methods);
1.2 www 34: use Apache::File;
1.6 www 35: use Apache::lonnet;
1.25 harris41 36: use Apache::loncommon();
1.47 www 37: use Apache::lonlocal;
1.86 albertel 38: use Apache::restrictedaccess();
1.1 albertel 39: use CGI::Cookie();
1.16 www 40: use Fcntl qw(:flock);
1.85 raeburn 41: use LONCAPA;
1.1 albertel 42:
1.75 albertel 43: sub cleanup {
44: my ($r)=@_;
45: if (! $r->is_initial_req()) { return DECLINED; }
46: &Apache::lonnet::save_cache();
47: return OK;
48: }
49:
50: sub goodbye {
51: my ($r)=@_;
52: &Apache::lonnet::goodbye();
53: return DONE;
54: }
55:
1.76 albertel 56: ###############################################
57:
58: sub get_posted_cgi {
59: my ($r) = @_;
60:
61: my $buffer;
62: if ($r->header_in('Content-length')) {
63: $r->read($buffer,$r->header_in('Content-length'),0);
64: }
65: unless ($buffer=~/^(\-+\w+)\s+Content\-Disposition\:\s*form\-data/si) {
66: my @pairs=split(/&/,$buffer);
67: my $pair;
68: foreach $pair (@pairs) {
69: my ($name,$value) = split(/=/,$pair);
70: $value =~ tr/+/ /;
71: $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
72: $name =~ tr/+/ /;
73: $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
1.77 albertel 74: &Apache::loncommon::add_to_env("form.$name",$value);
1.76 albertel 75: }
76: } else {
77: my $contentsep=$1;
78: my @lines = split (/\n/,$buffer);
79: my $name='';
80: my $value='';
81: my $fname='';
82: my $fmime='';
83: my $i;
84: for ($i=0;$i<=$#lines;$i++) {
85: if ($lines[$i]=~/^$contentsep/) {
86: if ($name) {
87: chomp($value);
88: if ($fname) {
89: $env{"form.$name.filename"}=$fname;
90: $env{"form.$name.mimetype"}=$fmime;
91: } else {
92: $value=~s/\s+$//s;
93: }
1.77 albertel 94: &Apache::loncommon::add_to_env("form.$name",$value);
1.76 albertel 95: }
96: if ($i<$#lines) {
97: $i++;
98: $lines[$i]=~
99: /Content\-Disposition\:\s*form\-data\;\s*name\=\"([^\"]+)\"/i;
100: $name=$1;
101: $value='';
102: if ($lines[$i]=~/filename\=\"([^\"]+)\"/i) {
103: $fname=$1;
104: if
105: ($lines[$i+1]=~/Content\-Type\:\s*([\w\-\/]+)/i) {
106: $fmime=$1;
107: $i++;
108: } else {
109: $fmime='';
110: }
111: } else {
112: $fname='';
113: $fmime='';
114: }
115: $i++;
116: }
117: } else {
118: $value.=$lines[$i]."\n";
119: }
120: }
121: }
122: #
123: # Digested POSTed values
124: #
125: # Remember the way this was originally done (GET or POST)
126: #
127: $env{'request.method'}=$ENV{'REQUEST_METHOD'};
128: #
129: # There may also be stuff in the query string
130: # Tell subsequent handlers that this was GET, not POST, so they can access query string.
131: # Also, unset POSTed content length to cover all tracks.
132: #
133:
134: $r->method_number(M_GET);
135:
136: $r->method('GET');
137: $r->headers_in->unset('Content-length');
138: }
139:
1.79 raeburn 140: sub portfolio_access {
1.87 ! albertel 141: my ($r,$requrl) = @_;
! 142: my (undef,$udom,$unum,$file_name,$group) = &parse_portfolio_url($requrl);
! 143: my $result = &get_portfolio_access($udom,$unum,$file_name,$group);
! 144: if ($result eq 'ok') {
! 145: return OK;
! 146: } elsif ($result =~ /^[^:]+:guest_/) {
! 147: &passphrase_access_checker($r,$result,$requrl);
! 148: return OK;
! 149: }
! 150: return FORBIDDEN;
! 151: }
! 152:
! 153: sub get_portfolio_access {
1.79 raeburn 154: my ($udom,$unum,$file_name,$group) = @_;
1.87 ! albertel 155:
1.79 raeburn 156: my $current_perms = &Apache::lonnet::get_portfile_permissions($udom,$unum);
157: my %access_controls = &Apache::lonnet::get_access_controls(
158: $current_perms,$group,$file_name);
1.81 raeburn 159: my ($public,$guest,@domains,@users,@courses,@groups);
1.79 raeburn 160: my $now = time;
161: my $access_hash = $access_controls{$file_name};
162: if (ref($access_hash) eq 'HASH') {
163: foreach my $key (keys(%{$access_hash})) {
164: my ($num,$scope,$end,$start) = ($key =~ /^([^:]+):([a-z]+)_(\d*)_?(\d*)$/);
165: if ($start > $now) {
166: next;
167: }
168: if ($end && $end<$now) {
169: next;
170: }
171: if ($scope eq 'public') {
172: $public = $key;
173: last;
1.81 raeburn 174: } elsif ($scope eq 'guest') {
175: $guest = $key;
176: } elsif ($scope eq 'domains') {
177: push(@domains,$key);
178: } elsif ($scope eq 'users') {
179: push(@users,$key);
180: } elsif ($scope eq 'course') {
181: push(@courses,$key);
182: } elsif ($scope eq 'group') {
183: push(@groups,$key);
1.79 raeburn 184: }
185: }
186: if ($public) {
187: return 'ok';
188: }
1.81 raeburn 189: if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') {
190: if ($guest) {
1.85 raeburn 191: return $guest;
1.81 raeburn 192: }
193: } else {
194: if (@domains > 0) {
195: foreach my $domkey (@domains) {
196: my %content = &Apache::lonnet::parse_access_controls($$access_hash{$domkey});
197: if (ref($content{'dom'}) eq 'ARRAY') {
198: if (grep(/^\Q$env{'user.domain'}\E$/,@{$content{'dom'}})) {
199: return 'ok';
200: }
201: }
202: }
203: }
204: if (@users > 0) {
205: foreach my $userkey (@users) {
206: my %content = &Apache::lonnet::parse_access_controls($$access_hash{$userkey});
207: if (exists($content{'users'}{$env{'user.name'}.':'.$env{'user.domain'}})) {
208: return 'ok';
209: }
210: }
211: }
212: my %roleshash;
213: my @courses_and_groups = @courses;
214: push(@courses_and_groups,@groups);
215: if (@courses_and_groups > 0) {
216: my (%allgroups,%allroles);
217: my ($start,$end,$role,$sec,$group);
218: foreach my $envkey (%env) {
219: if ($envkey =~ m-^user\.role\.(gr|cc|in|ta|ep|st)\./([^/]+)/([^/]+)/?([^/]*)$-) {
220: my $cid = $2.'_'.$3;
221: if ($1 eq 'gr') {
222: $group = $4;
223: $allgroups{$cid}{$group} = $env{$envkey};
224: } else {
225: if ($4 eq '') {
226: $sec = 'none';
227: } else {
228: $sec = $4;
229: }
230: $allroles{$cid}{$1}{$sec} = $env{$envkey};
231: }
232: } elsif ($envkey =~ m-^user\.role\./cr/(\w+/\w+/\w*)./([^/]+)/([^/]+)/?([^/]*)$-) {
233: my $cid = $2.'_'.$3;
234: if ($4 eq '') {
235: $sec = 'none';
236: } else {
237: $sec = $4;
238: }
239: $allroles{$cid}{$1}{$sec} = $env{$envkey};
240: }
241: }
242: if (keys(%allroles) == 0) {
243: return;
244: }
245: foreach my $key (@courses_and_groups) {
246: my %content = &Apache::lonnet::parse_access_controls($$access_hash{$key});
247: my $cnum = $content{'number'};
248: my $cdom = $content{'domain'};
249: my $cid = $cdom.'_'.$cnum;
250: if (!exists($allroles{$cid})) {
251: next;
252: }
253: foreach my $role_id (keys(%{$content{'roles'}})) {
254: my @sections = @{$content{'roles'}{$role_id}{'section'}};
255: my @groups = @{$content{'roles'}{$role_id}{'group'}};
256: my @status = @{$content{'roles'}{$role_id}{'access'}};
257: my @roles = @{$content{'roles'}{$role_id}{'role'}};
258: foreach my $role (keys(%{$allroles{$cid}})) {
259: if ((grep/^all$/,@roles) || (grep/^\Q$role\E$/,@roles)) {
260: foreach my $sec (keys(%{$allroles{$cid}{$role}})) {
261: if (&course_group_datechecker($allroles{$cid}{$role}{$sec},$now,\@status) eq 'ok') {
262: if (grep/^all$/,@sections) {
263: return 'ok';
264: } else {
265: if (grep/^$sec$/,@sections) {
1.85 raeburn 266: return 'ok';
1.81 raeburn 267: }
268: }
269: }
270: }
271: if (keys(%{$allgroups{$cid}}) == 0) {
272: if (grep/^none$/,@groups) {
273: return 'ok';
274: }
275: } else {
276: if (grep/^all$/,@groups) {
277: return 'ok';
278: }
279: foreach my $group (keys(%{$allgroups{$cid}})) {
280: if (grep/^$group$/,@groups) {
281: return 'ok';
282: }
283: }
284: }
285: }
286: }
287: }
288: }
289: }
290: if ($guest) {
1.85 raeburn 291: return $guest;
1.81 raeburn 292: }
293: }
1.79 raeburn 294: }
295: return;
296: }
1.76 albertel 297:
1.85 raeburn 298: sub passphrase_access_checker {
299: my ($r,$guestkey,$requrl) = @_;
300: my ($num,$scope,$end,$start) = ($guestkey =~ /^([^:]+):([a-z]+)_(\d*)_?(\d*)$/);
301: if ($scope eq 'guest') {
302: if (exists($env{'user.passphrase_access_'.$requrl})) {
303: if (($env{'user.passphrase_access_'.$requrl} == 0) ||
304: ($env{'user.passphrase_access_'.$requrl} > time)) {
305: $env{'request.publicaccess'} = 1;
306: return 'ok';
307: }
308: }
309: }
1.86 albertel 310: $r->set_handlers('PerlHandler'=> \&Apache::restrictedaccess::handler);
311: $r->content_type('perl-script');
1.85 raeburn 312: return;
313: }
314:
1.81 raeburn 315: sub course_group_datechecker {
316: my ($dates,$now,$status) = @_;
317: my ($start,$end) = split(/\./,$dates);
318: if (!$start && !$end) {
319: return 'ok';
320: }
321: if (grep/^active$/,@{$status}) {
322: if (((!$start) || ($start && $start <= $now)) && ((!$end) || ($end && $end >= $now))) {
323: return 'ok';
324: }
325: }
326: if (grep/^previous$/,@{$status}) {
327: if ($end > $now ) {
328: return 'ok';
329: }
330: }
331: if (grep/^future$/,@{$status}) {
332: if ($start > $now) {
333: return 'ok';
334: }
335: }
336: return;
337: }
338:
1.87 ! albertel 339: sub parse_portfolio_url {
! 340: my ($url) = @_;
! 341:
! 342: my ($type,$udom,$unum,$group,$file_name);
! 343:
! 344: if ($url =~ m-/+uploaded/([^/]+)/([^/]+)/portfolio(/.+)$-) {
! 345: $type = 1;
! 346: $udom = $1;
! 347: $unum = $2;
! 348: $file_name = $3;
! 349: } elsif ($url =~ m-/+uploaded/([^/]+)/([^/]+)/groups/([^/]+)/portfolio/(.+)$-) {
! 350: $type = 2;
! 351: $udom = $1;
! 352: $unum = $2;
! 353: $group = $3;
! 354: $file_name = $3.'/'.$4;
! 355: }
! 356: if (wantarray) {
! 357: return ($type,$udom,$unum,$file_name,$group);
! 358: }
! 359: return $type;
! 360: }
! 361:
! 362: sub is_portfolio_url {
! 363: my ($url) = @_;
! 364: return scalar(&parse_portfolio_url($url));
! 365: }
! 366:
1.1 albertel 367: sub handler {
368: my $r = shift;
369: my $requrl=$r->uri;
370: my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));
371: my $lonid=$cookies{'lonID'};
372: my $cookie;
1.70 albertel 373: my $lonidsdir=$r->dir_config('lonIDsDir');
374:
375: my $handle;
1.1 albertel 376: if ($lonid) {
1.70 albertel 377: $handle=$lonid->value;
1.1 albertel 378: $handle=~s/\W//g;
1.70 albertel 379: }
380:
1.78 albertel 381: my ($sso_login);
1.70 albertel 382: if ($r->user
383: && (!$lonid || !-e "$lonidsdir/$handle.id" || $handle eq '') ) {
1.78 albertel 384: $sso_login = 1;
1.70 albertel 385: my $domain = $r->dir_config('lonDefDomain');
386: my $home=&Apache::lonnet::homeserver($r->user,$domain);
387: if ($home !~ /(con_lost|no_such_host)/) {
388: $handle=&Apache::lonauth::success($r,$r->user,$domain,
389: $home,'noredirect');
390: $r->header_out('Set-cookie',"lonID=$handle; path=/");
391: }
392: }
393:
1.78 albertel 394: if ($sso_login) {
395: &Apache::lonnet::appenv('request.sso.login' => 1);
396: }
397:
1.70 albertel 398: if ($r->dir_config("lonBalancer") eq 'yes') {
399: $r->set_handlers('PerlResponseHandler'=>
400: [\&Apache::switchserver::handler]);
401: }
402:
403: if ($handle ne '') {
1.1 albertel 404: if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) {
1.6 www 405:
1.46 www 406: # ------------------------------------------------------ Initialize Environment
407:
408: &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle);
1.47 www 409:
410: # --------------------------------------------------------- Initialize Language
411:
1.48 www 412: &Apache::lonlocal::get_language_handle($r);
1.46 www 413:
414: # -------------------------------------------------------------- Resource State
1.6 www 415:
1.51 albertel 416: if ($requrl=~/^\/+(res|uploaded)\//) {
1.64 albertel 417: $env{'request.state'} = "published";
1.17 www 418: } else {
1.64 albertel 419: $env{'request.state'} = 'unknown';
1.17 www 420: }
1.64 albertel 421: $env{'request.filename'} = $r->filename;
422: $env{'request.noversionuri'} = &Apache::lonnet::deversion($requrl);
1.6 www 423: # -------------------------------------------------------- Load POST parameters
424:
1.76 albertel 425: &Apache::lonacc::get_posted_cgi($r);
1.6 www 426:
427: # ---------------------------------------------------------------- Check access
1.79 raeburn 428: my $now = time;
1.87 ! albertel 429: if (&is_portfolio_url($requrl)) {
! 430: return &portfolio_access($r,$requrl);
! 431: }
1.37 albertel 432: if ($requrl!~/^\/adm|public|prtspool\//) {
1.7 www 433: my $access=&Apache::lonnet::allowed('bre',$requrl);
434: if ($access eq '1') {
1.64 albertel 435: $env{'user.error.msg'}="$requrl:bre:0:0:Choose Course";
1.7 www 436: return HTTP_NOT_ACCEPTABLE;
437: }
438: if (($access ne '2') && ($access ne 'F')) {
1.64 albertel 439: $env{'user.error.msg'}="$requrl:bre:1:1:Access Denied";
1.7 www 440: return HTTP_NOT_ACCEPTABLE;
441: }
1.23 www 442: }
1.37 albertel 443: if ($requrl =~ m|^/prtspool/|) {
1.64 albertel 444: my $start='/prtspool/'.$env{'user.name'}.'_'.
445: $env{'user.domain'};
1.37 albertel 446: if ($requrl !~ /^\Q$start\E/) {
1.64 albertel 447: $env{'user.error.msg'}="$requrl:bre:1:1:Access Denied";
1.37 albertel 448: return HTTP_NOT_ACCEPTABLE;
449: }
450: }
1.67 albertel 451: if ($env{'user.name'} eq 'public' &&
452: $env{'user.domain'} eq 'public' &&
453: $requrl !~ m{^/+(res|public)/} &&
1.69 www 454: $requrl !~ m{^/+adm/(help|logout|randomlabel\.png)}) {
1.67 albertel 455: $env{'request.querystring'}=$r->args;
456: $env{'request.firsturl'}=$requrl;
457: return FORBIDDEN;
458: }
1.23 www 459: # ------------------------------------------------------------- This is allowed
1.64 albertel 460: if ($env{'request.course.id'}) {
1.24 www 461: &Apache::lonnet::countacc($requrl);
1.23 www 462: $requrl=~/\.(\w+)$/;
1.39 www 463: if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') ||
1.84 raeburn 464: ($requrl=~/^\/adm\/.*\/(aboutme|navmaps|smppg|bulletinboard)(\?|$)/) ||
1.44 www 465: ($requrl=~/^\/adm\/wrapper\//) ||
1.72 albertel 466: ($requrl=~m|^/adm/coursedocs/showdoc/|) ||
1.53 albertel 467: ($requrl=~m|\.problem/smpedit$|) ||
1.39 www 468: ($requrl=~/^\/public\/.*\/syllabus$/)) {
1.23 www 469: # ------------------------------------- This is serious stuff, get symb and log
1.29 www 470: my $query=$r->args;
471: my $symb;
472: if ($query) {
473: &Apache::loncommon::get_unprocessed_cgi($query,['symb']);
474: }
1.64 albertel 475: if ($env{'form.symb'}) {
476: $symb=&Apache::lonnet::symbclean($env{'form.symb'});
1.72 albertel 477: if ($requrl =~ m|^/adm/wrapper/|
478: || $requrl =~ m|^/adm/coursedocs/showdoc/|) {
1.52 raeburn 479: my ($map,$mid,$murl)=&Apache::lonnet::decode_symb($symb);
1.63 albertel 480: &Apache::lonnet::symblist($map,$murl => [$murl,$mid],
481: 'last_known' =>[$murl,$mid]);
1.53 albertel 482: } elsif ((&Apache::lonnet::symbverify($symb,$requrl)) ||
483: (($requrl=~m|(.*)/smpedit$|) &&
484: &Apache::lonnet::symbverify($symb,$1))) {
1.50 albertel 485: my ($map,$mid,$murl)=&Apache::lonnet::decode_symb($symb);
1.74 albertel 486: &Apache::lonnet::symblist($map,$murl => [$murl,$mid],
1.63 albertel 487: 'last_known' =>[$murl,$mid]);
1.31 www 488: } else {
489: $r->log_reason('Invalid symb for '.$requrl.': '.
490: $symb);
1.64 albertel 491: $env{'user.error.msg'}=
1.31 www 492: "$requrl:bre:1:1:Invalid Access";
493: return HTTP_NOT_ACCEPTABLE;
494: }
1.29 www 495: } else {
1.44 www 496: $symb=&Apache::lonnet::symbread($requrl);
1.58 albertel 497: if (&Apache::lonnet::is_on_map($requrl) && $symb &&
1.56 albertel 498: !&Apache::lonnet::symbverify($symb,$requrl)) {
1.58 albertel 499: $r->log_reason('Invalid symb for '.$requrl.': '.$symb);
1.64 albertel 500: $env{'user.error.msg'}=
1.55 albertel 501: "$requrl:bre:1:1:Invalid Access";
502: return HTTP_NOT_ACCEPTABLE;
503: }
1.61 albertel 504: if ($symb) {
1.65 albertel 505: my ($map,$mid,$murl)=
506: &Apache::lonnet::decode_symb($symb);
1.63 albertel 507: &Apache::lonnet::symblist($map,$murl =>[$murl,$mid],
508: 'last_known' =>[$murl,$mid]);
1.61 albertel 509: }
1.29 www 510: }
1.64 albertel 511: $env{'request.symb'}=$symb;
1.23 www 512: &Apache::lonnet::courseacclog($symb);
513: } else {
514: # ------------------------------------------------------- This is other content
515: &Apache::lonnet::courseacclog($requrl);
516: }
517: }
1.2 www 518: return OK;
1.1 albertel 519: } else {
1.73 raeburn 520: $r->log_reason("Cookie $handle not valid", $r->filename);
521: }
1.1 albertel 522: }
1.6 www 523:
1.21 www 524: # -------------------------------------------- See if this is a public resource
1.37 albertel 525: if ($requrl=~m|^/public/|
526: || (&Apache::lonnet::metadata($requrl,'copyright') eq 'public')) {
1.21 www 527: &Apache::lonnet::logthis('Granting public access: '.$requrl);
1.71 www 528: &Apache::lonlocal::get_language_handle($r);
1.66 albertel 529: my $cookie=
530: &Apache::lonauth::success($r,'public','public','public');
531: my $lonidsdir=$r->dir_config('lonIDsDir');
532: &Apache::lonnet::transfer_profile_to_env($lonidsdir,$cookie);
1.76 albertel 533: &Apache::lonacc::get_posted_cgi($r);
1.64 albertel 534: $env{'request.state'} = "published";
535: $env{'request.publicaccess'} = 1;
536: $env{'request.filename'} = $r->filename;
1.59 albertel 537:
1.66 albertel 538: $r->header_out('Set-cookie',"lonID=$cookie; path=/");
1.21 www 539: return OK;
540: }
1.68 albertel 541: if ($requrl=~m|^/+adm/+help/+|) {
542: return OK;
543: }
1.79 raeburn 544: # ------------------------------------- See if this is a viewable portfolio file
1.87 ! albertel 545: if (&is_portfolio_url($requrl)) {
! 546: return &portfolio_access($r,$requrl);
1.79 raeburn 547: }
1.87 ! albertel 548:
1.34 www 549: # -------------------------------------------------------------- Not authorized
550: $requrl=~/\.(\w+)$/;
1.62 albertel 551: # if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') ||
552: # ($requrl=~/^\/adm\/(roles|logout|email|menu|remote)/) ||
553: # ($requrl=~m|^/prtspool/|)) {
1.34 www 554: # -------------------------- Store where they wanted to go and get login screen
1.64 albertel 555: $env{'request.querystring'}=$r->args;
556: $env{'request.firsturl'}=$requrl;
1.34 www 557: return FORBIDDEN;
1.62 albertel 558: # } else {
1.34 www 559: # --------------------------------------------------------------------- Goodbye
1.62 albertel 560: # return HTTP_BAD_REQUEST;
561: # }
1.1 albertel 562: }
563:
564: 1;
565: __END__
1.25 harris41 566:
567: =head1 NAME
568:
569: Apache::lonacc - Cookie Based Access Handler
570:
571: =head1 SYNOPSIS
572:
573: Invoked (for various locations) by /etc/httpd/conf/srm.conf:
574:
575: PerlAccessHandler Apache::lonacc
576:
577: =head1 INTRODUCTION
578:
579: This module enables cookie based authentication and is used
580: to control access for many different LON-CAPA URIs.
581:
582: Whenever the client sends the cookie back to the server,
583: this cookie is handled by either lonacc.pm or loncacc.pm
584: (see srm.conf for what is invoked when). If
585: the cookie is missing or invalid, the user is re-challenged
586: for login information.
587:
588: This is part of the LearningOnline Network with CAPA project
589: described at http://www.lon-capa.org.
590:
591: =head1 HANDLER SUBROUTINE
592:
593: This routine is called by Apache and mod_perl.
594:
595: =over 4
596:
597: =item *
598:
599: transfer profile into environment
600:
601: =item *
602:
603: load POST parameters
604:
605: =item *
606:
607: check access
608:
609: =item *
610:
611: if allowed, get symb, log, generate course statistics if applicable
612:
613: =item *
614:
615: otherwise return error
616:
617: =item *
618:
619: see if public resource
620:
621: =item *
622:
623: store attempted access
624:
625: =back
626:
627: =cut
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>