--- loncom/interface/slotrequest.pm 2006/05/12 01:20:31 1.60 +++ loncom/interface/slotrequest.pm 2006/05/18 20:53:24 1.62 @@ -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.62 2006/05/18 20:53:24 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 { @@ -1146,7 +1147,7 @@ sub show_table { if (exists($show{'proctor'})) { $rowspan=2; @proctors= map { - my ($uname,$udom)=split(/@/,$_); + my ($uname,$udom)=split(/:/,$_); my $fullname=$name_cache{$_}; if (!defined($fullname)) { $fullname = &Apache::loncommon::plainname($uname,$udom); @@ -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;