Diff for /modules/gci/lonlogin.pm between versions 1.4 and 1.10

version 1.4, 2009/10/03 01:41:27 version 1.10, 2010/12/05 18:09:25
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 82  sub handler { Line 83  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 133  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 160  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$/) {
         $sitename = 'GCI Testing Center';          $lonhost = $domain.'l1';
           $host_name = $domain.'.lite.msu.edu';
           $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 197  sub handler { Line 221  sub handler {
     if ($env{'form.role'}) {      if ($env{'form.role'}) {
         $tokenextras = '&role='.&escape($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 ($env{'form.symb'}) {
         if (!$tokenextras) {          if (!$tokenextras) {
             $tokenextras = '&';              $tokenextras = '&';
Line 204  sub handler { Line 233  sub handler {
         $tokenextras .= '&symb='.&escape($env{'form.symb'});          $tokenextras .= '&symb='.&escape($env{'form.symb'});
     }      }
     my $logtoken=Apache::lonnet::reply(      my $logtoken=Apache::lonnet::reply(
        'tmpput:'.$ukey.$lkey.'&'.$firsturl,         'tmpput:'.$ukey.$lkey.'&'.$firsturl.$tokenextras,
        $lonhost);         $lonhost);
   
 # ------------------- If we cannot talk to ourselves, we are in serious trouble  # ------------------- If we cannot talk to ourselves, we are in serious trouble
Line 386  ENDSCRIPT Line 415  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 448  my %lt=&Apache::lonlocal::texthash( Line 477  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 469  my %lt=&Apache::lonlocal::texthash( Line 498  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 480  END_OF_BLOCK1 Line 513  END_OF_BLOCK1
              <td align="right" valign="top" width="11" height="11"><img src="/images/login/$domain/r2_c6.png" width="11" height="11" border="0" alt=""></td>               <td align="right" valign="top" width="11" height="11"><img src="/images/login/$domain/r2_c6.png" width="11" height="11" border="0" alt=""></td>
            </tr>             </tr>
            <tr>             <tr>
              <td align="center" valign="top" colspan="3">New to GCI WebCenter: <a href="javascript:send('newaccount')" style="color: #ffffff">Click here to sign up</a><br /></td>               <td>&nbsp;</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>
            </tr>             </tr>
            <tr>             <tr>
              <td align="left" valign="bottom" width="11" height="11"><img src="/images/login/$domain/r8_c4.png" width="11" height="11" border="0" alt=""></td>               <td align="left" valign="bottom" width="11" height="11"><img src="/images/login/$domain/r8_c4.png" width="11" height="11" border="0" alt=""></td>
Line 570  END_OF_BLOCK2 Line 605  END_OF_BLOCK2
   </tr>    </tr>
   <tr>    <tr>
     <td colspan="4">      <td colspan="4">
         <div align="left">
       <table border="0" cellspacing="0" cellpadding="0">        <table border="0" cellspacing="0" cellpadding="0">
         <tr>          <tr>
           <td width="10">&nbsp;</td>            <td width="10">&nbsp;</td>
        <td><font size="-1">         <td><font size="-1">
      <b>Note</b>:<br>       <b>Note</b>:<br />
       If log-in fails, it may be because your browser is not accepting session cookies, or javascript is disabled. <a href="http://loncapa.msu.edu/student/cookies.html">Learn more</a>.        If log-in fails, it may be because your browser is not accepting session cookies, or javascript is disabled. <a href="http://loncapa.msu.edu/student/cookies.html">Learn more</a>.
      </font>       </font>
          </td>           </td>
          <td width="10">&nbsp;</td>           <td width="10">&nbsp;</td>
        </tr>         </tr>
      </table>       </table>
        </div>
    </td>     </td>
   </tr>    </tr>
   <tr>    <tr>

Removed from v.1.4  
changed lines
  Added in v.1.10


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