[LON-CAPA-cvs] cvs: loncom /auth loncacc.pm lonlogout.pm lonracc.pm lonroles.pm lonuploadedacc.pm /homework imageresponse.pm /lonnet/perl lonnet.pm

jms lon-capa-cvs-allow@mail.lon-capa.org
Wed, 12 Nov 2008 20:01:21 -0000


This is a MIME encoded message

--jms1226520081
Content-Type: text/plain

jms		Wed Nov 12 20:01:21 2008 EDT

  Modified files:              
    /loncom/auth	loncacc.pm lonroles.pm lonlogout.pm lonracc.pm 
                	lonuploadedacc.pm 
    /loncom/lonnet/perl	lonnet.pm 
    /loncom/homework	imageresponse.pm 
  Log:
  Added/modified POD documentation
  
--jms1226520081
Content-Type: text/plain
Content-Disposition: attachment; filename="jms-20081112200121.txt"

Index: loncom/auth/loncacc.pm
diff -u loncom/auth/loncacc.pm:1.46 loncom/auth/loncacc.pm:1.47
--- loncom/auth/loncacc.pm:1.46	Tue Oct  2 01:09:59 2007
+++ loncom/auth/loncacc.pm	Wed Nov 12 20:01:09 2008
@@ -2,7 +2,7 @@
 # Cookie Based Access Handler for Construction Area
 # (lonacc: 5/21/99,5/22,5/29,5/31 Gerd Kortemeyer)
 #
-# $Id: loncacc.pm,v 1.46 2007/10/02 01:09:59 albertel Exp $
+# $Id: loncacc.pm,v 1.47 2008/11/12 20:01:09 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -27,6 +27,65 @@
 # http://www.lon-capa.org/
 #
 
+=pod
+
+=head1 NAME
+
+Apache::lonacc - Cookie Based Access Handler for Construction Area
+
+=head1 SYNOPSIS
+
+Invoked (for various locations) by /etc/httpd/conf/loncapa_apache.conf:
+
+ PerlAccessHandler       Apache::loncacc
+
+=head1 INTRODUCTION
+
+This module enables cookie based authentication for construction area
+and is used to control access for three (essentially equivalent) URIs.
+
+ <LocationMatch "^/priv.*">
+ <LocationMatch "^/\~.*">
+ <LocationMatch "^/\~.*/$">
+
+Whenever the client sends the cookie back to the server, 
+if the cookie is missing or invalid, the user is re-challenged
+for login information.
+
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
+
+=head1 HANDLER SUBROUTINE
+
+This routine is called by Apache and mod_perl.
+
+=over 4
+
+=item *
+
+load POST parameters
+
+=item *
+
+store where they wanted to go (first url entered)
+
+=back
+
+=head1 OTHERSUBROUTINES
+
+=over 4
+
+=item *
+
+constructaccess($url,$ownerdomain) : See if the owner domain and name
+in the URL match those in the expected environment.  If so, return 
+two element list ($ownername,$ownerdomain).  Else, return null string.
+
+=back
+
+=cut
+
+
 package Apache::loncacc;
 
 use strict;
@@ -105,61 +164,6 @@
 1;
 __END__
 
-=head1 NAME
-
-Apache::lonacc - Cookie Based Access Handler for Construction Area
-
-=head1 SYNOPSIS
-
-Invoked (for various locations) by /etc/httpd/conf/loncapa_apache.conf:
-
- PerlAccessHandler       Apache::loncacc
-
-=head1 INTRODUCTION
-
-This module enables cookie based authentication for construction area
-and is used to control access for three (essentially equivalent) URIs.
-
- <LocationMatch "^/priv.*">
- <LocationMatch "^/\~.*">
- <LocationMatch "^/\~.*/$">
-
-Whenever the client sends the cookie back to the server, 
-if the cookie is missing or invalid, the user is re-challenged
-for login information.
-
-This is part of the LearningOnline Network with CAPA project
-described at http://www.lon-capa.org.
-
-=head1 HANDLER SUBROUTINE
-
-This routine is called by Apache and mod_perl.
-
-=over 4
-
-=item *
-
-load POST parameters
-
-=item *
-
-store where they wanted to go (first url entered)
-
-=back
-
-=head1 OTHERSUBROUTINES
-
-=over 4
-
-=item *
-
-constructaccess($url,$ownerdomain) : See if the owner domain and name
-in the URL match those in the expected environment.  If so, return 
-two element list ($ownername,$ownerdomain).  Else, return null string.
-
-=back
-
-=cut
 
 
 
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.209 loncom/auth/lonroles.pm:1.210
--- loncom/auth/lonroles.pm:1.209	Mon Oct 20 03:25:48 2008
+++ loncom/auth/lonroles.pm	Wed Nov 12 20:01:09 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.209 2008/10/20 03:25:48 raeburn Exp $
+# $Id: lonroles.pm,v 1.210 2008/11/12 20:01:09 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -27,6 +27,103 @@
 #
 ###
 
