Annotation of loncom/auth/lonacc.pm, revision 1.86
1.1 albertel 1: # The LearningOnline Network
2: # Cookie Based Access Handler
1.22 www 3: #
1.86 ! albertel 4: # $Id: lonacc.pm,v 1.85 2006/07/10 03:58:45 raeburn 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 {
141: my ($udom,$unum,$file_name,$group) = @_;
142: my $current_perms = &Apache::lonnet::get_portfile_permissions($udom,$unum);
143: my %access_controls = &Apache::lonnet::get_access_controls(
144: $current_perms,$group,$file_name);
1.81 raeburn 145: my ($public,$guest,@domains,@users,@courses,@groups);
1.79 raeburn 146: my $now = time;
147: my $access_hash = $access_controls{$file_name};
148: if (ref($access_hash) eq 'HASH') {
149: foreach my $key (keys(%{$access_hash})) {
150: my ($num,$scope,$end,$start) = ($key =~ /^([^:]+):([a-z]+)_(\d*)_?(\d*)$/);
151: if ($start > $now) {
152: next;
153: }
154: if ($end && $end<$now) {
155: next;
156: }
157: if ($scope eq 'public') {
158: $public = $key;
159: last;
1.81 raeburn 160: } elsif ($scope eq 'guest') {
161: $guest = $key;
162: } elsif ($scope eq 'domains') {
163: push(@domains,$key);
164: } elsif ($scope eq 'users') {
165: push(@users,$key);
166: } elsif ($scope eq 'course') {
167: push(@courses,$key);
168: } elsif ($scope eq 'group') {
169: push(@groups,$key);
1.79 raeburn 170: }
171: }
172: if ($public) {
173: return 'ok';
174: }
1.81 raeburn 175: if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') {
176: if ($guest) {
1.85 raeburn 177: return $guest;
1.81 raeburn 178: }
179: } else {
180: if (@domains > 0) {
181: foreach my $domkey (@domains) {
182: my %content = &Apache::lonnet::parse_access_controls($$access_hash{$domkey});
183: if (ref($content{'dom'}) eq 'ARRAY') {
184: if (grep(/^\Q$env{'user.domain'}\E$/,@{$content{'dom'}})) {
185: return 'ok';
186: }
187: }
188: }
189: }
190: if (@users > 0) {
191: foreach my $userkey (@users) {
192: my %content = &Apache::lonnet::parse_access_controls($$access_hash{$userkey});
193: if (exists($content{'users'}{$env{'user.name'}.':'.$env{'user.domain'}})) {
194: return 'ok';
195: }
196: }
197: }
198: my %roleshash;
199: my @courses_and_groups = @courses;
200: push(@courses_and_groups,@groups);
201: if (@courses_and_groups > 0) {
202: my (%allgroups,%allroles);
203: my ($start,$end,$role,$sec,$group);
204: foreach my $envkey (%env) {
205: if ($envkey =~ m-^user\.role\.(gr|cc|in|ta|ep|st)\./([^/]+)/([^/]+)/?([^/]*)$-) {
206: my $cid = $2.'_'.$3;
207: if ($1 eq 'gr') {
208: $group = $4;
209: $allgroups{$cid}{$group} = $env{$envkey};
210: } else {
211: if ($4 eq '') {
212: $sec = 'none';
213: } else {
214: $sec = $4;
215: }
216: $allroles{$cid}{$1}{$sec} = $env{$envkey};
217: }
218: } elsif ($envkey =~ m-^user\.role\./cr/(\w+/\w+/\w*)./([^/]+)/([^/]+)/?([^/]*)$-) {
219: my $cid = $2.'_'.$3;
220: if ($4 eq '') {
221: $sec = 'none';
222: } else {
223: $sec = $4;
224: }
225: $allroles{$cid}{$1}{$sec} = $env{$envkey};
226: }
227: }
228: if (keys(%allroles) == 0) {
229: return;
230: }
231: foreach my $key (@courses_and_groups) {
232: my %content = &Apache::lonnet::parse_access_controls($$access_hash{$key});
233: my $cnum = $content{'number'};
234: my $cdom = $content{'domain'};
235: my $cid = $cdom.'_'.$cnum;
236: if (!exists($allroles{$cid})) {
237: next;
238: }
239: foreach my $role_id (keys(%{$content{'roles'}})) {
240: my @sections = @{$content{'roles'}{$role_id}{'section'}};
241: my @groups = @{$content{'roles'}{$role_id}{'group'}};
242: my @status = @{$content{'roles'}{$role_id}{'access'}};
243: my @roles = @{$content{'roles'}{$role_id}{'role'}};
244: foreach my $role (keys(%{$allroles{$cid}})) {
245: if ((grep/^all$/,@roles) || (grep/^\Q$role\E$/,@roles)) {
246: foreach my $sec (keys(%{$allroles{$cid}{$role}})) {
247: if (&course_group_datechecker($allroles{$cid}{$role}{$sec},$now,\@status) eq 'ok') {
248: if (grep/^all$/,@sections) {
249: return 'ok';
250: } else {
251: if (grep/^$sec$/,@sections) {
1.85 raeburn 252: return 'ok';
1.81 raeburn 253: }
254: }
255: }
256: }
257: if (keys(%{$allgroups{$cid}}) == 0) {
258: if (grep/^none$/,@groups) {
259: return 'ok';
260: }
261: } else {
262: if (grep/^all$/,@groups) {
263: return 'ok';
264: }
265: foreach my $group (keys(%{$allgroups{$cid}})) {
266: if (grep/^$group$/,@groups) {
267: return 'ok';
268: }
269: }
270: }
271: }
272: }
273: }
274: }
275: }
276: if ($guest) {
1.85 raeburn 277: return $guest;
1.81 raeburn 278: }
279: }
1.79 raeburn 280: }
281: return;
282: }
1.76 albertel 283:
1.85 raeburn 284: sub passphrase_access_checker {
285: my ($r,$guestkey,$requrl) = @_;
286: my ($num,$scope,$end,$start) = ($guestkey =~ /^([^:]+):([a-z]+)_(\d*)_?(\d*)$/);
287: if ($scope eq 'guest') {
288: if (exists($env{'user.passphrase_access_'.$requrl})) {
289: if (($env{'user.passphrase_access_'.$requrl} == 0) ||
290: ($env{'user.passphrase_access_'.$requrl} > time)) {
291: $env{'request.publicaccess'} = 1;
292: return 'ok';
293: }
294: }
295: }
1.86 ! albertel 296: $r->set_handlers('PerlHandler'=> \&Apache::restrictedaccess::handler);
! 297: $r->content_type('perl-script');
1.85 raeburn 298: return;
299: }
300:
1.81 raeburn 301: sub course_group_datechecker {
302: my ($dates,$now,$status) = @_;
303: my ($start,$end) = split(/\./,$dates);
304: if (!$start && !$end) {
305: return 'ok';
306: }
307: if (grep/^active$/,@{$status}) {
308: if (((!$start) || ($start && $start <= $now)) && ((!$end) || ($end && $end >= $now))) {
309: return 'ok';
310: }
311: }
312: if (grep/^previous$/,@{$status}) {
313: if ($end > $now ) {
314: return 'ok';
315: }
316: }
317: if (grep/^future$/,@{$status}) {
318: if ($start > $now) {
319: return 'ok';
320: }
321: }
322: return;
323: }
324:
1.1 albertel 325: sub handler {
326: my $r = shift;
327: my $requrl=$r->uri;
328: my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));
329: my $lonid=$cookies{'lonID'};
330: my $cookie;
1.70 albertel 331: my $lonidsdir=$r->dir_config('lonIDsDir');
332:
333: my $handle;
1.1 albertel 334: if ($lonid) {
1.70 albertel 335: $handle=$lonid->value;
1.1 albertel 336: $handle=~s/\W//g;
1.70 albertel 337: }
338:
1.78 albertel 339: my ($sso_login);
1.70 albertel 340: if ($r->user
341: && (!$lonid || !-e "$lonidsdir/$handle.id" || $handle eq '') ) {
1.78 albertel 342: $sso_login = 1;
1.70 albertel 343: my $domain = $r->dir_config('lonDefDomain');
344: my $home=&Apache::lonnet::homeserver($r->user,$domain);
345: if ($home !~ /(con_lost|no_such_host)/) {
346: $handle=&Apache::lonauth::success($r,$r->user,$domain,
347: $home,'noredirect');
348: $r->header_out('Set-cookie',"lonID=$handle; path=/");
349: }
350: }
351:
1.78 albertel 352: if ($sso_login) {
353: &Apache::lonnet::appenv('request.sso.login' => 1);
354: }
355:
1.70 albertel 356: if ($r->dir_config("lonBalancer") eq 'yes') {
357: $r->set_handlers('PerlResponseHandler'=>
358: [\&Apache::switchserver::handler]);
359: }
360:
361: if ($handle ne '') {
1.1 albertel 362: if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) {
1.6 www 363:
1.46 www 364: # ------------------------------------------------------ Initialize Environment
365:
366: &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle);
1.47 www 367:
368: # --------------------------------------------------------- Initialize Language
369:
1.48 www 370: &Apache::lonlocal::get_language_handle($r);
1.46 www 371:
372: # -------------------------------------------------------------- Resource State
1.6 www 373:
1.51 albertel 374: if ($requrl=~/^\/+(res|uploaded)\//) {
1.64 albertel 375: $env{'request.state'} = "published";
1.17 www 376: } else {
1.64 albertel 377: $env{'request.state'} = 'unknown';
1.17 www 378: }
1.64 albertel 379: $env{'request.filename'} = $r->filename;
380: $env{'request.noversionuri'} = &Apache::lonnet::deversion($requrl);
1.6 www 381: # -------------------------------------------------------- Load POST parameters
382:
1.76 albertel 383: &Apache::lonacc::get_posted_cgi($r);
1.6 www 384:
385: # ---------------------------------------------------------------- Check access
1.79 raeburn 386: my $now = time;
1.80 albertel 387: if ($requrl =~ m|/+uploaded/([^/]+)/([^/]+)/portfolio(/.+)$|) {
1.79 raeburn 388: my $result = &portfolio_access($1,$2,$3);
389: if ($result eq 'ok') {
390: return OK;
1.85 raeburn 391: } elsif ($result =~ /^[^:]+:guest_/) {
1.86 ! albertel 392: &passphrase_access_checker($r,$result,$requrl);
! 393: return OK;
1.79 raeburn 394: }
1.80 albertel 395: } elsif ($requrl =~ m|/+uploaded/([^/]+)/([^/]+)/groups/([^/]+)/portfolio/(.+)$|) {
1.81 raeburn 396: my $result = &portfolio_access($1,$2,$3.'/'.$4,$3);
1.79 raeburn 397: if ($result eq 'ok') {
398: return OK;
1.85 raeburn 399: } elsif ($result =~ /^[^:]+:guest_/) {
1.86 ! albertel 400: &passphrase_access_checker($r,$result,$requrl);
! 401: return OK;
1.85 raeburn 402: }
1.79 raeburn 403: }
1.37 albertel 404: if ($requrl!~/^\/adm|public|prtspool\//) {
1.7 www 405: my $access=&Apache::lonnet::allowed('bre',$requrl);
406: if ($access eq '1') {
1.64 albertel 407: $env{'user.error.msg'}="$requrl:bre:0:0:Choose Course";
1.7 www 408: return HTTP_NOT_ACCEPTABLE;
409: }
410: if (($access ne '2') && ($access ne 'F')) {
1.64 albertel 411: $env{'user.error.msg'}="$requrl:bre:1:1:Access Denied";
1.7 www 412: return HTTP_NOT_ACCEPTABLE;
413: }
1.23 www 414: }
1.37 albertel 415: if ($requrl =~ m|^/prtspool/|) {
1.64 albertel 416: my $start='/prtspool/'.$env{'user.name'}.'_'.
417: $env{'user.domain'};
1.37 albertel 418: if ($requrl !~ /^\Q$start\E/) {
1.64 albertel 419: $env{'user.error.msg'}="$requrl:bre:1:1:Access Denied";
1.37 albertel 420: return HTTP_NOT_ACCEPTABLE;
421: }
422: }
1.67 albertel 423: if ($env{'user.name'} eq 'public' &&
424: $env{'user.domain'} eq 'public' &&
425: $requrl !~ m{^/+(res|public)/} &&
1.69 www 426: $requrl !~ m{^/+adm/(help|logout|randomlabel\.png)}) {
1.67 albertel 427: $env{'request.querystring'}=$r->args;
428: $env{'request.firsturl'}=$requrl;
429: return FORBIDDEN;
430: }
1.23 www 431: # ------------------------------------------------------------- This is allowed
1.64 albertel 432: if ($env{'request.course.id'}) {
1.24 www 433: &Apache::lonnet::countacc($requrl);
1.23 www 434: $requrl=~/\.(\w+)$/;
1.39 www 435: if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') ||
1.84 raeburn 436: ($requrl=~/^\/adm\/.*\/(aboutme|navmaps|smppg|bulletinboard)(\?|$)/) ||
1.44 www 437: ($requrl=~/^\/adm\/wrapper\//) ||
1.72 albertel 438: ($requrl=~m|^/adm/coursedocs/showdoc/|) ||
1.53 albertel 439: ($requrl=~m|\.problem/smpedit$|) ||
1.39 www 440: ($requrl=~/^\/public\/.*\/syllabus$/)) {
1.23 www 441: # ------------------------------------- This is serious stuff, get symb and log
1.29 www 442: my $query=$r->args;
443: my $symb;
444: if ($query) {
445: &Apache::loncommon::get_unprocessed_cgi($query,['symb']);
446: }
1.64 albertel 447: if ($env{'form.symb'}) {
448: $symb=&Apache::lonnet::symbclean($env{'form.symb'});
1.72 albertel 449: if ($requrl =~ m|^/adm/wrapper/|
450: || $requrl =~ m|^/adm/coursedocs/showdoc/|) {
1.52 raeburn 451: my ($map,$mid,$murl)=&Apache::lonnet::decode_symb($symb);
1.63 albertel 452: &Apache::lonnet::symblist($map,$murl => [$murl,$mid],
453: 'last_known' =>[$murl,$mid]);
1.53 albertel 454: } elsif ((&Apache::lonnet::symbverify($symb,$requrl)) ||
455: (($requrl=~m|(.*)/smpedit$|) &&
456: &Apache::lonnet::symbverify($symb,$1))) {
1.50 albertel 457: my ($map,$mid,$murl)=&Apache::lonnet::decode_symb($symb);
1.74 albertel 458: &Apache::lonnet::symblist($map,$murl => [$murl,$mid],
1.63 albertel 459: 'last_known' =>[$murl,$mid]);
1.31 www 460: } else {
461: $r->log_reason('Invalid symb for '.$requrl.': '.
462: $symb);
1.64 albertel 463: $env{'user.error.msg'}=
1.31 www 464: "$requrl:bre:1:1:Invalid Access";
465: return HTTP_NOT_ACCEPTABLE;
466: }
1.29 www 467: } else {
1.44 www 468: $symb=&Apache::lonnet::symbread($requrl);
1.58 albertel 469: if (&Apache::lonnet::is_on_map($requrl) && $symb &&
1.56 albertel 470: !&Apache::lonnet::symbverify($symb,$requrl)) {
1.58 albertel 471: $r->log_reason('Invalid symb for '.$requrl.': '.$symb);
1.64 albertel 472: $env{'user.error.msg'}=
1.55 albertel 473: "$requrl:bre:1:1:Invalid Access";
474: return HTTP_NOT_ACCEPTABLE;
475: }
1.61 albertel 476: if ($symb) {
1.65 albertel 477: my ($map,$mid,$murl)=
478: &Apache::lonnet::decode_symb($symb);
1.63 albertel 479: &Apache::lonnet::symblist($map,$murl =>[$murl,$mid],
480: 'last_known' =>[$murl,$mid]);
1.61 albertel 481: }
1.29 www 482: }
1.64 albertel 483: $env{'request.symb'}=$symb;
1.23 www 484: &Apache::lonnet::courseacclog($symb);
485: } else {
486: # ------------------------------------------------------- This is other content
487: &Apache::lonnet::courseacclog($requrl);
488: }
489: }
1.2 www 490: return OK;
1.1 albertel 491: } else {
1.73 raeburn 492: $r->log_reason("Cookie $handle not valid", $r->filename);
493: }
1.1 albertel 494: }
1.6 www 495:
1.21 www 496: # -------------------------------------------- See if this is a public resource
1.37 albertel 497: if ($requrl=~m|^/public/|
498: || (&Apache::lonnet::metadata($requrl,'copyright') eq 'public')) {
1.21 www 499: &Apache::lonnet::logthis('Granting public access: '.$requrl);
1.71 www 500: &Apache::lonlocal::get_language_handle($r);
1.66 albertel 501: my $cookie=
502: &Apache::lonauth::success($r,'public','public','public');
503: my $lonidsdir=$r->dir_config('lonIDsDir');
504: &Apache::lonnet::transfer_profile_to_env($lonidsdir,$cookie);
1.76 albertel 505: &Apache::lonacc::get_posted_cgi($r);
1.64 albertel 506: $env{'request.state'} = "published";
507: $env{'request.publicaccess'} = 1;
508: $env{'request.filename'} = $r->filename;
1.59 albertel 509:
1.66 albertel 510: $r->header_out('Set-cookie',"lonID=$cookie; path=/");
1.21 www 511: return OK;
512: }
1.68 albertel 513: if ($requrl=~m|^/+adm/+help/+|) {
514: return OK;
515: }
1.79 raeburn 516: # ------------------------------------- See if this is a viewable portfolio file
1.80 albertel 517: if ($requrl =~ m|/+uploaded/([^/]+)/([^/]+)/portfolio(/.+)$|) {
1.79 raeburn 518: my $result = &portfolio_access($1,$2,$3);
519: if ($result eq 'ok') {
520: return OK;
1.85 raeburn 521: } elsif ($result =~ /^[^:]+:guest_/) {
1.86 ! albertel 522: &passphrase_access_checker($r,$result,$requrl);
! 523: return OK;
1.79 raeburn 524: }
1.80 albertel 525: } elsif ($requrl =~ m|/+uploaded/([^/]+)/([^/]+)/groups/([^/]+)/portfolio/(.+)$|) {
1.82 albertel 526: my $result = &portfolio_access($1,$2,$3.'/'.$4,$3);
1.79 raeburn 527: if ($result eq 'ok') {
528: return OK;
1.85 raeburn 529: } elsif ($result =~ /^[^:]+:guest_/) {
1.86 ! albertel 530: &passphrase_access_checker($r,$result,$requrl);
! 531: return OK;
! 532: }
1.79 raeburn 533: }
1.34 www 534: # -------------------------------------------------------------- Not authorized
535: $requrl=~/\.(\w+)$/;
1.62 albertel 536: # if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') ||
537: # ($requrl=~/^\/adm\/(roles|logout|email|menu|remote)/) ||
538: # ($requrl=~m|^/prtspool/|)) {
1.34 www 539: # -------------------------- Store where they wanted to go and get login screen
1.64 albertel 540: $env{'request.querystring'}=$r->args;
541: $env{'request.firsturl'}=$requrl;
1.34 www 542: return FORBIDDEN;
1.62 albertel 543: # } else {
1.34 www 544: # --------------------------------------------------------------------- Goodbye
1.62 albertel 545: # return HTTP_BAD_REQUEST;
546: # }
1.1 albertel 547: }
548:
549: 1;
550: __END__
1.25 harris41 551:
552: =head1 NAME
553:
554: Apache::lonacc - Cookie Based Access Handler
555:
556: =head1 SYNOPSIS
557:
558: Invoked (for various locations) by /etc/httpd/conf/srm.conf:
559:
560: PerlAccessHandler Apache::lonacc
561:
562: =head1 INTRODUCTION
563:
564: This module enables cookie based authentication and is used
565: to control access for many different LON-CAPA URIs.
566:
567: Whenever the client sends the cookie back to the server,
568: this cookie is handled by either lonacc.pm or loncacc.pm
569: (see srm.conf for what is invoked when). If
570: the cookie is missing or invalid, the user is re-challenged
571: for login information.
572:
573: This is part of the LearningOnline Network with CAPA project
574: described at http://www.lon-capa.org.
575:
576: =head1 HANDLER SUBROUTINE
577:
578: This routine is called by Apache and mod_perl.
579:
580: =over 4
581:
582: =item *
583:
584: transfer profile into environment
585:
586: =item *
587:
588: load POST parameters
589:
590: =item *
591:
592: check access
593:
594: =item *
595:
596: if allowed, get symb, log, generate course statistics if applicable
597:
598: =item *
599:
600: otherwise return error
601:
602: =item *
603:
604: see if public resource
605:
606: =item *
607:
608: store attempted access
609:
610: =back
611:
612: =cut
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>