version 1.125.4.1, 2009/05/20 15:05:19
|
version 1.125.4.8, 2009/10/09 04:13:55
|
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 204 sub texenginechanger {
|
Line 205 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=&Apache::loncommon::select_form($texengine,'texengine', |
%mathchoices); |
%mathchoices); |
Line 687 sub verify_and_change_domcoord {
|
Line 689 sub verify_and_change_domcoord {
|
if ($env{'form.construction'}) { $domcoord{'domcoord.author'}='blocked'; } |
if ($env{'form.construction'}) { $domcoord{'domcoord.author'}='blocked'; } |
&Apache::lonnet::put('environment',\%domcoord); |
&Apache::lonnet::put('environment',\%domcoord); |
&Apache::lonnet::appenv({'environment.domcoord.author' => $domcoord{'domcoord.author'}}); |
&Apache::lonnet::appenv({'environment.domcoord.author' => $domcoord{'domcoord.author'}}); |
|
my $status=''; |
|
if ($domcoord{'domcoord.author'} eq 'blocked') { |
|
$status=&mt('on'); |
|
} else { |
|
$status=&mt('off'); |
|
} |
my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Block access to construction space').'</i>','<tt>'.$status.'</tt>')); |
my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Block access to construction space').'</i>','<tt>'.$status.'</tt>')); |
$message=&Apache::loncommon::confirmwrapper($message); |
$message=&Apache::loncommon::confirmwrapper($message); |
$r->print(<<ENDVCSCREEN); |
$r->print(<<ENDVCSCREEN); |
Line 1283 sub jscript_send {
|
Line 1291 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 1302 sub client_form {
|
Line 1312 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 1345 sub client_form {
|
Line 1353 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 1367 sub server_form {
|
Line 1375 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 1509 ENDERROR
|
Line 1518 ENDERROR
|
my $result = &Apache::lonnet::changepass |
my $result = &Apache::lonnet::changepass |
($user,$domain,$currentpass,$newpass1,$homeserver,$caller); |
($user,$domain,$currentpass,$newpass1,$homeserver,$caller); |
# Inform the user the password has (not?) been changed |
# Inform the user the password has (not?) been changed |
|
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>')); |
if ($caller eq 'reset_by_email') { |
if ($caller eq 'reset_by_email') { |
$r->print($message.'<br />'); |
$r->print($message.'<br />'); |
} else { |
} else { |
Line 1518 ENDERROR
|
Line 1528 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 1548 sub discussionchanger {
|
Line 1561 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 1638 sub verify_and_change_discussion {
|
Line 1651 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 1742 sub verify_and_change_coursepage {
|
Line 1755 sub verify_and_change_coursepage {
|
$refpage.'">'.$lt{'dasp'}.'</a></font>'; |
$refpage.'">'.$lt{'dasp'}.'</a></font>'; |
} |
} |
} |
} |
$message = &Apache::lonhtmlcommon::confirm_success($message) |
$message = &Apache::lonhtmlcommon::confirm_success($message); |
$r->print(<<ENDVCSCREEN); |
$r->print(<<ENDVCSCREEN); |
$message |
$message |
ENDVCSCREEN |
ENDVCSCREEN |
Line 2028 sub handler {
|
Line 2041 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 2060 sub handler {
|
Line 2073 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 2108 sub handler {
|
Line 2119 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__ |