--- loncom/interface/slotrequest.pm 2006/05/12 01:20:31 1.60 +++ loncom/interface/slotrequest.pm 2006/05/12 05:12:27 1.61 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for requesting to have slots added to a students record # -# $Id: slotrequest.pm,v 1.60 2006/05/12 01:20:31 albertel Exp $ +# $Id: slotrequest.pm,v 1.61 2006/05/12 05:12:27 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,7 +41,8 @@ sub fail { my ($r,$code)=@_; if ($code eq 'not_valid') { $r->print('

'.&mt('Unable to understand what resource you wanted to sign up for.').'

'); - + } elsif ($code eq 'not_available') { + $r->print('

'.&mt('No slots are available.').'

'); } elsif ($code eq 'not_allowed') { $r->print('

'.&mt('Not allowed to sign up or change reservations at this time.').'

'); } else { @@ -1550,10 +1551,14 @@ sub handler { } } else { my $symb=&Apache::lonnet::unescape($env{'form.symb'}); + if (!defined($symb)) { + &fail($r,'not_valid'); + return OK; + } my (undef,undef,$res)=&Apache::lonnet::decode_symb($symb); my $useslots = &Apache::lonnet::EXT("resource.0.useslots",$symb); if ($useslots ne 'resource' && $useslots ne 'map') { - &fail($r,'not_valid'); + &fail($r,'not_available'); return OK; } $env{'request.symb'}=$symb;