version 1.125.4.2, 2009/05/21 16:00:49
|
version 1.125.4.9, 2010/01/28 15:40:10
|
Line 42 use Apache::loncommon();
|
Line 42 use Apache::loncommon();
|
use Apache::lonhtmlcommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonnet; |
use Apache::lonnet; |
|
use LONCAPA::lonauthcgi(); |
use LONCAPA(); |
use LONCAPA(); |
|
|
# |
# |
Line 155 sub languagechanger {
|
Line 156 sub languagechanger {
|
= &Apache::loncommon::plainlanguagedescription($_); |
= &Apache::loncommon::plainlanguagedescription($_); |
} |
} |
} |
} |
my $selectionbox=&Apache::loncommon::select_form($language,'language', |
my $selectionbox= |
%langchoices); |
&Apache::loncommon::select_form( |
|
$language, |
|
'language', |
|
&Apache::lonlocal::texthash(%langchoices)); |
$r->print(<<ENDLSCREEN); |
$r->print(<<ENDLSCREEN); |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_languages" /> |
<input type="hidden" name="action" value="verify_and_change_languages" /> |
Line 204 sub texenginechanger {
|
Line 208 sub texenginechanger {
|
'tth' => 'tth (TeX to HTML)', |
'tth' => 'tth (TeX to HTML)', |
#'ttm' => 'TeX to MathML', |
#'ttm' => 'TeX to MathML', |
'jsMath' => 'jsMath', |
'jsMath' => 'jsMath', |
'mimetex' => 'mimetex (Convert to Images)' |
'mimetex' => 'mimetex (Convert to Images)', |
|
'raw' => 'Raw (Screen Reader)' |
); |
); |
my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine', |
my $selectionbox= |
%mathchoices); |
&Apache::loncommon::select_form( |
|
$texengine, |
|
'texengine', |
|
&Apache::lonlocal::texthash(%mathchoices)); |
my $jsMath_start=&Apache::lontexconvert::jsMath_header(); |
my $jsMath_start=&Apache::lontexconvert::jsMath_header(); |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'headline' => 'Change Math Preferences', |
'headline' => 'Change how math is displayed', |
'preftxt' => 'Preferred method to display Math', |
'preftxt' => 'Preferred method to display math', |
'change' => 'Save', |
'change' => 'Save', |
'exmpl' => 'Examples', |
'exmpl' => 'Examples', |
'jsmath' => 'jsMath:', |
'jsmath' => 'jsMath:', |
Line 266 if (jsMath.nofonts == 1) {
|
Line 274 if (jsMath.nofonts == 1) {
|
|
|
<h3>$lt{'tth'}</h3> |
<h3>$lt{'tth'}</h3> |
<p> |
<p> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="200"></iframe> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="220"></iframe> |
</p> |
</p> |
ENDLSCREEN |
ENDLSCREEN |
if ($env{'environment.texengine'} ne 'jsMath') { |
if ($env{'environment.texengine'} ne 'jsMath') { |
Line 375 sub rolesprefchanger {
|
Line 383 sub rolesprefchanger {
|
</p> |
</p> |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_rolespref" /> |
<input type="hidden" name="action" value="verify_and_change_rolespref" /> |
<br /><label>'.&mt('Enable Recent '.$role.'s Hotlist:').' |
<br />'. |
<input type="checkbox"'.$checked.' name="recentroles" value="true" /></label> |
'<h2>'.&mt('Recent '.$role.'s Hotlist').'</h2>'. |
<br />'.&mt('Number of '.$role.'s in Hotlist:').' |
&Apache::lonhtmlcommon::start_pick_box(). |
<select name="recentrolesn" size="1"> |
&Apache::lonhtmlcommon::row_title('<label for="Hotlist">'.&mt('Enable Recent '.$role.'s Hotlist').'</label>'). |
'.$options.' |
'<input id="Hotlist" type="checkbox"'.$checked.' name="recentroles" value="true" />'. |
</select> |
&Apache::lonhtmlcommon::row_closure(). |
<p>'.&mt('This list below can be used to <q>freeze</q> '.$lc_role.'s on your screen. Those marked as frozen will not be removed from the list, even if they have not been used recently.').' |
&Apache::lonhtmlcommon::row_title('<label for="NumberOfRoles">'.&mt('Number of '.$role.'s in Hotlist').'</label>'). |
|
'<select name="recentrolesn" size="1" id ="NumberOfRoles">'. |
|
$options. |
|
'</select>'. |
|
&Apache::lonhtmlcommon::row_closure(1). |
|
&Apache::lonhtmlcommon::end_pick_box(). |
|
'<br/><h2>'.&mt('Freeze Roles').'</h2>'. |
|
'<p>'.&mt('This list below can be used to <q>freeze</q> '.$lc_role.'s on your screen. Those marked as frozen will not be removed from the list, even if they have not been used recently.').' |
</p> |
</p> |
'.$roles_check_list.' |
'.$roles_check_list.' |
<br /> |
<br /> |
Line 431 sub verify_and_change_rolespref {
|
Line 446 sub verify_and_change_rolespref {
|
if ($hotlist_flag) { |
if ($hotlist_flag) { |
&Apache::lonnet::put('environment',{'recentroles' => $hotlist_flag}); |
&Apache::lonnet::put('environment',{'recentroles' => $hotlist_flag}); |
&Apache::lonnet::appenv({'environment.recentroles' => $hotlist_flag}); |
&Apache::lonnet::appenv({'environment.recentroles' => $hotlist_flag}); |
$message=&mt('Recent '.$role.'s Hotlist is Enabled'); |
$message=&Apache::lonhtmlcommon::confirm_success(&mt('Recent '.$role.'s Hotlist is Enabled.')." ".&mt('Display [_1] Most Recent '.$role.'s.',$hotlist_n)); |
} else { |
} else { |
&Apache::lonnet::del('environment',['recentroles']); |
&Apache::lonnet::del('environment',['recentroles']); |
&Apache::lonnet::delenv('environment.recentroles'); |
&Apache::lonnet::delenv('environment.recentroles'); |
$message=&mt('Recent '.$role.'s Hotlist is Disabled'); |
$message=&Apache::lonhtmlcommon::confirm_success(&mt('Recent '.$role.'s Hotlist is Disabled')); |
} |
} |
if ($hotlist_n) { |
if ($hotlist_n) { |
&Apache::lonnet::put('environment',{'recentrolesn' => $hotlist_n}); |
&Apache::lonnet::put('environment',{'recentrolesn' => $hotlist_n}); |
Line 750 sub msgforwardchanger {
|
Line 765 sub msgforwardchanger {
|
all => 'All', |
all => 'All', |
crit => 'Critical only', |
crit => 'Critical only', |
reg => 'Non-critical only', |
reg => 'Non-critical only', |
foad => 'Forwarding Address(es)', |
foad => 'Forward to account(s)', |
noti => 'Notification E-mail Address(es)', |
fwdm => 'Forward messages to other account(s) in LON-CAPA', |
|
noti => 'E-mail notification of LON-CAPA messages', |
foad_exmpl => 'e.g. <tt>userA:domain1,userB:domain2,...</tt>', |
foad_exmpl => 'e.g. <tt>userA:domain1,userB:domain2,...</tt>', |
mnot => 'E-mail Address(es) which should be notified about new LON-CAPA messages', |
mnot => 'E-mail Address(es) which should be notified about new LON-CAPA messages', |
mnot_exmpl => 'e.g. <tt>joe@doe.com</tt>', |
mnot_exmpl => 'e.g. <tt>joe@doe.com</tt>', |
Line 826 $validatescript
|
Line 842 $validatescript
|
$r->print(<<ENDMSG); |
$r->print(<<ENDMSG); |
$jscript |
$jscript |
$message |
$message |
<h3>$lt{'foad'} $forwardingHelp</h3> |
<h3>$lt{'fwdm'} $forwardingHelp</h3> |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_msgforward" /> |
<input type="hidden" name="action" value="verify_and_change_msgforward" /> |
$lt{'foad'} ($lt{'foad_exmpl'}): |
$lt{'foad'} ($lt{'foad_exmpl'}): |
<input type="text" size="40" value="$msgforward" name="msgforward" /><br /> |
<input type="text" size="40" value="$msgforward" name="msgforward" /> |
|
<br /><br /> |
<h3>$lt{'noti'} $notificationHelp</h3> |
<h3>$lt{'noti'} $notificationHelp</h3> |
$lt{'mnot'} ($lt{'mnot_exmpl'}):<br /> |
$lt{'mnot'} ($lt{'mnot_exmpl'}):<br /> |
ENDMSG |
ENDMSG |
Line 875 ENDMSG
|
Line 892 ENDMSG
|
'<input type="radio" name="notify_type_'.$num. |
'<input type="radio" name="notify_type_'.$num. |
'" value="'.$type.'" '.$chk{$type}. |
'" value="'.$type.'" '.$chk{$type}. |
' onchange="javascript:address_changes('."'$num'".')" />'. |
' onchange="javascript:address_changes('."'$num'".')" />'. |
$lt{$type}.'</label></span> '; |
$lt{$type}.'</label></span>'.(' ' x4); |
} |
} |
my $htmlon = ''; |
my $htmlon = ''; |
my $htmloff = ''; |
my $htmloff = ''; |
Line 887 ENDMSG
|
Line 904 ENDMSG
|
$output .= '</td><td><label><input type="radio" name="html_'.$num. |
$output .= '</td><td><label><input type="radio" name="html_'.$num. |
'" value="1" '.$htmlon. |
'" value="1" '.$htmlon. |
' onchange="javascript:address_changes('."'$num'".')" />'. |
' onchange="javascript:address_changes('."'$num'".')" />'. |
&mt('Yes').'</label> '. |
&mt('Yes').'</label>'.(' ' x3). |
'<label><input type="radio" name="html_'.$num.'" value="0" '. |
'<label><input type="radio" name="html_'.$num.'" value="0" '. |
$htmloff. ' onchange="javascript:address_changes('."'$num'". |
$htmloff. ' onchange="javascript:address_changes('."'$num'". |
')" />'. |
')" />'. |
Line 912 ENDMSG
|
Line 929 ENDMSG
|
$output .= '<span class="LC_nobreak"><label>'. |
$output .= '<span class="LC_nobreak"><label>'. |
'<input type="radio" name="notify_type_'.$num. |
'<input type="radio" name="notify_type_'.$num. |
'" value="'.$type.'" '.$defchk{$type}.'/>'. |
'" value="'.$type.'" '.$defchk{$type}.'/>'. |
$lt{$type}.'</label></span> '; |
$lt{$type}.'</label></span>'.(' ' x4); |
} |
} |
$output .= '</td><td><label><input type="radio" name="html_'.$num. |
$output .= '</td><td><label><input type="radio" name="html_'.$num. |
'" value="1" />'.&mt('Yes').'</label> '. |
'" value="1" />'.&mt('Yes').'</label>'.(' ' x3). |
'<label><input type="radio" name="html_'.$num.'" value="0" '. |
'<label><input type="radio" name="html_'.$num.'" value="0" '. |
' checked="checked" />'. |
' checked="checked" />'. |
&mt('No').'</label></td>'. |
&mt('No').'</label></td>'. |
Line 953 sub verify_and_change_msgforward {
|
Line 970 sub verify_and_change_msgforward {
|
my $domain = $env{'user.domain'}; |
my $domain = $env{'user.domain'}; |
my $newscreen = ''; |
my $newscreen = ''; |
my $message=''; |
my $message=''; |
foreach (split(/\,/,$env{'form.msgforward'})) { |
foreach my $recip (split(/\,/,$env{'form.msgforward'})) { |
my ($msuser,$msdomain)=split(/[\@\:]/,$_); |
my ($msuser,$msdomain); |
|
if ($recip =~ /:/) { |
|
($msuser,$msdomain)=split(':',$recip); |
|
} else { |
|
($msuser,$msdomain)=split(/\@/,$recip); |
|
} |
$msuser = &LONCAPA::clean_username($msuser); |
$msuser = &LONCAPA::clean_username($msuser); |
$msdomain = &LONCAPA::clean_domain($msdomain); |
$msdomain = &LONCAPA::clean_domain($msdomain); |
if (($msuser) && ($msdomain)) { |
if (($msuser) && ($msdomain)) { |
if (&Apache::lonnet::homeserver($msuser,$msdomain) ne 'no_host') { |
if (&Apache::lonnet::homeserver($msuser,$msdomain) ne 'no_host') { |
$newscreen.=$msuser.':'.$msdomain.','; |
$newscreen.=$msuser.':'.$msdomain.','; |
} else { |
} else { |
$message.= &mt('No such user: ').'<tt>'.$msuser.':'.$msdomain.'</tt><br />'; |
$message.= &mt('No such user: ').'<tt>'.$msuser.':'.$msdomain.'</tt><br />'; |
} |
} |
} |
} |
} |
} |
$newscreen=~s/\,$//; |
$newscreen=~s/\,$//; |
if ($newscreen) { |
if ($newscreen) { |
&Apache::lonnet::put('environment',{'msgforward' => $newscreen}); |
&Apache::lonnet::put('environment',{'msgforward' => $newscreen}); |
&Apache::lonnet::appenv({'environment.msgforward' => $newscreen}); |
&Apache::lonnet::appenv({'environment.msgforward' => $newscreen}); |
$message .= &mt('Set message forwarding to ').'<tt>"'.$newscreen.'"</tt>.' |
$message .= &Apache::lonhtmlcommon::confirm_success(&mt('Set message forwarding to ').'<tt>"'.$newscreen.'"</tt>.<br />'); |
.'<br />'; |
|
} else { |
} else { |
&Apache::lonnet::del('environment',['msgforward']); |
&Apache::lonnet::del('environment',['msgforward']); |
&Apache::lonnet::delenv('environment.msgforward'); |
&Apache::lonnet::delenv('environment.msgforward'); |
$message.= &mt("Set message forwarding to 'off'.").'<br />'; |
$message.= &Apache::lonhtmlcommon::confirm_success(&mt("Set message forwarding to 'off'.").'<br />'); |
} |
} |
my $critnotification; |
my $critnotification; |
my $notification; |
my $notification; |
Line 1010 sub verify_and_change_msgforward {
|
Line 1031 sub verify_and_change_msgforward {
|
if ($notification) { |
if ($notification) { |
&Apache::lonnet::put('environment',{'notification' => $notification}); |
&Apache::lonnet::put('environment',{'notification' => $notification}); |
&Apache::lonnet::appenv({'environment.notification' => $notification}); |
&Apache::lonnet::appenv({'environment.notification' => $notification}); |
$message.=&mt('Set non-critical message notification address(es) to ').'<tt>"'.$notification.'"</tt>.<br />'; |
$message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set non-critical message notification address(es) to ').'<tt>"'.$notification.'"</tt>.<br />'); |
} else { |
} else { |
&Apache::lonnet::del('environment',['notification']); |
&Apache::lonnet::del('environment',['notification']); |
&Apache::lonnet::delenv('environment.notification'); |
&Apache::lonnet::delenv('environment.notification'); |
$message.=&mt("Set non-critical message notification to 'off'.").'<br />'; |
$message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set non-critical message notification to 'off'.").'<br />'); |
} |
} |
if ($critnotification) { |
if ($critnotification) { |
&Apache::lonnet::put('environment',{'critnotification' => $critnotification}); |
&Apache::lonnet::put('environment',{'critnotification' => $critnotification}); |
&Apache::lonnet::appenv({'environment.critnotification' => $critnotification}); |
&Apache::lonnet::appenv({'environment.critnotification' => $critnotification}); |
$message.=&mt('Set critical message notification address(es) to ').'<tt>"'.$critnotification.'"</tt>.<br />'; |
$message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set critical message notification address(es) to ').'<tt>"'.$critnotification.'"</tt>.<br />'); |
} else { |
} else { |
&Apache::lonnet::del('environment',['critnotification']); |
&Apache::lonnet::del('environment',['critnotification']); |
&Apache::lonnet::delenv('environment.critnotification'); |
&Apache::lonnet::delenv('environment.critnotification'); |
$message.=&mt("Set critical message notification to 'off'.").'<br />'; |
$message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set critical message notification to 'off'.").'<br />'); |
} |
} |
if ($critnotification || $notification) { |
if ($critnotification || $notification) { |
if ($notify_with_html) { |
if ($notify_with_html) { |
&Apache::lonnet::put('environment',{'notifywithhtml' => $notify_with_html}); |
&Apache::lonnet::put('environment',{'notifywithhtml' => $notify_with_html}); |
&Apache::lonnet::appenv({'environment.notifywithhtml' => $notify_with_html}); |
&Apache::lonnet::appenv({'environment.notifywithhtml' => $notify_with_html}); |
$message.=&mt('Set address(es) to receive excerpts with html retained ').'<tt>"'.$notify_with_html.'"</tt>.'; |
$message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set address(es) to receive excerpts with html retained ').'<tt>"'.$notify_with_html.'"</tt>.'); |
} else { |
} else { |
&Apache::lonnet::del('environment',['notifywithhtml']); |
&Apache::lonnet::del('environment',['notifywithhtml']); |
&Apache::lonnet::delenv('environment.notifywithhtml'); |
&Apache::lonnet::delenv('environment.notifywithhtml'); |
if ($totaladdresses == 1) { |
if ($totaladdresses == 1) { |
$message.=&mt("Set notification address to receive excerpts with html stripped."); |
$message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set notification address to receive excerpts with html stripped.")); |
} else { |
} else { |
$message.=&mt("Set all notification addresses to receive excerpts with html stripped."); |
$message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set all notification addresses to receive excerpts with html stripped.")); |
} |
} |
} |
} |
} else { |
} else { |
Line 1047 sub verify_and_change_msgforward {
|
Line 1068 sub verify_and_change_msgforward {
|
$message .= '<br /><hr />'; |
$message .= '<br /><hr />'; |
} |
} |
&Apache::loncommon::flush_email_cache($user,$domain); |
&Apache::loncommon::flush_email_cache($user,$domain); |
|
$message=&Apache::loncommon::confirmwrapper($message); |
&msgforwardchanger($r,$message); |
&msgforwardchanger($r,$message); |
} |
} |
|
|
Line 1289 sub jscript_send {
|
Line 1311 sub jscript_send {
|
this.document.client.elements.uname.value; |
this.document.client.elements.uname.value; |
this.document.pserver.elements.udom.value = |
this.document.pserver.elements.udom.value = |
this.document.client.elements.udom.options[this.document.client.elements.udom.selectedIndex].value; |
this.document.client.elements.udom.options[this.document.client.elements.udom.selectedIndex].value; |
|
this.document.pserver.elements.email.value = |
|
this.document.client.elements.email.value; |
|; |
|; |
} |
} |
$ output .= qq| |
$ output .= qq| |
Line 1308 sub client_form {
|
Line 1332 sub client_form {
|
'newpass' => 'New Password', |
'newpass' => 'New Password', |
'confirmpass' => 'Confirm Password', |
'confirmpass' => 'Confirm Password', |
'changepass' => 'Save'); |
'changepass' => 'Save'); |
|
my $output = '<form name="client">' |
my $output = qq| |
.&Apache::lonhtmlcommon::start_pick_box(); |
<form name="client" > |
|
<table> |
|
|; |
|
if ($caller eq 'reset_by_email') { |
if ($caller eq 'reset_by_email') { |
$output .= qq| |
$output .= &Apache::lonhtmlcommon::row_title( |
<tr><td class="LC_preferences_labeltext"><label for="email">$lt{'email'}</label>:</td> |
'<label for="email">'.$lt{'email'}.'</label>') |
<td><input type="text" name="email" size="30" /> </td></tr> |
.'<input type="text" name="email" size="30" />' |
<tr><td class="LC_preferences_labeltext"><label for="uname">$lt{'username'}</label>:</td> |
.&Apache::lonhtmlcommon::row_closure() |
<td> |
.&Apache::lonhtmlcommon::row_title( |
<input type="text" name="uname" size="15" /> |
'<label for="uname">'.$lt{'username'}.'</label>') |
<input type="hidden" name="currentpass" value="$currentpass" /> |
.'<input type="text" name="uname" size="15" />' |
</td></tr> |
.'<input type="hidden" name="currentpass" value="'.$currentpass.'" />' |
<tr><td class="LC_preferences_labeltext"><label for="udom">$lt{'domain'}</label>:</td> |
.&Apache::lonhtmlcommon::row_closure() |
<td> |
.&Apache::lonhtmlcommon::row_title( |
|; |
'<label for="udom">'.$lt{'domain'}.'</label>') |
$output .= &Apache::loncommon::select_dom_form($defdom,'udom').' |
.&Apache::loncommon::select_dom_form($defdom,'udom') |
</td> |
.&Apache::lonhtmlcommon::row_closure(); |
</tr> |
|
'; |
|
} else { |
} else { |
$output .= qq| |
$output .= &Apache::lonhtmlcommon::row_title( |
<tr><td class="LC_preferences_labeltext"><label for="currentpass">$lt{'currentpass'}</label></td> |
'<label for="currentpass">'.$lt{'currentpass'}.'</label>') |
<td><input type="password" name="currentpass" size="10"/> </td></tr> |
.'<input type="password" name="currentpass" size="10"/>' |
|; |
.&Apache::lonhtmlcommon::row_closure(); |
} |
} |
$output .= <<"ENDFORM"; |
$output .= &Apache::lonhtmlcommon::row_title( |
<tr><td class="LC_preferences_labeltext"><label for="newpass_1">$lt{'newpass'}</label></td> |
'<label for="newpass_1">'.$lt{'newpass'}.'</label>') |
<td><input type="password" name="newpass_1" size="10" /> </td></tr> |
.'<input type="password" name="newpass_1" size="10" />' |
<tr><td class="LC_preferences_labeltext"><label for="newpass_2">$lt{'confirmpass'}</label></td> |
.&Apache::lonhtmlcommon::row_closure() |
<td><input type="password" name="newpass_2" size="10" /> </td></tr> |
.&Apache::lonhtmlcommon::row_title( |
<tr><td colspan="2" align="center"> |
'<label for="newpass_2">'.$lt{'confirmpass'}.'</label>') |
<input type="button" value="$lt{'changepass'}" onClick="send();" /> |
.'<input type="password" name="newpass_2" size="10" />' |
</table> |
.&Apache::lonhtmlcommon::row_closure(1) |
|
.&Apache::lonhtmlcommon::end_pick_box(); |
|
$output .= '<p><input type="button" value="'.$lt{'changepass'}.'" onClick="send();" /></p>' |
|
.qq| |
<input type="hidden" name="ukey_cpass" value="$hexkey->{'ukey_cpass'}" /> |
<input type="hidden" name="ukey_cpass" value="$hexkey->{'ukey_cpass'}" /> |
<input type="hidden" name="lkey_cpass" value="$hexkey->{'lkey_cpass'}" /> |
<input type="hidden" name="lkey_cpass" value="$hexkey->{'lkey_cpass'}" /> |
<input type="hidden" name="ukey_npass1" value="$hexkey->{'ukey_npass1'}" /> |
<input type="hidden" name="ukey_npass1" value="$hexkey->{'ukey_npass1'}" /> |
Line 1351 sub client_form {
|
Line 1373 sub client_form {
|
<input type="hidden" name="lkey_npass2" value="$hexkey->{'lkey_npass2'}" /> |
<input type="hidden" name="lkey_npass2" value="$hexkey->{'lkey_npass2'}" /> |
</form> |
</form> |
</p> |
</p> |
ENDFORM |
|; |
return $output; |
return $output; |
} |
} |
|
|
Line 1373 sub server_form {
|
Line 1395 sub server_form {
|
<input type="hidden" name="token" value="$mailtoken" /> |
<input type="hidden" name="token" value="$mailtoken" /> |
<input type="hidden" name="uname" value="" /> |
<input type="hidden" name="uname" value="" /> |
<input type="hidden" name="udom" value="" /> |
<input type="hidden" name="udom" value="" /> |
|
<input type="hidden" name="email" value="" /> |
|
|
|; |
|; |
} |
} |
Line 1517 ENDERROR
|
Line 1540 ENDERROR
|
# Inform the user the password has (not?) been changed |
# Inform the user the password has (not?) been changed |
my $message; |
my $message; |
if ($result =~ /^ok$/) { |
if ($result =~ /^ok$/) { |
$message = &Apache::lonhtmlcommon::confirm_success(&mt('The password for user [_1] was successfully changed.','<i>'.$user.'<i>')); |
$message = &Apache::lonhtmlcommon::confirm_success(&mt('The password for user [_1] was successfully changed.','<i>'.$user.'</i>')); |
|
$message = &Apache::loncommon::confirmwrapper($message); |
if ($caller eq 'reset_by_email') { |
if ($caller eq 'reset_by_email') { |
$r->print($message.'<br />'); |
$r->print($message.'<br />'); |
} else { |
} else { |
Line 1525 ENDERROR
|
Line 1549 ENDERROR
|
} |
} |
} else { |
} else { |
# error error: run in circles, scream and shout |
# error error: run in circles, scream and shout |
$message = &Apache::lonhtmlcommon::confirm_success( |
|
&mt("The password for user [_1] was not changed.",'<i>'.$user.'</i>').' '.&mt('Please make sure your old password was entered correctly.'),1); |
|
if ($caller eq 'reset_by_email') { |
if ($caller eq 'reset_by_email') { |
$r->print($message.'<br />'); |
if (!$result) { |
|
return 1; |
|
} else { |
|
return $result; |
|
} |
} else { |
} else { |
|
$message = &Apache::lonhtmlcommon::confirm_success( |
|
&mt("The password for user [_1] was not changed.",'<i>'.$user.'</i>').' '.&mt('Please make sure your old password was entered correctly.'),1); |
$r->print(&Apache::loncommon::confirmwrapper($message)); |
$r->print(&Apache::loncommon::confirmwrapper($message)); |
} |
} |
return 1; |
|
} |
} |
return; |
return; |
} |
} |
Line 1555 sub discussionchanger {
|
Line 1582 sub discussionchanger {
|
} |
} |
} |
} |
if (defined($userenv{'discmarkread'})) { |
if (defined($userenv{'discmarkread'})) { |
unless ($userenv{'discdisplay'} eq '') { |
unless ($userenv{'discmarkread'} eq '') { |
$discmark = $userenv{'discmarkread'}; |
$discmark = $userenv{'discmarkread'}; |
} |
} |
} |
} |
Line 1645 sub verify_and_change_discussion {
|
Line 1672 sub verify_and_change_discussion {
|
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 .=&mt('In discussions: only new posts will be displayed.').'<br />'; |
$message .= &Apache::lonhtmlcommon::confirm_success(&mt('In discussions: only new posts will be displayed.')).'<br />'; |
&Apache::lonnet::put('environment',{'discdisplay' => $newdisp}); |
&Apache::lonnet::put('environment',{'discdisplay' => $newdisp}); |
&Apache::lonnet::appenv({'environment.discdisplay' => $newdisp}); |
&Apache::lonnet::appenv({'environment.discdisplay' => $newdisp}); |
} else { |
} else { |
$message .= &mt('In discussions: all posts will be displayed.').'<br />'; |
$message .= &Apache::lonhtmlcommon::confirm_success(&mt('In discussions: all posts will be displayed.')).'<br />'; |
&Apache::lonnet::del('environment',['discdisplay']); |
&Apache::lonnet::del('environment',['discdisplay']); |
&Apache::lonnet::delenv('environment.discdisplay'); |
&Apache::lonnet::delenv('environment.discdisplay'); |
} |
} |
Line 1743 sub verify_and_change_coursepage {
|
Line 1770 sub verify_and_change_coursepage {
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my ($furl,$ferr)= |
my ($furl,$ferr)= |
&Apache::lonuserstate::readmap($cdom.'/'.$cnum); |
&Apache::lonuserstate::readmap($cdom.'/'.$cnum); |
$message .= '<br /><font size="+1"><a href="'.$furl.'">'.$lt{'gtts'}.' <i>'.&mt('now').'</i></a></font>'; |
$message .= '<br /><a href="'.$furl.'">'.$lt{'gtts'}.' <i>'.&mt('now').'</i></a>'; |
} else { |
} else { |
$message .= '<br /><font size="+1"><a href="/adm/whatsnew?refpage='. |
$message .= '<br /><a href="/adm/whatsnew?refpage='. |
$refpage.'">'.$lt{'dasp'}.'</a></font>'; |
$refpage.'">'.$lt{'dasp'}.'</a>'; |
} |
} |
} |
} |
$message = &Apache::lonhtmlcommon::confirm_success($message); |
$message = &Apache::lonhtmlcommon::confirm_success($message); |
|
$message = &Apache::loncommon::confirmwrapper($message); |
$r->print(<<ENDVCSCREEN); |
$r->print(<<ENDVCSCREEN); |
$message |
$message |
ENDVCSCREEN |
ENDVCSCREEN |
} |
} |
|
|
|
|
###################################################### |
###################################################### |
# other handler subroutines # |
# other handler subroutines # |
###################################################### |
###################################################### |
Line 1825 sub handler {
|
Line 1852 sub handler {
|
help => 'Prefs_Messages', |
help => 'Prefs_Messages', |
breadcrumb => |
breadcrumb => |
{ href => '/adm/preferences?action=changemsgforward', |
{ href => '/adm/preferences?action=changemsgforward', |
text => 'Change Message Forwarding/Notification'}, |
|
|
text => 'Messages & Notifications'}, |
subroutine => \&msgforwardchanger, |
subroutine => \&msgforwardchanger, |
}, |
}, |
{ action => 'verify_and_change_msgforward', |
{ action => 'verify_and_change_msgforward', |
help => 'Prefs_Messages', |
help => 'Prefs_Messages', |
breadcrumb => |
breadcrumb => |
{ href => '/adm/preferences?action=changemsgforward', |
{ href => '/adm/preferences?action=changemsgforward', |
text => 'Change Message Forwarding/Notification'}, |
text => 'Messages & Notifications'}, |
printmenu => 'no', |
printmenu => 'no', |
subroutine => \&verify_and_change_msgforward })); |
subroutine => \&verify_and_change_msgforward })); |
if (&Apache::lonnet::usertools_access($user,$domain,'aboutme')) { |
if (&Apache::lonnet::usertools_access($user,$domain,'aboutme')) { |
Line 1924 sub handler {
|
Line 1952 sub handler {
|
})); |
})); |
|
|
push (@Options,({ action => 'changetexenginepref', |
push (@Options,({ action => 'changetexenginepref', |
linktext => 'Change How Math Equations Are Displayed', |
linktext => 'Math display settings', |
href => '/adm/preferences', |
href => '/adm/preferences', |
subroutine => \&texenginechanger, |
subroutine => \&texenginechanger, |
breadcrumb => |
breadcrumb => |
{ href => '/adm/preferences?action=changetexenginepref', |
{ href => '/adm/preferences?action=changetexenginepref', |
text => 'Change Math Pref'}, |
text => 'Math display settings'}, |
}, |
}, |
{ action => 'verify_and_change_texengine', |
{ action => 'verify_and_change_texengine', |
subroutine => \&verify_and_change_texengine, |
subroutine => \&verify_and_change_texengine, |
Line 2035 sub handler {
|
Line 2063 sub handler {
|
})); |
})); |
} |
} |
|
|
if ($env{'user.name'} =~ /^(albertel|fox|foxr|kortemey|korte|raeburn)$/) { |
if (&can_toggle_debug()) { |
push (@Options,({ action => 'debugtoggle', |
push (@Options,({ action => 'debugtoggle', |
printmenu => 'yes', |
printmenu => 'yes', |
subroutine => \&toggle_debug, |
subroutine => \&toggle_debug, |
Line 2067 sub handler {
|
Line 2095 sub handler {
|
|| ($printmenu eq 'not_on_error' && !$error) ) |
|| ($printmenu eq 'not_on_error' && !$error) ) |
&& (!$env{'form.returnurl'})) { |
&& (!$env{'form.returnurl'})) { |
my $optionlist = '<table cellpadding="5">'; |
my $optionlist = '<table cellpadding="5">'; |
if ($env{'user.name'} =~ |
if (&can_toggle_debug()) { |
/^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle|raeburn)$/ |
|
) { |
|
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'} ? 'on' : 'off'), |
href => '/adm/preferences', |
href => '/adm/preferences', |
printmenu => 'yes', |
printmenu => 'yes', |
subroutine => \&toggle_debug, |
subroutine => \&toggle_debug, |
Line 2115 sub handler {
|
Line 2141 sub handler {
|
} |
} |
|
|
sub toggle_debug { |
sub toggle_debug { |
if ($env{'user.debug'}) { |
if (&can_toggle_debug()) { |
&Apache::lonnet::delenv('user.debug'); |
if ($env{'user.debug'}) { |
} else { |
&Apache::lonnet::delenv('user.debug'); |
&Apache::lonnet::appenv({'user.debug' => 1}); |
} else { |
|
&Apache::lonnet::appenv({'user.debug' => 1}); |
|
} |
} |
} |
} |
} |
|
|
|
sub can_toggle_debug { |
|
my $can_toggle = 0; |
|
my $page = 'toggledebug'; |
|
if (&LONCAPA::lonauthcgi::can_view($page)) { |
|
$can_toggle = 1; |
|
} elsif (&LONCAPA::lonauthcgi::check_ipbased_access($page)) { |
|
$can_toggle = 1; |
|
} |
|
return $can_toggle; |
|
} |
|
|
|
|
1; |
1; |
__END__ |
__END__ |