Diff for /loncom/auth/lonroles.pm between versions 1.146 and 1.147

version 1.146, 2006/03/16 19:19:59 version 1.147, 2006/04/05 22:39:55
Line 55  sub redirect_user { Line 55  sub redirect_user {
     } else {      } else {
  $navwindow.=&Apache::lonnavmaps::close();   $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:   # Note to style police: 
 # This must only replace the spaces, nothing else, or it bombs elsewhere.  # This must only replace the spaces, nothing else, or it bombs elsewhere.
     $url=~s/ /\%20/g;      $url=~s/ /\%20/g;
     $r->print(<<ENDREDIR);      $r->print(<<ENDREDIR);
 <head><title>$title</title>  $start_page
 <meta HTTP-EQUIV="Refresh" CONTENT="1; url=$url">  
 </head>  
 <html>  
 $bodytag  
 <script type="text/javascript">  <script type="text/javascript">
 $swinfo  $swinfo
 </script>  </script>
 $navwindow  $navwindow
 <h1>$msg</h1>  <h1>$msg</h1>
 <a href="$url">Continue</a>  $end_page
 </body>  
 </html>  
 ENDREDIR  ENDREDIR
     return;      return;
 }  }
Line 159  sub handler { Line 156  sub handler {
  &Apache::loncommon::no_cache($r);   &Apache::loncommon::no_cache($r);
  $r->send_http_header;   $r->send_http_header;
  my $swinfo=&Apache::lonmenu::rawconfig();   my $swinfo=&Apache::lonmenu::rawconfig();
  my $bodytag=&Apache::loncommon::bodytag   my $start_page=&Apache::loncommon::start_page
     ('Verifying Access Key to Unlock this Course');      ('Verifying Access Key to Unlock this Course');
    my $end_page=&Apache::loncommon::end_page();
  my $buttontext=&mt('Enter Course');   my $buttontext=&mt('Enter Course');
  my $message=&mt('Successfully registered key');   my $message=&mt('Successfully registered key');
  my $assignresult=   my $assignresult=
Line 180  sub handler { Line 178  sub handler {
      $buttontext=&mt('Re-Enter Key');       $buttontext=&mt('Re-Enter Key');
  }   }
  $r->print(<<ENDENTEREDKEY);   $r->print(<<ENDENTEREDKEY);
 <head><title>Verifying Course Access Key</title>  $start_page
 </head>  
 <html>  
 $bodytag  
 <script>  <script>
 $swinfo  $swinfo
 </script>  </script>
Line 193  $swinfo Line 188  $swinfo
 <font size="+2">$message</font><br />  <font size="+2">$message</font><br />
 <input type="submit" value="$buttontext" />  <input type="submit" value="$buttontext" />
 </form>  </form>
 </body></html>  $end_page
 ENDENTEREDKEY  ENDENTEREDKEY
                                  return OK;                                   return OK;
      } else {       } else {
Line 202  ENDENTEREDKEY Line 197  ENDENTEREDKEY
  &Apache::loncommon::no_cache($r);   &Apache::loncommon::no_cache($r);
  $r->send_http_header;   $r->send_http_header;
  my $swinfo=&Apache::lonmenu::rawconfig();   my $swinfo=&Apache::lonmenu::rawconfig();
  my $bodytag=&Apache::loncommon::bodytag   my $start_page=&Apache::loncommon::start_page
     ('Enter Access Key to Unlock this Course');      ('Enter Access Key to Unlock this Course');
    my $end_page=&Apache::loncommon::end_page();
  $r->print(<<ENDENTERKEY);   $r->print(<<ENDENTERKEY);
 <head><title>Entering Course Access Key</title>  $start_page
 </head>  
 <html>  
 $bodytag  
 <script>  <script>
 $swinfo  $swinfo
 </script>  </script>
Line 218  $swinfo Line 211  $swinfo
 <input type="text" size="20" name="newkey" value="$env{'form.newkey'}" />  <input type="text" size="20" name="newkey" value="$env{'form.newkey'}" />
 <input type="submit" value="Enter key" />  <input type="submit" value="Enter key" />
 </form>  </form>
 </body></html>  $end_page
 ENDENTERKEY  ENDENTERKEY
  return OK;   return OK;
      }       }
Line 329  ENDENTERKEY Line 322  ENDENTERKEY
     return OK if $r->header_only;      return OK if $r->header_only;
   
     my $swinfo=&Apache::lonmenu::rawconfig();      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.');      my $standby=&mt('Role selected. Please stand by.');
     $standby=~s/\n/\\n/g;      $standby=~s/\n/\\n/g;
     my $helptag='<table><tr><td>'.&Apache::loncommon::help_open_menu('','General Intro','General_Intro','User Roles',1,undef,undef,undef,undef,,&mt("Click here for help")).'</td></td></tr></table>';      my $helptag='<table><tr><td>'.&Apache::loncommon::help_open_menu('','General Intro','General_Intro','User Roles',1,undef,undef,undef,undef,,&mt("Click here for help")).'</td></td></tr></table>';
     $r->print(<<ENDHEADER);      $r->print(<<ENDHEADER);
 <html>  $start_page
 <head>  
 <title>LON-CAPA User Roles</title>  
 </head>  
 $bodytag  
 $helptag<br />  $helptag<br />
 <script>  <script>
 $swinfo  $swinfo
Line 412  ENDHEADER Line 401  ENDHEADER
     } else {      } else {
  $r->print(&mt(' a certain'));   $r->print(&mt(' a certain'));
     }       } 
     $r->print(&mt(' course.').'</body></html>');      $r->print(&mt(' course.').
         &Apache::loncommon::end_page());
     return OK;      return OK;
         }           } 
     } else {      } else {
Line 601  ENDHEADER Line 591  ENDHEADER
  } else {   } else {
     $r->print('<h2>'.&mt('Currently no active roles or courses').'</h2>');      $r->print('<h2>'.&mt('Currently no active roles or courses').'</h2>');
  }   }
  $r->print('</form></body></html>');   $r->print('</form>'.&Apache::loncommon::end_page());
  return OK;   return OK;
 # Is there only one choice?  # Is there only one choice?
     } elsif (($countactive==1) && ($env{'request.role'} eq 'cm')) {      } elsif (($countactive==1) && ($env{'request.role'} eq 'cm')) {
Line 610  ENDHEADER Line 600  ENDHEADER
  $r->print("</form>\n");   $r->print("</form>\n");
  $r->rflush();   $r->rflush();
  $r->print('<script>document.forms.rolechoice.submit();</script>');   $r->print('<script>document.forms.rolechoice.submit();</script>');
  $r->print('</body></html>');   $r->print(&Apache::loncommon::end_page());
  return OK;   return OK;
     }      }
 # More than one possible role  # More than one possible role
Line 767  ENDHEADER Line 757  ENDHEADER
   $r->dir_config('lonVersion').'</i><br />'.    $r->dir_config('lonVersion').'</i><br />'.
   '<a href="/adm/logout">'.&mt('Logout').'</a></small></p>');    '<a href="/adm/logout">'.&mt('Logout').'</a></small></p>');
     }      }
     $r->print("</body></html>\n");      $r->print(&Apache::loncommon::end_page());
     return OK;      return OK;
 }  }
   

Removed from v.1.146  
changed lines
  Added in v.1.147


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