Diff for /modules/gci/lonlogin.pm between versions 1.7 and 1.13

version 1.7, 2010/01/09 00:50:43 version 1.13, 2020/03/18 19:42:53
Line 38  use Apache::lonlocal; Line 38  use Apache::lonlocal;
 use Apache::migrateuser();  use Apache::migrateuser();
 use lib '/home/httpd/lib/perl/';  use lib '/home/httpd/lib/perl/';
 use LONCAPA;  use LONCAPA;
   use HTML::Entities();
     
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
Line 62  sub handler { Line 63  sub handler {
     $r->send_http_header;      $r->send_http_header;
     return OK if $r->header_only;      return OK if $r->header_only;
   
   
 # Are we re-routing?  # Are we re-routing?
     if (-e '/home/httpd/html/lon-status/reroute.txt') {      if (-e '/home/httpd/html/lon-status/reroute.txt') {
  &Apache::lonauth::reroute($r);   &Apache::lonauth::reroute($r);
Line 82  sub handler { Line 82  sub handler {
  my $end_page =    my $end_page = 
     &Apache::loncommon::end_page();      &Apache::loncommon::end_page();
         my $dest = '/adm/roles';          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 '') {          if ($env{'form.firsturl'} ne '') {
             $dest = $env{'form.firsturl'};              $dest = $env{'form.firsturl'};
         }          }
Line 125  sub handler { Line 132  sub handler {
  (&Apache::lonnet::domain($env{'form.domain'},'description'))) {   (&Apache::lonnet::domain($env{'form.domain'},'description'))) {
  $domain=$env{'form.domain'};   $domain=$env{'form.domain'};
     }      }
     my $sitename = 'GCI WebCenter';      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 $shortsitename = 'WebCenter';
     my $existing = 'Existing WebCenter user?';      my $existing = 'Existing WebCenter user?';
     my $sitedesc = &mt('The Geoscience Concept Inventory (GCI) [_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].','<a href="http://gci.lite.msu.edu/">','</a>','<a href="http://gcitest.lite.msu.edu/adm/login">');      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.') <a href="http://'.$inventory.'.lite.msu.edu/">','</a>','<a href="http://'.$testdom.'.lite.msu.edu/adm/login">');
     my $role    = $r->dir_config('lonRole');      my $role    = $r->dir_config('lonRole');
     my $loadlim = $r->dir_config('lonLoadLim');      my $loadlim = $r->dir_config('lonLoadLim');
     my $servadm = $r->dir_config('lonAdmEMail');      my $servadm = $r->dir_config('lonAdmEMail');
Line 138  sub handler { Line 159  sub handler {
     my $expire  = $r->dir_config('lonExpire');      my $expire  = $r->dir_config('lonExpire');
     my $version = $r->dir_config('lonVersion');      my $version = $r->dir_config('lonVersion');
     my $host_name = &Apache::lonnet::hostname($lonhost);      my $host_name = &Apache::lonnet::hostname($lonhost);
     if ($domain eq 'gcitest') {      if ($domain =~ /^(\w+ci)test$/) {
         $lonhost = 'gcitestl1';          $lonhost = $domain.'l1';
         $host_name = 'gcitest.lite.msu.edu';          $host_name = $domain.'.lite.msu.edu';
         $sitename = 'GCI Testing Center';          $sitename = $inventory.' Testing Center';
         $shortsitename = 'Testing Center';          $shortsitename = 'Testing Center';
         $existing = 'Student with Testing Center account?';          $existing = 'Student with Testing Center account?';
         $sitedesc = &mt('The GCI Testing Center is used by [_1]students[_2] to complete online concept tests created by their instructors using questions available in the Geoscience Concept Inventory.','<i>','</i>');          $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,'<i>','</i>',$longname{$inventory});
     }      }
   
 # --------------------------------------------- Default values for login fields  # --------------------------------------------- Default values for login fields
Line 199  sub handler { Line 220  sub handler {
     if ($env{'form.role'}) {      if ($env{'form.role'}) {
         $tokenextras = '&role='.&escape($env{'form.role'});          $tokenextras = '&role='.&escape($env{'form.role'});
     }      }
     if ($domain eq 'gci') {      if ($domain !~ /^\w+citest$/) {
         $env{'form.symb'} = '/adm/gci_info';          unless ($env{'form.symb'} eq '/adm/statistics') {
               $env{'form.symb'} = '/adm/ci_info';
           }
     }      }
     if ($env{'form.symb'}) {      if ($env{'form.symb'}) {
         if (!$tokenextras) {          if (!$tokenextras) {
Line 391  ENDSCRIPT Line 414  ENDSCRIPT
   
     my $css_url = "/css/$domain/login.css";      my $css_url = "/css/$domain/login.css";
     $js .= "\n".'<link type="text/css" rel="stylesheet" href="'.$css_url.'">'."\n";      $js .= "\n".'<link type="text/css" rel="stylesheet" href="'.$css_url.'">'."\n";
     $r->print(&Apache::loncommon::start_page('GCI WebCenter Login',$js,      $r->print(&Apache::loncommon::start_page($uc_inventory.' WebCenter Login',$js,
                                        { 'redirect'       => [$expire,'/adm/roles'],                                          { 'redirect'       => [$expire,'/adm/roles'], 
                                          'add_entries' => \%add_entries,                                           'add_entries' => \%add_entries,
                                          'only_body'   => 1,}));                                           'only_body'   => 1,}));
Line 453  my %lt=&Apache::lonlocal::texthash( Line 476  my %lt=&Apache::lonlocal::texthash(
     <td width="450" valign="top">      <td width="450" valign="top">
       <table class="LC_loginbox_left">        <table class="LC_loginbox_left">
         <tr>          <tr>
           <td width="411" align="left"><br /><img src="/images/login/$domain/logo_smrnd.png" width="411" height="51" alt="GCI" align="left"></td>            <td width="411" align="left"><br /><img src="/images/login/$domain/logo_smrnd.png" width="411" height="51" alt="$uc_inventory" align="left"></td>
         </tr>          </tr>
         <tr>          <tr>
          <td>           <td>
Line 474  my %lt=&Apache::lonlocal::texthash( Line 497  my %lt=&Apache::lonlocal::texthash(
          <span style="font-size: 18px; line-height: 22px; "><font style="font-size: 18px; line-height: 22px;"><br />New to the $sitename?</font></span><br />           <span style="font-size: 18px; line-height: 22px; "><font style="font-size: 18px; line-height: 22px;"><br />New to the $sitename?</font></span><br />
           <font class="bodyblue">$sitedesc<br /><br />The $shortsitename runs on <a href="http://loncapa.org/">LON-CAPA</a> - an open source freeware distributed learning content management and assessment system.</font><br /><br />            <font class="bodyblue">$sitedesc<br /><br />The $shortsitename runs on <a href="http://loncapa.org/">LON-CAPA</a> - an open source freeware distributed learning content management and assessment system.</font><br /><br />
 END_OF_BLOCK1  END_OF_BLOCK1
     if ($domain eq 'gci') {      if ($domain !~ /^\w+citest$/) {
           my $review;
           if (ref($allnums{$domain}) eq 'HASH') {
               $review = $domain.'_'.$allnums{$domain}{'review'};
           }
         $r->print(<<"END_OF_BLOCK2");           $r->print(<<"END_OF_BLOCK2"); 
           <font class="bodyblue"><b>Create a GCI WebCenter ID</b> &#150; use your ID to submit comments or new content, or to create a new test.  If you are already a GCI WebCenter user, please log-in.</font><br /><br /><br />            <font class="bodyblue"><b>Create a $uc_inventory WebCenter ID</b> &#150; use your ID to submit comments or new content, or to create a new test.  If you are already a $uc_inventory WebCenter user, please log-in.</font><br /><br /><br />
          <form name="signup" method="post" action="/adm/createaccount?courseid=gci_9615072b469884921gcil1"><input type="hidden" name="process" value="signup"/>           <form name="signup" method="post" action="/adm/createaccount?courseid=$review"><input type="hidden" name="process" value="signup"/>
          <table class="LC_signup">           <table class="LC_signup">
            <tr>             <tr>
              <td align="left" valign="top" width="11" height="11"><img src="/images/login/$domain/r2_c4.png" width="11" height="11" border="0" alt=""></td>               <td align="left" valign="top" width="11" height="11"><img src="/images/login/$domain/r2_c4.png" width="11" height="11" border="0" alt=""></td>
Line 486  END_OF_BLOCK1 Line 513  END_OF_BLOCK1
            </tr>             </tr>
            <tr>             <tr>
              <td>&nbsp;</td>               <td>&nbsp;</td>
              <td align="center" valign="middle"><span style="white-space: nowrap;">New to GCI WebCenter:<a href="javascript:send('newaccount')" style="color: #ffffff">&nbsp;Click here to sign up</a></span></td>               <td align="center" valign="middle"><span style="white-space: nowrap;">New to $uc_inventory WebCenter:&nbsp;<a href="javascript:send('newaccount')" style="color: #ffffff">Click here to sign up</a></span></td>
              <td>&nbsp;</td>               <td>&nbsp;</td>
            </tr>             </tr>
            <tr>             <tr>
Line 604  END_OF_BLOCK2 Line 631  END_OF_BLOCK2
  Javascript must be enabled in your web browser in order to use this web site.   Javascript must be enabled in your web browser in order to use this web site.
  </font></noscript>   </font></noscript>
 <p>&nbsp;</p>  <p>&nbsp;</p>
 <input type="hidden" name="imagesuppress"  value="" />  <input type="hidden" name="imagesuppress" value="" />
 <input type="hidden" name="embedsuppress"  value="" />  <input type="hidden" name="embedsuppress" value="" />
 <input type="hidden" name="appletsuppress"  value="" />  <input type="hidden" name="appletsuppress" value="" />
 <input type="hidden" name="fontenhance"  value="" />  <input type="hidden" name="fontenhance" value="" />
 <input type="hidden" name="blackwhite"  value="" />  <input type="hidden" name="blackwhite" value="" />
 <input type="hidden" name="remember"  value="" />  <input type="hidden" name="remember" value="" />
 END_OF_BLOCK3  END_OF_BLOCK3
     } else {      } else {
         $r->print(<<ENDACCESSOPTIONS);          $r->print(<<ENDACCESSOPTIONS);
Line 686  ENDTEXTUAL Line 713  ENDTEXTUAL
    <input type="hidden" name="upass1" value="" />     <input type="hidden" name="upass1" value="" />
    <input type="hidden" name="upass2" value="" />     <input type="hidden" name="upass2" value="" />
    <input type="hidden" name="udom" value="" />     <input type="hidden" name="udom" value="" />
    <input type="hidden" name="imagesuppress"  value="" />     <input type="hidden" name="imagesuppress" value="" />
    <input type="hidden" name="appletsuppress"  value="" />     <input type="hidden" name="appletsuppress" value="" />
    <input type="hidden" name="embedsuppress"  value="" />     <input type="hidden" name="embedsuppress" value="" />
    <input type="hidden" name="fontenhance"  value="" />     <input type="hidden" name="fontenhance" value="" />
    <input type="hidden" name="blackwhite"  value="" />     <input type="hidden" name="blackwhite" value="" />
    <input type="hidden" name="remember"  value="" />     <input type="hidden" name="remember" value="" />
    <input type="hidden" name="localpath" value="$env{'form.localpath'}" />     <input type="hidden" name="localpath" value="$env{'form.localpath'}" />
    <input type="hidden" name="localres" value="$env{'form.localres'}" />     <input type="hidden" name="localres" value="$env{'form.localres'}" />
   </form>    </form>
Line 738  function helpdesk() { Line 765  function helpdesk() {
 ENDSCRIPT  ENDSCRIPT
     }      }
     $contactblock .= <<"ENDBLOCK";      $contactblock .= <<"ENDBLOCK";
      &nbsp;&nbsp;&nbsp;$version      &nbsp;&nbsp;&nbsp;$version
 ENDBLOCK  ENDBLOCK
     return $contactblock;      return $contactblock;
 }  }

Removed from v.1.7  
changed lines
  Added in v.1.13


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>