[LON-CAPA-cvs] cvs: doc /loncapafiles loncapafiles.lpml loncom loncapa_apache.conf loncom/interface slotrequest.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 31 May 2005 17:42:14 -0000


albertel		Tue May 31 13:42:14 2005 EDT

  Added files:                 
    /loncom/interface	slotrequest.pm 

  Modified files:              
    /loncom	loncapa_apache.conf 
    /doc/loncapafiles	loncapafiles.lpml 
  Log:
  - adding slot requesting handler
  
  
Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.109 loncom/loncapa_apache.conf:1.110
--- loncom/loncapa_apache.conf:1.109	Fri May 27 21:32:32 2005
+++ loncom/loncapa_apache.conf	Tue May 31 13:42:11 2005
@@ -1,7 +1,7 @@
 ##
 ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
 ##
-## $Id: loncapa_apache.conf,v 1.109 2005/05/28 01:32:32 www Exp $
+## $Id: loncapa_apache.conf,v 1.110 2005/05/31 17:42:11 albertel Exp $
 ##
 
 #
@@ -465,6 +465,15 @@
 ErrorDocument	  500 /adm/errorhandler
 </Location>
 
+<Location /adm/slotrequest>
+PerlAccessHandler       Apache::lonacc
+SetHandler perl-script
+PerlHandler Apache::slotrequest
+ErrorDocument     403 /adm/login
+ErrorDocument     406 /adm/roles
+ErrorDocument	  500 /adm/errorhandler
+</Location>
+
 <Location /adm/wizard>
 PerlAccessHandler       Apache::lonacc
 SetHandler perl-script
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.423 doc/loncapafiles/loncapafiles.lpml:1.424
--- doc/loncapafiles/loncapafiles.lpml:1.423	Mon May 30 11:22:29 2005
+++ doc/loncapafiles/loncapafiles.lpml	Tue May 31 13:42:12 2005
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.423 2005/05/30 15:22:29 www Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.424 2005/05/31 17:42:12 albertel Exp $ -->
 
 <!--
 
@@ -3701,7 +3701,16 @@
 <target dist='default'>home/httpd/lib/perl/Apache/lonparmset.pm</target>
 <categoryname>handler</categoryname>
 <description>
-Handler to resolve ambiguous file locations
+Handler for setting and modifying both course preferences and coure parameters
+</description>
+<status>works/unverified</status>
+</file>
+<file>
+<source>loncom/interface/slotrequest.pm</source>
+<target dist='default'>home/httpd/lib/perl/Apache/slotrequest.pm</target>
+<categoryname>handler</categoryname>
+<description>
+Handler for students to add access slots
 </description>
 <status>works/unverified</status>
 </file>

Index: loncom/interface/slotrequest.pm
+++ loncom/interface/slotrequest.pm
# The LearningOnline Network with CAPA
# Handler for requesting to have slots added to a students record
#
# $Id: slotrequest.pm,v 1.1 2005/05/31 17:42:11 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
#
# LON-CAPA is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LON-CAPA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LON-CAPA; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# /home/httpd/html/adm/gpl.txt
#
# http://www.lon-capa.org/
#
###

package Apache::slotrequest;

use strict;
use Apache::Constants qw(:common :http :methods);
use Apache::loncommon();
use Apache::lonlocal;
use Apache::lonnet;

sub fail {
    my ($r,$code)=@_;
    $r->print();
    &end_page($r);
}

sub start_page {
    my ($r)=@_;
    my $html=&Apache::lonxml::xmlbegin();
    $r->print($html.'<head><title>'.
	      &mt('Request another Worktime').'</title></head>');
    $r->print(&Apache::loncommon::bodytag('Requesting another Worktime'));
}

sub end_page {
    my ($r)=@_;
    $r->print(&Apache::loncommon::endbodytag().'</html>');
}

sub handler {
    my $r=shift;

    &start_page($r);
    my $symb=$env{'form.symb'};
    my (undef,undef,$res)=&Apache::lonnet::decode_symb($symb);
    if ($symb !~ /\.task$/) {
	&fail($r,'not_valid');
	return OK;
    }

    &end_page($r);
    return OK;
}