+=pod
+
+=head1 NAME
+
+Apache::lonroles - User Roles Screen
+
+=head1 SYNOPSIS
+
+Invoked by /etc/httpd/conf/srm.conf:
+
+ <Location /adm/roles>
+ PerlAccessHandler       Apache::lonacc
+ SetHandler perl-script
+ PerlHandler Apache::lonroles
+ ErrorDocument     403 /adm/login
+ ErrorDocument	  500 /adm/errorhandler
+ </Location>
+
+=head1 OVERVIEW
+
+=head2 Choosing Roles
+
+C<lonroles> is a handler that allows a user to switch roles in
+mid-session. LON-CAPA attempts to work with "No Role Specified", the
+default role that a user has before selecting a role, as widely as
+possible, but certain handlers for example need specification which
+course they should act on, etc. Both in this scenario, and when the
+handler determines via C<lonnet>'s C<&allowed> function that a certain
+action is not allowed, C<lonroles> is used as error handler. This
+allows the user to select another role which may have permission to do
+what they were trying to do. C<lonroles> can also be accessed via the
+B<CRS> button in the Remote Control. 
+
+=begin latex
+
+\begin{figure}
+\begin{center}
+\includegraphics[width=0.45\paperwidth,keepaspectratio]{Sample_Roles_Screen}
+  \caption{\label{Sample_Roles_Screen}Sample Roles Screen} 
+\end{center}
+\end{figure}
+
+=end latex
+
+=head2 Role Initialization
+
+The privileges for a user are established at login time and stored in the session environment. As a consequence, a new role does not become active till the next login. Handlers are able to query for privileges using C<lonnet>'s C<&allowed> function. When a user first logs in, their role is the "common" role, which means that they have the sum of all of their privileges. During a session it might become necessary to choose a particular role, which as a consequence also limits the user to only the privileges in that particular role.
+
+=head1 INTRODUCTION
+
+This module enables a user to select what role he wishes to
+operate under (instructor, student, teaching assistant, course
+coordinator, etc).  These roles are pre-established by the actions
+of upper-level users.
+
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
+
+=head1 HANDLER SUBROUTINE
+
+This routine is called by Apache and mod_perl.
+
+=over 4
+
+=item *
+
+Roles Initialization (yes/no)
+
+=item *
+
+Get Error Message from Environment
+
+=item *
+
+Who is this?
+
+=item *
+
+Generate Page Output
+
+=item *
+
+Choice or no choice
+
+=item *
+
+Table
+
+=item *
+
+Privileges
+
+=back
+
+=cut
+
+
 package Apache::lonroles;
 
 use strict;
Index: loncom/auth/lonlogout.pm
diff -u loncom/auth/lonlogout.pm:1.32 loncom/auth/lonlogout.pm:1.33
--- loncom/auth/lonlogout.pm:1.32	Fri Aug  1 11:04:09 2008
+++ loncom/auth/lonlogout.pm	Wed Nov 12 20:01:09 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Logout Handler
 #
-# $Id: lonlogout.pm,v 1.32 2008/08/01 11:04:09 bisitz Exp $
+# $Id: lonlogout.pm,v 1.33 2008/11/12 20:01:09 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -107,7 +107,15 @@
                           .&mt('You can [_1]close this window[_2] now.'
                               ,'','')
 #                              ,'<a href="javascript:self.close();">','</a>');
