--- modules/gci/lonlogin.pm 2009/09/23 13:14:19 1.2 +++ modules/gci/lonlogin.pm 2018/05/30 20:41:58 1.11 @@ -1,7 +1,7 @@ # The LearningOnline Network # Login Screen # -# $Id: lonlogin.pm,v 1.2 2009/09/23 13:14:19 gci Exp $ +# $Id: lonlogin.pm,v 1.11 2018/05/30 20:41:58 gci Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,6 +38,7 @@ use Apache::lonlocal; use Apache::migrateuser(); use lib '/home/httpd/lib/perl/'; use LONCAPA; +use HTML::Entities(); sub handler { my $r = shift; @@ -81,11 +82,22 @@ sub handler { &Apache::loncommon::start_page('Already logged in'); my $end_page = &Apache::loncommon::end_page(); + my $dest = '/adm/roles'; + if ($env{'form.role'}) { + $dest .= '?selectrole=1&'.$env{'form.role'}.'=1'; + } + if ($env{'form.symb'}) { + $dest .= ($dest =~ /\?/) ? '&' : '?'; + $dest .= 'destinationurl='.&HTML::Entities::encode($env{'form.symb'},'"&<>'); + } + if ($env{'form.firsturl'} ne '') { + $dest = $env{'form.firsturl'}; + } $r->print( $start_page .'
'.&mt('Please either [_1]continue the current session[_2] or [_3]log out[_4].', - '','','','').'
' + '','','','').'' .'' .$end_page ); @@ -121,6 +133,24 @@ sub handler { (&Apache::lonnet::domain($env{'form.domain'},'description'))) { $domain=$env{'form.domain'}; } + my %longname = ( + GCI => 'Geoscience Concept Inventory', + SLCI => 'Science Literacy Concept Inventory', + ); + my %allnums = &Apache::loncommon::get_faculty_cnums(); + my ($inventory,$uc_inventory,$testdom); + if ($domain =~ /^(\w+ci)test$/) { + $inventory = $1; + $testdom = $domain; + } else { + $inventory = $domain; + $testdom = $domain.'test'; + } + $uc_inventory = uc($inventory); + my $sitename; = $uc_inventory.' WebCenter'; + my $shortsitename = 'WebCenter'; + my $existing = 'Existing WebCenter user?'; + my $sitedesc = &mt('The [_1]WebCenter[_2] is a place to comment on existing concept questions, or submit new ones, and is also a place to build and manage Concept Tests which your students will complete via the [_3]Testing Center[_2].',$longname{$inventory}.' ('.$uc_inventory.') ','',''); my $role = $r->dir_config('lonRole'); my $loadlim = $r->dir_config('lonLoadLim'); my $servadm = $r->dir_config('lonAdmEMail'); @@ -130,6 +160,14 @@ sub handler { my $expire = $r->dir_config('lonExpire'); my $version = $r->dir_config('lonVersion'); my $host_name = &Apache::lonnet::hostname($lonhost); + if ($domain =~ /^(\w+ci)test$/) { + $lonhost = $domain.'l1'; + $host_name = $domain.'.lite.msu.edu'; + $sitename = $inventory.' Testing Center'; + $shortsitename = 'Testing Center'; + $existing = 'Student with Testing Center account?'; + $sitedesc = &mt('The [_1] Testing Center is used by [_2]students[_3] to complete online concept tests created by their instructors using questions available in the [_4].',$inventory,'','',$longname{$inventory}); + } # --------------------------------------------- Default values for login fields @@ -183,6 +221,11 @@ sub handler { if ($env{'form.role'}) { $tokenextras = '&role='.&escape($env{'form.role'}); } + if ($domain !~ /^\w+citest$/) { + unless ($env{'form.symb'} eq '/adm/statistics') { + $env{'form.symb'} = '/adm/ci_info'; + } + } if ($env{'form.symb'}) { if (!$tokenextras) { $tokenextras = '&'; @@ -190,7 +233,7 @@ sub handler { $tokenextras .= '&symb='.&escape($env{'form.symb'}); } my $logtoken=Apache::lonnet::reply( - 'tmpput:'.$ukey.$lkey.'&'.$firsturl, + 'tmpput:'.$ukey.$lkey.'&'.$firsturl.$tokenextras, $lonhost); # ------------------- If we cannot talk to ourselves, we are in serious trouble @@ -239,7 +282,7 @@ sub handler { .'' .'