Diff for /loncom/interface/lonpreferences.pm between versions 1.53 and 1.60

version 1.53, 2005/02/17 08:29:43 version 1.60, 2005/06/06 02:29:46
Line 40  use DynaLoader; # for Crypt::DES version Line 40  use DynaLoader; # for Crypt::DES version
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lonhtmlcommon();  use Apache::lonhtmlcommon();
 use Apache::lonlocal;  use Apache::lonlocal;
   use Apache::lonnet;
   
 #  #
 # Write lonnet::passwd to do the call below.  # Write lonnet::passwd to do the call below.
Line 118  ENDLSCREEN Line 119  ENDLSCREEN
   
 sub verify_and_change_wysiwyg {  sub verify_and_change_wysiwyg {
     my $r = shift;      my $r = shift;
     my $newsetting=$ENV{'form.wysiwyg'};      my $newsetting=$env{'form.wysiwyg'};
     &Apache::lonnet::put('environment',{'wysiwygeditor' => $newsetting});      &Apache::lonnet::put('environment',{'wysiwygeditor' => $newsetting});
     &Apache::lonnet::appenv('environment.wysiwygeditor' => $newsetting);      &Apache::lonnet::appenv('environment.wysiwygeditor' => $newsetting);
     $r->print('<p>'.&mt('Setting WYSIWYG editor to:').' '.&mt($newsetting).'</p>');      $r->print('<p>'.&mt('Setting WYSIWYG editor to:').' '.&mt($newsetting).'</p>');
Line 129  sub verify_and_change_wysiwyg { Line 130  sub verify_and_change_wysiwyg {
 ################################################################  ################################################################
 sub languagechanger {  sub languagechanger {
     my $r = shift;      my $r = shift;
     my $user       = $ENV{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $ENV{'user.domain'};      my $domain     = $env{'user.domain'};
     my %userenv = &Apache::lonnet::get      my %userenv = &Apache::lonnet::get
         ('environment',['languages']);          ('environment',['languages']);
     my $language=$userenv{'languages'};      my $language=$userenv{'languages'};
Line 156  ENDLSCREEN Line 157  ENDLSCREEN
   
 sub verify_and_change_languages {  sub verify_and_change_languages {
     my $r = shift;      my $r = shift;
     my $user       = $ENV{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $ENV{'user.domain'};      my $domain     = $env{'user.domain'};
 # Screenname  # Screenname
     my $newlanguage  = $ENV{'form.language'};      my $newlanguage  = $env{'form.language'};
     $newlanguage=~s/[^\-\w]//g;      $newlanguage=~s/[^\-\w]//g;
     my $message='';      my $message='';
     if ($newlanguage) {      if ($newlanguage) {
Line 172  sub verify_and_change_languages { Line 173  sub verify_and_change_languages {
         $message='Reset preferred language';          $message='Reset preferred language';
     }      }
     $r->print(<<ENDVCSCREEN);      $r->print(<<ENDVCSCREEN);
 </p>  $message
   ENDVCSCREEN
   }
   
   ################################################################
   #         Tex Engine Change Subroutines                        #
   ################################################################
   sub texenginechanger {
       my $r = shift;
       my $user       = $env{'user.name'};
       my $domain     = $env{'user.domain'};
       my %userenv = &Apache::lonnet::get('environment',['texengine']);
       my $texengine=$userenv{'texengine'};
   
       my $pref=&mt('Preferred method to display Math');
       my %mathchoices=('' => 'No Preference',
        'tth' => 'TeX to HTML',
        'ttm' => 'TeX to MathML',
        'jsMath' => 'jsMath',
        'mimetex' => 'Convert to Images'
                        );
       my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine',
        %mathchoices);
       my $mathexample='$$\int\left(\frac{a+b}{c^6*d}\right)$$';
       my $jsMath_example=&Apache::lontexconvert::jsMath_converted(\$mathexample);
       $mathexample='$$\int\left(\frac{a+b}{c^6*d}\right)$$';
       my $tth_example=&Apache::lontexconvert::tth_converted(\$mathexample);
       $mathexample='$$\int\left(\frac{a+b}{c^6*d}\right)$$';
       my $mimetex_example=&Apache::lontexconvert::mimetex_converted(\$mathexample);
       my $change=&mt('Change');
       $r->print(<<ENDLSCREEN);
   <form name="server" action="/adm/preferences" method="post">
   <input type="hidden" name="action" value="verify_and_change_texengine" />
   <p>$pref: $selectionbox</p>
   <p><input type="submit" value="$change" /></p>
   </form>
   Examples:
   <p> TeX to HTML <br /> $tth_example</p>
   <script type="text/javascript">function NoFontMessage () { }</script>
   <script src="/adm/jsMath/jsMath.js"></script>
   <p>jsMath <br /> 
   
   <script type="text/javascript">
   if (jsMath.nofonts == 1) {
       document.writeln
           ('<center><div style="padding: 10; border-style: solid; border-width:3;'
    +' border-color: #DD0000; background-color: #FFF8F8; width: 75%; text-align: left">'
    +'<small><font color="#AA0000"><b>Warning:</b> '
    +'It looks like you don\\\'t have the TeX math fonts installed. '
    +'The jsMath example on this page may not look right without them. '
    +'The <a href="http://www.math.union.edu/locate/jsMath/" target="_blank"> '
    +'jsMath Home Page</a> has information on how to download the '
    +'needed fonts.  In the meantime, jsMath will do the best it can '
    +'with the fonts you have, but it may not be pretty and some equations '
    +'may not be rendered correctly. '
    +'</font></small></div></center>');
   }
   </script>
   
   $jsMath_example</p>
   <p> Convert to Images <br /> $mimetex_example</p>
   ENDLSCREEN
       if ($env{'environment.texengine'} ne 'jsMath') {
    $r->print('<script type="text/javascript">jsMath.Process()</script>');
       }
   }
   
   
   sub verify_and_change_texengine {
       my $r = shift;
       my $user       = $env{'user.name'};
       my $domain     = $env{'user.domain'};
   # Screenname
       my $newtexengine  = $env{'form.texengine'};
       $newtexengine=~s/[^\-\w]//g;
       if ($newtexengine eq 'ttm') {
    &Apache::lonnet::appenv('browser.mathml' => 1);
       } else {
    if ($env{'environment.texengine'} eq 'ttm') {
       &Apache::lonnet::appenv('browser.mathml' => 0);
    }
       }
       my $message='';
       if ($newtexengine) {
           &Apache::lonnet::put('environment',{'texengine' => $newtexengine});
           &Apache::lonnet::appenv('environment.texengine' => $newtexengine);
           $message='Set new preferred math display to '.$newtexengine;
       } else {
           &Apache::lonnet::del('environment',['texengine']);
           &Apache::lonnet::delenv('environment\.texengine');
           $message='Reset preferred math display.';
       }
   
   
       $r->print(<<ENDVCSCREEN);
 $message  $message
 ENDVCSCREEN  ENDVCSCREEN
 }  }
Line 182  ENDVCSCREEN Line 277  ENDVCSCREEN
 ################################################################  ################################################################
 sub rolesprefchanger {  sub rolesprefchanger {
     my $r = shift;      my $r = shift;
     my $user       = $ENV{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $ENV{'user.domain'};      my $domain     = $env{'user.domain'};
     my %userenv = &Apache::lonnet::get      my %userenv = &Apache::lonnet::get
         ('environment',['recentroles','recentrolesn']);          ('environment',['recentroles','recentrolesn']);
     my $hotlist_flag=$userenv{'recentroles'};      my $hotlist_flag=$userenv{'recentroles'};
Line 224  ENDSCREEN Line 319  ENDSCREEN
   
 sub verify_and_change_rolespref {  sub verify_and_change_rolespref {
     my $r = shift;      my $r = shift;
     my $user       = $ENV{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $ENV{'user.domain'};      my $domain     = $env{'user.domain'};
 # Recent Roles Hotlist Flag  # Recent Roles Hotlist Flag
     my $hotlist_flag  = $ENV{'form.recentroles'};      my $hotlist_flag  = $env{'form.recentroles'};
     my $hotlist_n  = $ENV{'form.recentrolesn'};      my $hotlist_n  = $env{'form.recentrolesn'};
     my $message='';      my $message='';
     if ($hotlist_flag) {      if ($hotlist_flag) {
         &Apache::lonnet::put('environment',{'recentroles' => $hotlist_flag});          &Apache::lonnet::put('environment',{'recentroles' => $hotlist_flag});
Line 248  sub verify_and_change_rolespref { Line 343  sub verify_and_change_rolespref {
     }      }
   
     $r->print(<<ENDRPSCREEN);      $r->print(<<ENDRPSCREEN);
 </p>  
 $message  $message
 ENDRPSCREEN  ENDRPSCREEN
 }  }
Line 260  ENDRPSCREEN Line 354  ENDRPSCREEN
 ################################################################  ################################################################
 sub screennamechanger {  sub screennamechanger {
     my $r = shift;      my $r = shift;
     my $user       = $ENV{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $ENV{'user.domain'};      my $domain     = $env{'user.domain'};
     my %userenv = &Apache::lonnet::get      my %userenv = &Apache::lonnet::get
         ('environment',['screenname','nickname']);          ('environment',['screenname','nickname']);
     my $screenname=$userenv{'screenname'};      my $screenname=$userenv{'screenname'};
Line 280  ENDSCREEN Line 374  ENDSCREEN
   
 sub verify_and_change_screenname {  sub verify_and_change_screenname {
     my $r = shift;      my $r = shift;
     my $user       = $ENV{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $ENV{'user.domain'};      my $domain     = $env{'user.domain'};
 # Screenname  # Screenname
     my $newscreen  = $ENV{'form.screenname'};      my $newscreen  = $env{'form.screenname'};
     $newscreen=~s/[^ \w]//g;      $newscreen=~s/[^ \w]//g;
     my $message='';      my $message='';
     if ($newscreen) {      if ($newscreen) {
Line 297  sub verify_and_change_screenname { Line 391  sub verify_and_change_screenname {
     }      }
 # Nickname  # Nickname
     $message.='<br />';      $message.='<br />';
     $newscreen  = $ENV{'form.nickname'};      $newscreen  = $env{'form.nickname'};
     $newscreen=~s/[^ \w]//g;      $newscreen=~s/[^ \w]//g;
     if ($newscreen) {      if ($newscreen) {
         &Apache::lonnet::put('environment',{'nickname' => $newscreen});          &Apache::lonnet::put('environment',{'nickname' => $newscreen});
Line 310  sub verify_and_change_screenname { Line 404  sub verify_and_change_screenname {
     }      }
   
     $r->print(<<ENDVCSCREEN);      $r->print(<<ENDVCSCREEN);
 </p>  
 $message  $message
 ENDVCSCREEN  ENDVCSCREEN
 }  }
Line 321  ENDVCSCREEN Line 414  ENDVCSCREEN
   
 sub msgforwardchanger {  sub msgforwardchanger {
     my $r = shift;      my $r = shift;
     my $user       = $ENV{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $ENV{'user.domain'};      my $domain     = $env{'user.domain'};
     my %userenv = &Apache::lonnet::get('environment',['msgforward','notification','critnotification']);      my %userenv = &Apache::lonnet::get('environment',['msgforward','notification','critnotification']);
     my $msgforward=$userenv{'msgforward'};      my $msgforward=$userenv{'msgforward'};
     my $notification=$userenv{'notification'};      my $notification=$userenv{'notification'};
Line 351  ENDMSG Line 444  ENDMSG
   
 sub verify_and_change_msgforward {  sub verify_and_change_msgforward {
     my $r = shift;      my $r = shift;
     my $user       = $ENV{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $ENV{'user.domain'};      my $domain     = $env{'user.domain'};
     my $newscreen  = '';      my $newscreen  = '';
     my $message='';      my $message='';
     foreach (split(/\,/,$ENV{'form.msgforward'})) {      foreach (split(/\,/,$env{'form.msgforward'})) {
  my ($msuser,$msdomain)=split(/[\@\:]/,$_);   my ($msuser,$msdomain)=split(/[\@\:]/,$_);
         $msuser=~s/\W//g;          $msuser=~s/\W//g;
         $msdomain=~s/\W//g;          $msdomain=~s/\W//g;
Line 377  sub verify_and_change_msgforward { Line 470  sub verify_and_change_msgforward {
         &Apache::lonnet::delenv('environment\.msgforward');          &Apache::lonnet::delenv('environment\.msgforward');
         $message.='Reset message forwarding<br />';          $message.='Reset message forwarding<br />';
     }      }
     my $notification=$ENV{'form.notification'};      my $notification=$env{'form.notification'};
     $notification=~s/\s//gs;      $notification=~s/\s//gs;
     if ($notification) {      if ($notification) {
         &Apache::lonnet::put('environment',{'notification' => $notification});          &Apache::lonnet::put('environment',{'notification' => $notification});
Line 388  sub verify_and_change_msgforward { Line 481  sub verify_and_change_msgforward {
         &Apache::lonnet::delenv('environment\.notification');          &Apache::lonnet::delenv('environment\.notification');
         $message.='Reset message notification<br />';          $message.='Reset message notification<br />';
     }      }
     my $critnotification=$ENV{'form.critnotification'};      my $critnotification=$env{'form.critnotification'};
     $critnotification=~s/\s//gs;      $critnotification=~s/\s//gs;
     if ($critnotification) {      if ($critnotification) {
         &Apache::lonnet::put('environment',{'critnotification' => $critnotification});          &Apache::lonnet::put('environment',{'critnotification' => $critnotification});
Line 400  sub verify_and_change_msgforward { Line 493  sub verify_and_change_msgforward {
         $message.='Reset critical message notification<br />';          $message.='Reset critical message notification<br />';
     }      }
     $r->print(<<ENDVCMSG);      $r->print(<<ENDVCMSG);
 </p>  
 $message  $message
 ENDVCMSG  ENDVCMSG
 }  }
Line 413  sub colorschanger { Line 505  sub colorschanger {
     my $r = shift;      my $r = shift;
 # figure out colors  # figure out colors
     my $function='student';      my $function='student';
     if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) {      if ($env{'request.role'}=~/^(cc|in|ta|ep)/) {
  $function='coordinator';   $function='coordinator';
     }      }
     if ($ENV{'request.role'}=~/^(su|dc|ad|li)/) {      if ($env{'request.role'}=~/^(su|dc|ad|li)/) {
  $function='admin';   $function='admin';
     }      }
     if (($ENV{'request.role'}=~/^(au|ca)/) ||      if (($env{'request.role'}=~/^(au|ca)/) ||
  ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) {   ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) {
  $function='author';   $function='author';
     }      }
Line 489  sub verify_and_change_colors { Line 581  sub verify_and_change_colors {
     my $r = shift;      my $r = shift;
 # figure out colors  # figure out colors
     my $function='student';      my $function='student';
     if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) {      if ($env{'request.role'}=~/^(cc|in|ta|ep)/) {
  $function='coordinator';   $function='coordinator';
     }      }
     if ($ENV{'request.role'}=~/^(su|dc|ad|li)/) {      if ($env{'request.role'}=~/^(su|dc|ad|li)/) {
  $function='admin';   $function='admin';
     }      }
     if (($ENV{'request.role'}=~/^(au|ca)/) ||      if (($env{'request.role'}=~/^(au|ca)/) ||
  ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) {   ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) {
  $function='author';   $function='author';
     }      }
Line 510  sub verify_and_change_colors { Line 602  sub verify_and_change_colors {
   
     my $message='';      my $message='';
     foreach my $item (keys %colortypes) {      foreach my $item (keys %colortypes) {
         my $color=$ENV{'form.'.$item};          my $color=$env{'form.'.$item};
         my $entry='color.'.$function.'.'.$item;          my $entry='color.'.$function.'.'.$item;
  if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$ENV{'form.resetall'})) {   if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$env{'form.resetall'})) {
     &Apache::lonnet::put('environment',{$entry => $color});      &Apache::lonnet::put('environment',{$entry => $color});
     &Apache::lonnet::appenv('environment.'.$entry => $color);      &Apache::lonnet::appenv('environment.'.$entry => $color);
     $message.='Set '.$colortypes{$item}.' to '.$color.'<br />';      $message.='Set '.$colortypes{$item}.' to '.$color.'<br />';
Line 523  sub verify_and_change_colors { Line 615  sub verify_and_change_colors {
  }   }
     }      }
     $r->print(<<ENDVCCOL);      $r->print(<<ENDVCCOL);
 </p>  
 $message  $message
 <form name="client" action="/adm/preferences" method="post">  <form name="client" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="changecolors" />  <input type="hidden" name="action" value="changecolors" />
Line 540  sub passwordchanger { Line 631  sub passwordchanger {
     my $r = shift;      my $r = shift;
     my $errormessage = shift;      my $errormessage = shift;
     $errormessage = ($errormessage || '');      $errormessage = ($errormessage || '');
     my $user       = $ENV{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $ENV{'user.domain'};      my $domain     = $env{'user.domain'};
     my $homeserver = $ENV{'user.home'};      my $homeserver = $env{'user.home'};
     my $currentauth=&Apache::lonnet::queryauthenticate($user,$domain);      my $currentauth=&Apache::lonnet::queryauthenticate($user,$domain);
     # Check for authentication types that allow changing of the password.      # Check for authentication types that allow changing of the password.
     return if ($currentauth !~ /^(unix|internal):/);      return if ($currentauth !~ /^(unix|internal):/);
Line 642  ENDFORM Line 733  ENDFORM
   
 sub verify_and_change_password {  sub verify_and_change_password {
     my $r = shift;      my $r = shift;
     my $user       = $ENV{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $ENV{'user.domain'};      my $domain     = $env{'user.domain'};
     my $homeserver = $ENV{'user.home'};      my $homeserver = $env{'user.home'};
     my $currentauth=&Apache::lonnet::queryauthenticate($user,$domain);      my $currentauth=&Apache::lonnet::queryauthenticate($user,$domain);
     # Check for authentication types that allow changing of the password.      # Check for authentication types that allow changing of the password.
     return if ($currentauth !~ /^(unix|internal):/);      return if ($currentauth !~ /^(unix|internal):/);
Line 657  $html Line 748  $html
 </head>  </head>
 ENDHEADER  ENDHEADER
     #      #
     my $currentpass = $ENV{'form.currentpass'};       my $currentpass = $env{'form.currentpass'}; 
     my $newpass1    = $ENV{'form.newpass_1'};       my $newpass1    = $env{'form.newpass_1'}; 
     my $newpass2    = $ENV{'form.newpass_2'};      my $newpass2    = $env{'form.newpass_2'};
     my $logtoken    = $ENV{'form.logtoken'};      my $logtoken    = $env{'form.logtoken'};
     # Check for empty data       # Check for empty data 
     unless (defined($currentpass) &&       unless (defined($currentpass) && 
     defined($newpass1)    &&       defined($newpass1)    && 
Line 745  ENDERROR Line 836  ENDERROR
 ################################################################  ################################################################
 sub discussionchanger {  sub discussionchanger {
     my $r = shift;      my $r = shift;
     my $user       = $ENV{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $ENV{'user.domain'};      my $domain     = $env{'user.domain'};
     my %userenv = &Apache::lonnet::get      my %userenv = &Apache::lonnet::get
         ('environment',['discdisplay','discmarkread']);          ('environment',['discdisplay','discmarkread']);
     my $discdisp = 'allposts';      my $discdisp = 'allposts';
Line 768  sub discussionchanger { Line 859  sub discussionchanger {
   
     my $function = &Apache::loncommon::get_users_function();      my $function = &Apache::loncommon::get_users_function();
     my $color = &Apache::loncommon::designparm($function.'.tabbg',      my $color = &Apache::loncommon::designparm($function.'.tabbg',
                                                     $ENV{'user.domain'});                                                      $env{'user.domain'});
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
         'pref' => 'Display Preference',          'pref' => 'Display Preference',
         'curr' => 'Current setting ',          'curr' => 'Current setting ',
Line 850  END Line 941  END
                                                                                                                                                                                                                                   
 sub verify_and_change_discussion {  sub verify_and_change_discussion {
     my $r = shift;      my $r = shift;
     my $user     = $ENV{'user.name'};      my $user     = $env{'user.name'};
     my $domain   = $ENV{'user.domain'};      my $domain   = $env{'user.domain'};
     my $message='';      my $message='';
     if (defined($ENV{'form.discdisp'}) ) {      if (defined($env{'form.discdisp'}) ) {
         my $newdisp  = $ENV{'form.newdisp'};          my $newdisp  = $env{'form.newdisp'};
         if ($newdisp eq 'unread') {          if ($newdisp eq 'unread') {
             $message .='In discussions: only new posts will be displayed.<br/>';              $message .='In discussions: only new posts will be displayed.<br/>';
             &Apache::lonnet::put('environment',{'discdisplay' => $newdisp});              &Apache::lonnet::put('environment',{'discdisplay' => $newdisp});
Line 865  sub verify_and_change_discussion { Line 956  sub verify_and_change_discussion {
             &Apache::lonnet::delenv('environment\.discdisplay');              &Apache::lonnet::delenv('environment\.discdisplay');
         }          }
     }      }
     if (defined($ENV{'form.discmark'}) ) {      if (defined($env{'form.discmark'}) ) {
         my $newmark = $ENV{'form.newmark'};          my $newmark = $env{'form.newmark'};
         if ($newmark eq 'ondisp') {          if ($newmark eq 'ondisp') {
            $message.='In discussions: new posts will be cease to be identified as "new" after display.<br/>';             $message.='In discussions: new posts will be cease to be identified as "new" after display.<br/>';
             &Apache::lonnet::put('environment',{'discmarkread' => $newmark});              &Apache::lonnet::put('environment',{'discmarkread' => $newmark});
Line 878  sub verify_and_change_discussion { Line 969  sub verify_and_change_discussion {
         }          }
     }      }
     $r->print(<<ENDVCSCREEN);      $r->print(<<ENDVCSCREEN);
 </p>  
 $message  $message
 ENDVCSCREEN  ENDVCSCREEN
 }  }
Line 892  ENDVCSCREEN Line 982  ENDVCSCREEN
 ################################################################  ################################################################
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
     my $user = $ENV{'user.name'};      my $user = $env{'user.name'};
     my $domain = $ENV{'user.domain'};      my $domain = $env{'user.domain'};
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     # Some pages contain DES keys and should not be cached.      # Some pages contain DES keys and should not be cached.
     &Apache::loncommon::no_cache($r);      &Apache::loncommon::no_cache($r);
Line 962  sub handler { Line 1052  sub handler {
                       printmenu => 'yes',                        printmenu => 'yes',
                       subroutine => \&verify_and_change_msgforward }));                        subroutine => \&verify_and_change_msgforward }));
     my $aboutmeaction=      my $aboutmeaction=
         '/adm/'.$ENV{'user.domain'}.'/'.$ENV{'user.name'}.'/aboutme';          '/adm/'.$env{'user.domain'}.'/'.$env{'user.name'}.'/aboutme';
     push (@Options,{ action => 'none',       push (@Options,{ action => 'none', 
                      linktext =>                       linktext =>
                          q{Edit the 'About Me' Personal Information Screen},                           q{Edit the 'About Me' Personal Information Screen},
Line 1048  sub handler { Line 1138  sub handler {
                       printmenu => 'yes',                        printmenu => 'yes',
                       }));                        }));
   
       push (@Options,({ action   => 'changetexenginepref',
                         linktext => 'Change How Math Equations Are Displayed',
                         href     => '/adm/preferences',
                         subroutine => \&texenginechanger,
                         breadcrumb =>
                             { href => '/adm/preferences?action=changetexenginepref',
                               text => 'Change Math Pref'},
                         },
                       { action   => 'verify_and_change_texengine',
                         subroutine => \&verify_and_change_texengine,
                         breadcrumb =>
                             { href => '/adm/preferences?action=changetexenginepref',
                               text => 'Change Math Preferences'},
                         printmenu => 'yes',
                         }));
   
   
     if ($ENV{'user.name'} =~ /^(albertel|fox|foxr|koretemey|korte|hallmat3|turtle)$/) {      if ($env{'user.name'} =~ /^(megan|albertel|fox|foxr|koretemey|korte|hallmat3|turtle)$/) {
         push (@Options,({ action => 'debugtoggle',          push (@Options,({ action => 'debugtoggle',
                           printmenu => 'yes',                            printmenu => 'yes',
                           subroutine => \&toggle_debug,                            subroutine => \&toggle_debug,
Line 1066  ENDHEADER Line 1172  ENDHEADER
     my $help = undef;      my $help = undef;
     my $printmenu = 'yes';      my $printmenu = 'yes';
     foreach my $option (@Options) {      foreach my $option (@Options) {
         if ($option->{'action'} eq $ENV{'form.action'}) {          if ($option->{'action'} eq $env{'form.action'}) {
             $call = $option->{'subroutine'};              $call = $option->{'subroutine'};
             $printmenu = $option->{'printmenu'};              $printmenu = $option->{'printmenu'};
             if (exists($option->{'breadcrumb'})) {              if (exists($option->{'breadcrumb'})) {
Line 1082  ENDHEADER Line 1188  ENDHEADER
     if (defined($call)) {      if (defined($call)) {
         $call->($r);          $call->($r);
     }      }
     if (($printmenu eq 'yes') && (!$ENV{'form.returnurl'})) {      if (($printmenu eq 'yes') && (!$env{'form.returnurl'})) {
         my $optionlist = '<table cellpadding="5">';          my $optionlist = '<table cellpadding="5">';
         if ($ENV{'user.name'} =~           if ($env{'user.name'} =~ 
                          /^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle)$/                           /^(megan|albertel|kortemey|fox|foxr|korte|hallmat3|turtle)$/
             ) {              ) {
             push (@Options,({ action => 'debugtoggle',              push (@Options,({ action => 'debugtoggle',
                               linktext => 'Toggle Debug Messages',                                linktext => 'Toggle Debug Messages',
                               text => 'Current Debug status is -'.                                text => 'Current Debug status is -'.
                                   $ENV{'user.debug'}.'-.',                                    $env{'user.debug'}.'-.',
                               href => '/adm/preferences',                                href => '/adm/preferences',
                               printmenu => 'yes',                                printmenu => 'yes',
                               subroutine => \&toggle_debug,                                subroutine => \&toggle_debug,
Line 1122  ENDHEADER Line 1228  ENDHEADER
         }          }
         $optionlist .= '</table>';          $optionlist .= '</table>';
         $r->print($optionlist);          $r->print($optionlist);
     } elsif ($ENV{'form.returnurl'}) {      } elsif ($env{'form.returnurl'}) {
  $r->print('<br /><a href="'.$ENV{'form.returnurl'}.'"><font size="+1">'.   $r->print('<br /><a href="'.$env{'form.returnurl'}.'"><font size="+1">'.
   &mt('Return').'</font></a>');    &mt('Return').'</font></a>');
     }      }
     $r->print(<<ENDFOOTER);      $r->print(&Apache::loncommon::endbodytag().'</html>');
 </body>  
 </html>  
 ENDFOOTER  
     return OK;      return OK;
 }  }
   
 sub toggle_debug {  sub toggle_debug {
     if ($ENV{'user.debug'}) {      if ($env{'user.debug'}) {
         &Apache::lonnet::delenv('user\.debug');          &Apache::lonnet::delenv('user\.debug');
     } else {      } else {
         &Apache::lonnet::appenv('user.debug' => 1);          &Apache::lonnet::appenv('user.debug' => 1);

Removed from v.1.53  
changed lines
  Added in v.1.60


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