-# Due to security reasons in new web browsers a window could only be closed with java script, if this window has also been opend with javascript. This is not done here which means that in most cases the close link will not work. Unless we find another solution, this link should not be offered. (Stefan Bisitz, 2008-08-01)
+=pod
+
+=head1 NOTES:
+
+'<a href="javascript:self.close();">','</a>');
+
+Due to security reasons in new web browsers a window could only be closed with java script, if this window has also been opend with javascript. This is not done here which means that in most cases the close link will not work. Unless we find another solution, this link should not be offered. (Stefan Bisitz, 2008-08-01)
+
+=cut
                           .'</p>'
                           .'<p>'.&mt('[_1]Log in again[_2]'
                               ,'<a href="'.$login_url.'?domain='.$env{'user.domain'}.'">','</a>')
Index: loncom/auth/lonracc.pm
diff -u loncom/auth/lonracc.pm:1.22 loncom/auth/lonracc.pm:1.23
--- loncom/auth/lonracc.pm:1.22	Fri Mar  2 23:43:29 2007
+++ loncom/auth/lonracc.pm	Wed Nov 12 20:01:09 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Access Handler for File Transfers
 #
-# $Id: lonracc.pm,v 1.22 2007/03/02 23:43:29 albertel Exp $
+# $Id: lonracc.pm,v 1.23 2008/11/12 20:01:09 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -26,6 +26,53 @@
 # http://www.lon-capa.org/
 #
 
+=pod
+
+=head1 NAME
+
+Apache::lonracc - Access Handler for File Transfers
+
+=head1 SYNOPSIS
+
+Invoked by /etc/httpd/conf/loncapa.conf:
+
+ <LocationMatch "^/raw.*">
+ PerlAccessHandler Apache::lonracc
+ </LocationMatch>
+
+=head1 INTRODUCTION
+
+This module enables authentication for file transfers and works
+against the /res tree.
+
+Only lond invokes the /raw namespace through its subscribe function.
+
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
+
+=head1 HANDLER SUBROUTINE
+
+This routine is called by Apache and mod_perl.
+
+=over 4
+
+=item *
+
+Determine requesting host
+
+=item *
+
+See whether or not the requesting host is subscribed.
+
+=item *
+
+Respond with status of request and make log entry in case of unallowed
+access.
+
+=back
+
+=cut
+
 package Apache::lonracc;
 
 use strict;
@@ -101,50 +148,7 @@
 1;
 __END__
 
-=head1 NAME
-
-Apache::lonracc - Access Handler for File Transfers
-
-=head1 SYNOPSIS
-
-Invoked by /etc/httpd/conf/loncapa.conf:
-
- <LocationMatch "^/raw.*">
- PerlAccessHandler Apache::lonracc
- </LocationMatch>
-
-=head1 INTRODUCTION
-
-This module enables authentication for file transfers and works
-against the /res tree.
-
-Only lond invokes the /raw namespace through its subscribe function.
-
-This is part of the LearningOnline Network with CAPA project
-described at http://www.lon-capa.org.
-
-=head1 HANDLER SUBROUTINE
-
-This routine is called by Apache and mod_perl.
-
-=over 4
-
-=item *
-
-Determine requesting host
-
-=item *
-
-See whether or not the requesting host is subscribed.
 
-=item *
-
-Respond with status of request and make log entry in case of unallowed
-access.
-
-=back
-
-=cut
 
 
 
Index: loncom/auth/lonuploadedacc.pm
diff -u loncom/auth/lonuploadedacc.pm:1.13 loncom/auth/lonuploadedacc.pm:1.14
--- loncom/auth/lonuploadedacc.pm:1.13	Mon Jul 17 17:34:46 2006
+++ loncom/auth/lonuploadedacc.pm	Wed Nov 12 20:01:09 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Access Handler for User Files
 #
-# $Id: lonuploadedacc.pm,v 1.13 2006/07/17 17:34:46 albertel Exp $
+# $Id: lonuploadedacc.pm,v 1.14 2008/11/12 20:01:09 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -26,21 +26,34 @@
 # http://www.lon-capa.org/
 #
 
+=head1 NAME
+
+Apache::lonuploadedacc
+
+=head1 SYNOPSIS
+
+The way this is supposed to work:
+
+ User A has client machine C 
+ User A is logged into LON-CAPA server S
+ needs file from user B
+ homeserver for user B is H
+
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
+
+=head1 HANDLER SUBROUTINE
+
+This handler runs on H
+To access a userfile:
+Server S generates a token and puts it into the query string of URL for H
+Client box C asks H for file with token issued by C
+H now must ask S if token is valid, uses S's lond-command tokenauthuserfile
+
+=cut
+
 package Apache::lonuploadedacc;
 
