--- loncom/auth/lonroles.pm 2006/03/16 19:19:59 1.146 +++ loncom/auth/lonroles.pm 2006/05/30 12:45:24 1.149 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.146 2006/03/16 19:19:59 raeburn Exp $ +# $Id: lonroles.pm,v 1.149 2006/05/30 12:45:24 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,6 +40,9 @@ use Apache::lonhtmlcommon; use Apache::lonannounce; use Apache::lonlocal; use GDBM_File; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; + sub redirect_user { my ($r,$title,$url,$msg,$launch_nav) = @_; @@ -55,24 +58,21 @@ sub redirect_user { } else { $navwindow.=&Apache::lonnavmaps::close(); } - my $bodytag=&Apache::loncommon::bodytag('Switching Role'); + my $start_page = &Apache::loncommon::start_page('Switching Role',undef, + {'redirect' => [1,$url],}); + my $end_page = &Apache::loncommon::end_page(); + # Note to style police: # This must only replace the spaces, nothing else, or it bombs elsewhere. $url=~s/ /\%20/g; $r->print(<$title - - - -$bodytag +$start_page $navwindow

$msg

-Continue - - +$end_page ENDREDIR return; } @@ -86,6 +86,7 @@ sub handler { my $envkey; my %dcroles = (); my $numdc = &check_fordc(\%dcroles,$then); + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); # ================================================================== Roles Init if ($env{'form.selectrole'}) { @@ -159,8 +160,9 @@ sub handler { &Apache::loncommon::no_cache($r); $r->send_http_header; my $swinfo=&Apache::lonmenu::rawconfig(); - my $bodytag=&Apache::loncommon::bodytag + my $start_page=&Apache::loncommon::start_page ('Verifying Access Key to Unlock this Course'); + my $end_page=&Apache::loncommon::end_page(); my $buttontext=&mt('Enter Course'); my $message=&mt('Successfully registered key'); my $assignresult= @@ -180,10 +182,7 @@ sub handler { $buttontext=&mt('Re-Enter Key'); } $r->print(<Verifying Course Access Key - - -$bodytag +$start_page @@ -193,7 +192,7 @@ $swinfo $message
- +$end_page ENDENTEREDKEY return OK; } else { @@ -202,13 +201,11 @@ ENDENTEREDKEY &Apache::loncommon::no_cache($r); $r->send_http_header; my $swinfo=&Apache::lonmenu::rawconfig(); - my $bodytag=&Apache::loncommon::bodytag + my $start_page=&Apache::loncommon::start_page ('Enter Access Key to Unlock this Course'); + my $end_page=&Apache::loncommon::end_page(); $r->print(<Entering Course Access Key - - -$bodytag +$start_page @@ -218,7 +215,7 @@ $swinfo - +$end_page ENDENTERKEY return OK; } @@ -329,16 +326,12 @@ ENDENTERKEY return OK if $r->header_only; my $swinfo=&Apache::lonmenu::rawconfig(); - my $bodytag=&Apache::loncommon::bodytag('User Roles'); + my $start_page=&Apache::loncommon::start_page('User Roles'); my $standby=&mt('Role selected. Please stand by.'); $standby=~s/\n/\\n/g; my $helptag='
'.&Apache::loncommon::help_open_menu('','General Intro','General_Intro','User Roles',1,undef,undef,undef,undef,,&mt("Click here for help")).'
'; $r->print(< - -LON-CAPA User Roles - -$bodytag +$start_page $helptag
'); - $r->print(''); + $r->print(&Apache::loncommon::end_page()); return OK; } # More than one possible role @@ -767,7 +761,7 @@ ENDHEADER $r->dir_config('lonVersion').'
'. ''.&mt('Logout').'

'); } - $r->print("\n"); + $r->print(&Apache::loncommon::end_page()); return OK; } @@ -999,7 +993,7 @@ sub allcourses_row { sub recent_filename { my $area=shift; - return 'nohist_recent_'.&Apache::lonnet::escape($area); + return 'nohist_recent_'.&escape($area); } sub set_privileges {