-#
-# The way this is supposed to work:
-#
-# User A has client machine C
-# User A is logged into LON-CAPA server S
-# needs file from user B
-# homeserver for user B is H
-# 
-# This handler runs on H
-# To access a userfile:
-# Server S generates a token and puts it into the query string of URL for H
-# Client box C asks H for file with token issued by C
-# H now must ask S if token is valid, uses S's lond-command tokenauthuserfile
 
 use strict;
 use Apache::Constants qw(:common :http);
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.970 loncom/lonnet/perl/lonnet.pm:1.971
--- loncom/lonnet/perl/lonnet.pm:1.970	Wed Oct  8 21:14:11 2008
+++ loncom/lonnet/perl/lonnet.pm	Wed Nov 12 20:01:15 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.970 2008/10/08 21:14:11 raeburn Exp $
+# $Id: lonnet.pm,v 1.971 2008/11/12 20:01:15 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -27,6 +27,28 @@
 #
 ###
 
+=pod
+
+=head1 Package Variables
+
+These are largely undocumented, so if you decipher one please note it here.
+
+=over 4
+
+=item $processmarker
+
+Contains the time this process was started and this servers host id.
+
+=item $dumpcount
+
+Counts the number of times a message log flush has been attempted (regardless
+of success) by this process.  Used as part of the filename when messages are
+delayed.
+
+=back
+
+=cut
+
 package Apache::lonnet;
 
 use strict;
@@ -61,28 +83,6 @@
 our @ISA = qw (Exporter);
 our @EXPORT = qw(%env);
 
-=pod
-
-=head1 Package Variables
-
-These are largely undocumented, so if you decipher one please note it here.
-
-=over 4
-
-=item $processmarker
-
-Contains the time this process was started and this servers host id.
-
-=item $dumpcount
-
-Counts the number of times a message log flush has been attempted (regardless
-of success) by this process.  Used as part of the filename when messages are
-delayed.
-
-=back
-
-=cut
-
 
 # --------------------------------------------------------------------- Logging
 {
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.94 loncom/homework/imageresponse.pm:1.95
--- loncom/homework/imageresponse.pm:1.94	Fri Aug  8 16:37:13 2008
+++ loncom/homework/imageresponse.pm	Wed Nov 12 20:01:21 2008
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # image click response style
 #
-# $Id: imageresponse.pm,v 1.94 2008/08/08 16:37:13 bisitz Exp $
+# $Id: imageresponse.pm,v 1.95 2008/11/12 20:01:21 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -29,6 +29,152 @@
 #FIXME LATER assumes multiple possible submissions but only one is possible 
 #currently
 
+
+=head1 NAME
+
+Apache::imageresponse
+
+=head1 SYNOPSIS
+
+Coordinates the response to clicking an image.
+
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
+
+=head1 HANDLER SUBROUTINE
+
+
+
+=head1 OTHER SUBROUTINES
+
+=over
+
+=item *
+
+start_imageresponse()
+
+=item *
+
+end_imageresponse()
+
+=item *
+
+start_foilgroup()
+
+=item *
+
+getfoilcounts()
+
+=item *
+
+whichfoils()
+
+=item *
+
+prep_image()
+
+=item *
+
+draw_image()
+
+=item *
+
+displayfoils()
+
+=item *
+
+format_prior_response()
+
+=item *
+
+display_answers()
+
+=item *
+
+clean_up_image()
+
+=item *
+
+gradefoils()
+
+=item *
+
+stringify_submission()
+
+=item *
+
+get_submission()
+
+=item *
+
+end_foilgroup()
+
+=item *
+
+start_conceptgroup()
+
+=item *
+
+end_conceptgroup()
+
+=item *
+
+insert_foil()
+
+=item *
+
+start_foil()
+
+=item *
+
+end_foil()
+
+=item *
+
+start_text()
+
+=item *
+
+end_text()
+
+=item *
+
+start_image()
+
+
+=item *
+
+end_image()
+
+=item *
+
+start_rectangle()
+
+=item *
+
+grade_rectangle()
+
+=item *
+
+end_rectangle()
+
+=item *
+
+start_polygon()
+
+=item *
+
+grade_polygon()
+
+=item *
+
+end_polygon()
+
+=back
+
+=cut
+
+
 package Apache::imageresponse;
 use strict;
 use Image::Magick();

--jms1226520081--