version 1.217, 2016/01/27 00:24:09
|
version 1.228, 2019/04/24 01:44:30
|
Line 160 sub texenginechanger {
|
Line 160 sub texenginechanger {
|
my $domain = $env{'user.domain'}; |
my $domain = $env{'user.domain'}; |
my %userenv = &Apache::lonnet::get('environment',['texengine']); |
my %userenv = &Apache::lonnet::get('environment',['texengine']); |
my $texengine=$userenv{'texengine'}; |
my $texengine=$userenv{'texengine'}; |
|
if (lc($texengine) eq 'jsmath') { |
|
$texengine = 'MathJax'; |
|
} |
|
|
my %mathchoices=('' => 'Default', |
my %mathchoices=('' => 'Default', |
'tth' => 'tth (TeX to HTML)', |
'tth' => 'tth (TeX to HTML)', |
#'ttm' => 'TeX to MathML', |
#'ttm' => 'TeX to MathML', |
'jsMath' => 'jsMath', |
|
'MathJax' => 'MathJax', |
'MathJax' => 'MathJax', |
'mimetex' => 'mimetex (Convert to Images)', |
'mimetex' => 'mimetex (Convert to Images)', |
'raw' => 'Raw (Screen Reader)' |
'raw' => 'Raw (Screen Reader)' |
Line 176 sub texenginechanger {
|
Line 178 sub texenginechanger {
|
'texengine', |
'texengine', |
\%mathchoices); |
\%mathchoices); |
my $MathJax_start=&Apache::lontexconvert::MathJax_header(); |
my $MathJax_start=&Apache::lontexconvert::MathJax_header(); |
my $jsMath_start=&Apache::lontexconvert::jsMath_header(); |
|
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'headline' => 'Change how math is displayed', |
'headline' => 'Change how math is displayed', |
'preftxt' => 'Preferred method to display math', |
'preftxt' => 'Preferred method to display math', |
Line 184 sub texenginechanger {
|
Line 185 sub texenginechanger {
|
'exmpl' => 'Examples', |
'exmpl' => 'Examples', |
'mathjax' => 'MathJax:', |
'mathjax' => 'MathJax:', |
'mathjaxinfo' => 'MathJax provides rendered equations whose source code can be extracted in TeX and MathML formats by right clicking the equation.', |
'mathjaxinfo' => 'MathJax provides rendered equations whose source code can be extracted in TeX and MathML formats by right clicking the equation.', |
'jsmath' => 'jsMath:', |
|
'tth' => 'tth (TeX to HTML):', |
'tth' => 'tth (TeX to HTML):', |
'mimetex' => 'mimetex (Convert to Images):', |
'mimetex' => 'mimetex (Convert to Images):', |
); |
); |
|
|
my $jsMathWarning='<p>' |
|
.'<div class="LC_warning">' |
|
.&mt("It looks like you don't have the TeX math fonts installed.") |
|
.'</div>' |
|
.'<div>' |
|
.&mt('The jsMath example on this page may not look right without them. ' |
|
.'The [_1]jsMath Home Page[_2] 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.' |
|
,'<a href="http://www.math.union.edu/locate/jsMath/" target="_blank">' |
|
,'</a>') |
|
.'</div>' |
|
.'</p>'; |
|
|
|
$r->print(<<ENDLSCREEN); |
$r->print(<<ENDLSCREEN); |
<h2>$lt{'headline'}</h2> |
<h2>$lt{'headline'}</h2> |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
Line 226 $lt{'exmpl'}
|
Line 211 $lt{'exmpl'}
|
$lt{'mathjaxinfo'} |
$lt{'mathjaxinfo'} |
</p> |
</p> |
|
|
<h3>$lt{'jsmath'}</h3> |
|
<p> |
|
$jsMath_start |
|
<script type="text/javascript" language="JavaScript"> |
|
if (jsMath.nofonts == 1) { |
|
document.writeln($jsMathWarning); |
|
} |
|
|
|
</script> |
|
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=jsMath" width="400" height="150"></iframe> |
|
</p> |
|
|
|
<h3>$lt{'mimetex'}</h3> |
<h3>$lt{'mimetex'}</h3> |
<p> |
<p> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=mimetex" width="400" height="150"></iframe> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=mimetex" width="400" height="150"></iframe> |
Line 248 if (jsMath.nofonts == 1) {
|
Line 221 if (jsMath.nofonts == 1) {
|
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="150"></iframe> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="150"></iframe> |
</p> |
</p> |
ENDLSCREEN |
ENDLSCREEN |
if ($env{'environment.texengine'} ne 'jsMath') { |
|
$r->print('<script type="text/javascript" language="JavaScript">jsMath.Process()</script>'); |
|
} |
|
} |
} |
|
|
|
|
Line 261 sub verify_and_change_texengine {
|
Line 231 sub verify_and_change_texengine {
|
# Screenname |
# Screenname |
my $newtexengine = $env{'form.texengine'}; |
my $newtexengine = $env{'form.texengine'}; |
$newtexengine=~s/[^\-\w]//g; |
$newtexengine=~s/[^\-\w]//g; |
|
if (lc($newtexengine) eq 'jsmath') { |
|
$newtexengine = 'MathJax'; |
|
} |
if ($newtexengine eq 'ttm') { |
if ($newtexengine eq 'ttm') { |
&Apache::lonnet::appenv({'browser.mathml' => 1}); |
&Apache::lonnet::appenv({'browser.mathml' => 1}); |
} else { |
} else { |
Line 504 sub verify_and_change_rolespref {
|
Line 477 sub verify_and_change_rolespref {
|
} |
} |
|
|
|
|
|
|
################################################################ |
################################################################ |
# Anonymous Discussion Name Change Subroutines # |
# Anonymous Discussion Name Change Subroutines # |
################################################################ |
################################################################ |
Line 713 sub verify_and_change_clicker {
|
Line 685 sub verify_and_change_clicker {
|
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 $uhome = $env{'user.home'}; |
my $newclickers = $env{'form.clickers'}; |
my $newclickers = $env{'form.clickers'}; |
|
my $message; |
$newclickers=~s/[^\w\:\-]+/\,/gs; |
$newclickers=~s/[^\w\:\-]+/\,/gs; |
$newclickers=~tr/a-z/A-Z/; |
$newclickers=~tr/a-z/A-Z/; |
$newclickers=~s/[\:\-]+/\-/g; |
$newclickers=~s/[\:\-]+/\-/g; |
$newclickers=~s/\,+/\,/g; |
$newclickers=~s/\,+/\,/g; |
$newclickers=~s/^\,//; |
$newclickers=~s/^\,//; |
$newclickers=~s/\,$//; |
$newclickers=~s/\,$//; |
&Apache::lonnet::put('environment',{'clickers' => $newclickers}); |
my @oldclickers = split(/,/,$env{'environment.clickers'}); |
&Apache::lonnet::appenv({'environment.clickers' => $newclickers}); |
my @newclickers = split(/,/,$newclickers); |
my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Registering clickers: [_1]',$newclickers)); |
my %newuniq; |
|
map { $newuniq{$_} = 1; } @newclickers; |
|
@newclickers = sort(keys(%newuniq)); |
|
my @differences = &Apache::loncommon::compare_arrays(\@oldclickers,\@newclickers); |
|
if (@differences) { |
|
my $putres = &Apache::lonnet::put('environment',{'clickers' => $newclickers}); |
|
if ($putres eq 'ok') { |
|
my @adds = (); |
|
my @dels = (); |
|
foreach my $item (@differences) { |
|
if (grep(/^\Q$item\E$/,@newclickers)) { |
|
push(@adds,$item); |
|
} else { |
|
push(@dels,$item); |
|
} |
|
} |
|
if (@dels) { |
|
my %delclicker; |
|
map { $delclicker{$_} = $user; } @dels; |
|
my $putresult = &Apache::lonnet::iddel($domain,\%delclicker,$uhome,'clickers'); |
|
} |
|
if (@adds) { |
|
my %addclicker; |
|
map { $addclicker{$_} = $user; } @adds; |
|
my $putresult = &Apache::lonnet::updateclickers($domain,'add',\%addclicker,$uhome,1); |
|
} |
|
&Apache::lonnet::appenv({'environment.clickers' => $newclickers}); |
|
$message=&Apache::lonhtmlcommon::confirm_success(&mt('Registering clickers: [_1]',$newclickers)); |
|
} else { |
|
$message=&Apache::lonhtmlcommon::confirm_success(&mt('Error saving clicker ID').1); |
|
} |
|
} else { |
|
$message='<span class="LC_info">'.&mt('Clicker information unchanged').'</span>'; |
|
} |
$message=&Apache::loncommon::confirmwrapper($message); |
$message=&Apache::loncommon::confirmwrapper($message); |
&print_main_menu($r, $message); |
&print_main_menu($r, $message); |
} |
} |
Line 749 sub domcoordchanger {
|
Line 756 sub domcoordchanger {
|
my $text=&mt('By default, the Domain Coordinator can enter your Authoring Space.'); |
my $text=&mt('By default, the Domain Coordinator can enter your Authoring Space.'); |
my $construction=&mt('Block access to Authoring Space'); |
my $construction=&mt('Block access to Authoring Space'); |
my $change=&mt('Save'); |
my $change=&mt('Save'); |
|
my $returnurl = &HTML::Entities::encode($env{'form.returnurl'},'"<>&\''); |
$r->print(<<ENDSCREEN); |
$r->print(<<ENDSCREEN); |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
|
<input type="hidden" name="returnurl" value="$returnurl" /> |
<input type="hidden" name="action" value="verify_and_change_domcoord" /> |
<input type="hidden" name="action" value="verify_and_change_domcoord" /> |
$text<br /> |
$text<br /> |
<label><input type="checkbox" name="construction"$constchecked />$construction</label><br /> |
<label><input type="checkbox" name="construction"$constchecked />$construction</label><br /> |
Line 775 sub verify_and_change_domcoord {
|
Line 784 sub verify_and_change_domcoord {
|
} |
} |
my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Block access to Authoring Space').'</i>','<tt>'.$status.'</tt>')); |
my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Block access to Authoring Space').'</i>','<tt>'.$status.'</tt>')); |
$message=&Apache::loncommon::confirmwrapper($message); |
$message=&Apache::loncommon::confirmwrapper($message); |
&print_main_menu($r,$message); |
if ($env{'form.returnurl'}) { |
|
&do_redirect($r,$env{'form.returnurl'},$message); |
|
} else { |
|
&print_main_menu($r,$message); |
|
} |
} |
} |
|
|
################################################################# |
################################################################# |
Line 1250 sub verify_and_change_colors {
|
Line 1263 sub verify_and_change_colors {
|
# password handler subroutines # |
# password handler subroutines # |
###################################################### |
###################################################### |
sub passwordchanger { |
sub passwordchanger { |
my ($r,$errormessage,$caller,$mailtoken) = @_; |
my ($r,$errormessage,$caller,$mailtoken,$timelimit,$extrafields) = @_; |
# This function is a bit of a mess.... |
# This function is a bit of a mess.... |
# Passwords are encrypted using londes.js (DES encryption) |
# Passwords are encrypted using londes.js (DES encryption) |
$errormessage = ($errormessage || ''); |
$errormessage = ($errormessage || ''); |
Line 1286 sub passwordchanger {
|
Line 1299 sub passwordchanger {
|
return; |
return; |
} |
} |
if (defined($data{time})) { |
if (defined($data{time})) { |
if (time - $data{'time'} < 7200) { |
if (time - $data{'time'} < $timelimit) { |
$user = $data{'username'}; |
$user = $data{'username'}; |
$domain = $data{'domain'}; |
$domain = $data{'domain'}; |
$currentpass = $data{'temppasswd'}; |
$currentpass = $data{'temppasswd'}; |
Line 1349 sub passwordchanger {
|
Line 1362 sub passwordchanger {
|
my $jsh=Apache::File->new($include."/londes.js"); |
my $jsh=Apache::File->new($include."/londes.js"); |
$r->print(<$jsh>); |
$r->print(<$jsh>); |
} |
} |
$r->print(&jscript_send($caller)); |
$r->print(&jscript_send($caller,$extrafields)); |
$r->print(<<ENDFORM); |
$r->print(<<ENDFORM); |
$errormessage |
$errormessage |
|
|
Line 1358 $errormessage
|
Line 1371 $errormessage
|
ensure that unencrypted passwords will not be sent out by a |
ensure that unencrypted passwords will not be sent out by a |
crappy browser --> |
crappy browser --> |
ENDFORM |
ENDFORM |
$r->print(&server_form($logtoken,$caller,$mailtoken)); |
$r->print(&server_form($logtoken,$caller,$mailtoken,$extrafields)); |
$r->print(&client_form($caller,\%hexkey,$currentpass,$domain)); |
$r->print(&client_form($caller,\%hexkey,$currentpass,$domain,$extrafields)); |
|
|
# |
# |
return; |
return; |
} |
} |
|
|
sub jscript_send { |
sub jscript_send { |
my ($caller) = @_; |
my ($caller,$extrafields) = @_; |
my $output = qq| |
my $output = qq| |
<script type="text/javascript" language="JavaScript"> |
<script type="text/javascript" language="JavaScript"> |
|
|
Line 1374 sub jscript_send {
|
Line 1387 sub jscript_send {
|
uextkey=this.document.client.elements.ukey_cpass.value; |
uextkey=this.document.client.elements.ukey_cpass.value; |
lextkey=this.document.client.elements.lkey_cpass.value; |
lextkey=this.document.client.elements.lkey_cpass.value; |
initkeys(); |
initkeys(); |
|
this.document.pserver.elements.currentpass.value = |
this.document.pserver.elements.currentpass.value |
getCrypted(this.document.client.elements.currentpass.value); |
=crypted(this.document.client.elements.currentpass.value); |
|
|
|
uextkey=this.document.client.elements.ukey_npass1.value; |
uextkey=this.document.client.elements.ukey_npass1.value; |
lextkey=this.document.client.elements.lkey_npass1.value; |
lextkey=this.document.client.elements.lkey_npass1.value; |
initkeys(); |
initkeys(); |
this.document.pserver.elements.newpass_1.value |
this.document.pserver.elements.newpass_1.value |
=crypted(this.document.client.elements.newpass_1.value); |
=getCrypted(this.document.client.elements.newpass_1.value); |
|
|
uextkey=this.document.client.elements.ukey_npass2.value; |
uextkey=this.document.client.elements.ukey_npass2.value; |
lextkey=this.document.client.elements.lkey_npass2.value; |
lextkey=this.document.client.elements.lkey_npass2.value; |
initkeys(); |
initkeys(); |
this.document.pserver.elements.newpass_2.value |
this.document.pserver.elements.newpass_2.value |
=crypted(this.document.client.elements.newpass_2.value); |
=getCrypted(this.document.client.elements.newpass_2.value); |
|; |
|; |
if ($caller eq 'reset_by_email') { |
if ($caller eq 'reset_by_email') { |
$output .= qq| |
if ((ref($extrafields) eq 'HASH') && ($extrafields->{'username'})) { |
|
$output .= qq| |
this.document.pserver.elements.uname.value = |
this.document.pserver.elements.uname.value = |
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; |
|
|; |
|
} |
|
if ((ref($extrafields) eq 'HASH') && ($extrafields->{'email'})) { |
|
$output .= qq| |
this.document.pserver.elements.email.value = |
this.document.pserver.elements.email.value = |
this.document.client.elements.email.value; |
this.document.client.elements.email.value; |
|; |
|; |
|
} |
} |
} |
$ output .= qq| |
$ output .= qq| |
this.document.pserver.submit(); |
this.document.pserver.submit(); |
} |
} |
|
|
</script> |
</script> |
|; |
|; |
} |
} |
|
|
sub client_form { |
sub client_form { |
my ($caller,$hexkey,$currentpass,$defdom) = @_; |
my ($caller,$hexkey,$currentpass,$defdom,$extrafields) = @_; |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'email' => 'E-mail Address', |
'email' => 'E-mail Address', |
'username' => 'Username', |
'username' => 'Username', |
Line 1422 sub client_form {
|
Line 1439 sub client_form {
|
my $output = '<form name="client" action="">' |
my $output = '<form name="client" action="">' |
.&Apache::lonhtmlcommon::start_pick_box(); |
.&Apache::lonhtmlcommon::start_pick_box(); |
if ($caller eq 'reset_by_email') { |
if ($caller eq 'reset_by_email') { |
$output .= &Apache::lonhtmlcommon::row_title( |
if ((ref($extrafields) eq 'HASH') && ($extrafields->{'email'})) { |
|
$output .= &Apache::lonhtmlcommon::row_title( |
'<label for="email">'.$lt{'email'}.'</label>') |
'<label for="email">'.$lt{'email'}.'</label>') |
.'<input type="text" name="email" size="30" />' |
.'<input type="text" name="email" size="30" autocapitalize="off" autocorrect="off" />' |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_closure(); |
.&Apache::lonhtmlcommon::row_title( |
} |
|
if ((ref($extrafields) eq 'HASH') && ($extrafields->{'username'})) { |
|
$output .= &Apache::lonhtmlcommon::row_title( |
'<label for="uname">'.$lt{'username'}.'</label>') |
'<label for="uname">'.$lt{'username'}.'</label>') |
.'<input type="text" name="uname" size="15" />' |
.'<input type="text" name="uname" size="20" autocapitalize="off" autocorrect="off" />' |
.'<input type="hidden" name="currentpass" value="'.$currentpass.'" />' |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_title( |
.&Apache::lonhtmlcommon::row_title( |
|
'<label for="udom">'.$lt{'domain'}.'</label>') |
'<label for="udom">'.$lt{'domain'}.'</label>') |
.&Apache::loncommon::select_dom_form($defdom,'udom') |
.&Apache::loncommon::select_dom_form($defdom,'udom') |
.&Apache::lonhtmlcommon::row_closure(); |
.&Apache::lonhtmlcommon::row_closure(); |
|
} |
} else { |
} else { |
$output .= &Apache::lonhtmlcommon::row_title( |
$output .= &Apache::lonhtmlcommon::row_title( |
'<label for="currentpass">'.$lt{'currentpass'}.'</label>') |
'<label for="currentpass">'.$lt{'currentpass'}.'</label>') |
.'<input type="password" name="currentpass" size="10"/>' |
.'<input type="password" name="currentpass" size="20"/>' |
.&Apache::lonhtmlcommon::row_closure(); |
.&Apache::lonhtmlcommon::row_closure(); |
} |
} |
$output .= &Apache::lonhtmlcommon::row_title( |
$output .= &Apache::lonhtmlcommon::row_title( |
'<label for="newpass_1">'.$lt{'newpass'}.'</label>') |
'<label for="newpass_1">'.$lt{'newpass'}.'</label>') |
.'<input type="password" name="newpass_1" size="10" />' |
.'<input type="password" name="newpass_1" size="20" />' |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_title( |
.&Apache::lonhtmlcommon::row_title( |
'<label for="newpass_2">'.$lt{'confirmpass'}.'</label>') |
'<label for="newpass_2">'.$lt{'confirmpass'}.'</label>') |
.'<input type="password" name="newpass_2" size="10" />' |
.'<input type="password" name="newpass_2" size="20" />' |
.&Apache::lonhtmlcommon::row_closure(1) |
.&Apache::lonhtmlcommon::row_closure(1) |
.&Apache::lonhtmlcommon::end_pick_box(); |
.&Apache::lonhtmlcommon::end_pick_box(); |
|
if ($caller eq 'reset_by_email') { |
|
$output .= '<input type="hidden" name="currentpass" value="'.$currentpass.'" />'; |
|
} |
$output .= '<p><input type="button" value="'.$lt{'changepass'}.'" onclick="send();" /></p>' |
$output .= '<p><input type="button" value="'.$lt{'changepass'}.'" onclick="send();" /></p>' |
.qq| |
.qq| |
<input type="hidden" name="ukey_cpass" value="$hexkey->{'ukey_cpass'}" /> |
<input type="hidden" name="ukey_cpass" value="$hexkey->{'ukey_cpass'}" /> |
Line 1465 sub client_form {
|
Line 1488 sub client_form {
|
} |
} |
|
|
sub server_form { |
sub server_form { |
my ($logtoken,$caller,$mailtoken) = @_; |
my ($logtoken,$caller,$mailtoken,$extrafields) = @_; |
my $action = '/adm/preferences'; |
my $action = '/adm/preferences'; |
if ($caller eq 'reset_by_email') { |
if ($caller eq 'reset_by_email') { |
$action = '/adm/resetpw'; |
$action = '/adm/resetpw'; |
Line 1476 sub server_form {
|
Line 1499 sub server_form {
|
<input type="hidden" name="currentpass" value="" /> |
<input type="hidden" name="currentpass" value="" /> |
<input type="hidden" name="newpass_1" value="" /> |
<input type="hidden" name="newpass_1" value="" /> |
<input type="hidden" name="newpass_2" value="" /> |
<input type="hidden" name="newpass_2" value="" /> |
|; |
|; |
if ($caller eq 'reset_by_email') { |
if ($caller eq 'reset_by_email') { |
$output .= qq| |
$output .= qq| |
<input type="hidden" name="token" value="$mailtoken" /> |
<input type="hidden" name="token" value="$mailtoken" /> |
|
|; |
|
if ((ref($extrafields) eq 'HASH') && ($extrafields->{'username'})) { |
|
$output .= qq| |
<input type="hidden" name="uname" value="" /> |
<input type="hidden" name="uname" value="" /> |
<input type="hidden" name="udom" value="" /> |
<input type="hidden" name="udom" value="" /> |
|
|; |
|
} |
|
if ((ref($extrafields) eq 'HASH') && ($extrafields->{'email'})) { |
|
$output .= qq| |
<input type="hidden" name="email" value="" /> |
<input type="hidden" name="email" value="" /> |
|
|
|; |
|; |
|
} |
} |
} |
$output .= qq| |
$output .= qq| |
<input type="hidden" name="action" value="verify_and_change_pass" /> |
<input type="hidden" name="action" value="verify_and_change_pass" /> |
Line 1494 sub server_form {
|
Line 1524 sub server_form {
|
} |
} |
|
|
sub verify_and_change_password { |
sub verify_and_change_password { |
my ($r,$caller,$mailtoken) = @_; |
my ($r,$caller,$mailtoken,$ended) = @_; |
my ($user,$domain,$homeserver); |
my ($user,$domain,$homeserver); |
my ($blocked,$blocktext) = |
my ($blocked,$blocktext) = |
&Apache::loncommon::blocking_status('passwd'); |
&Apache::loncommon::blocking_status('passwd'); |
Line 1570 ENDERROR
|
Line 1600 ENDERROR
|
return 1; |
return 1; |
} |
} |
my ($ckey,$n1key,$n2key)=split(/&/,$tmpinfo); |
my ($ckey,$n1key,$n2key)=split(/&/,$tmpinfo); |
# |
# |
$currentpass = &Apache::loncommon::des_decrypt($ckey ,$currentpass); |
$currentpass = &Apache::loncommon::des_decrypt($ckey ,$currentpass); |
$newpass1 = &Apache::loncommon::des_decrypt($n1key,$newpass1); |
$newpass1 = &Apache::loncommon::des_decrypt($n1key,$newpass1); |
$newpass2 = &Apache::loncommon::des_decrypt($n2key,$newpass2); |
$newpass2 = &Apache::loncommon::des_decrypt($n2key,$newpass2); |
Line 1639 ENDERROR
|
Line 1669 ENDERROR
|
$r->print($message.'<br />'); |
$r->print($message.'<br />'); |
} else { |
} else { |
&print_main_menu($r, $message); |
&print_main_menu($r, $message); |
|
if (ref($ended)) { |
|
$$ended = 1; |
|
} |
} |
} |
} else { |
} else { |
# error error: run in circles, scream and shout |
# error error: run in circles, scream and shout |
Line 1653 ENDERROR
|
Line 1686 ENDERROR
|
&mt("The password for user [_1] was not changed.",'<i>'.$user.'</i>').' '.&mt('Please make sure your old password was entered correctly.'),1); |
&mt("The password for user [_1] was not changed.",'<i>'.$user.'</i>').' '.&mt('Please make sure your old password was entered correctly.'),1); |
$message=&Apache::loncommon::confirmwrapper($message); |
$message=&Apache::loncommon::confirmwrapper($message); |
&print_main_menu($r, $message); |
&print_main_menu($r, $message); |
|
if (ref($ended)) { |
|
$$ended = 1; |
|
} |
} |
} |
} |
} |
return; |
return; |
Line 1907 sub author_space_settings {
|
Line 1943 sub author_space_settings {
|
my $text=&mt('By default, CodeMirror an editor with advanced functionality for editing code is activated for authors.'); |
my $text=&mt('By default, CodeMirror an editor with advanced functionality for editing code is activated for authors.'); |
my $cmoff=&mt('Deactivate CodeMirror. This can improve performance on slow computers and accessibility.'); |
my $cmoff=&mt('Deactivate CodeMirror. This can improve performance on slow computers and accessibility.'); |
my $change=&mt('Save'); |
my $change=&mt('Save'); |
|
my $returnurl = &HTML::Entities::encode($env{'form.returnurl'},'"<>&\''); |
$r->print(<<ENDSCREEN); |
$r->print(<<ENDSCREEN); |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
|
<input type="hidden" name="returnurl" value="$returnurl" /> |
<input type="hidden" name="action" value="change_authoring_settings" /> |
<input type="hidden" name="action" value="change_authoring_settings" /> |
$text<br /> |
$text<br /> |
<label><input type="checkbox" name="cmoff"$constchecked />$cmoff</label><br /> |
<label><input type="checkbox" name="cmoff"$constchecked />$cmoff</label><br /> |
Line 1936 sub change_authoring_settings {
|
Line 1974 sub change_authoring_settings {
|
} |
} |
my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Deactivate CodeMirror in Authoring Space').'</i>','<tt>'.$status.'</tt>')); |
my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Deactivate CodeMirror in Authoring Space').'</i>','<tt>'.$status.'</tt>')); |
$message=&Apache::loncommon::confirmwrapper($message); |
$message=&Apache::loncommon::confirmwrapper($message); |
&print_main_menu($r,$message); |
if ($env{'form.returnurl'}) { |
|
&do_redirect($r,$env{'form.returnurl'},$message); |
|
} else { |
|
&print_main_menu($r,$message); |
|
} |
} |
} |
} |
} |
|
|
Line 2182 push(@{ $menu[4]->{items} }, {
|
Line 2224 push(@{ $menu[4]->{items} }, {
|
|
|
} |
} |
|
|
my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au','ca','aa']); |
my %author_coauthor_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au','ca','aa']); |
if (keys(%author_roles) > 0) { |
if (keys(%author_coauthor_roles) > 0) { |
push(@{ $menu[4]->{items} }, { |
push(@{ $menu[4]->{items} }, { |
linktext => 'Authoring Space Configuration', |
linktext => 'Authoring Space Configuration', |
url => '/adm/preferences?action=authorsettings', |
url => '/adm/preferences?action=authorsettings', |
permission => 'F', |
permission => 'F', |
icon => 'course_ini.png', |
icon => 'codemirror.png', |
linktitle => 'Settings for your authoring space.', |
linktitle => 'Settings for your authoring space.', |
}); |
}); |
} |
} |
Line 2230 sub handler {
|
Line 2272 sub handler {
|
['action','wysiwyg','returnurl','refpage']); |
['action','wysiwyg','returnurl','refpage']); |
# |
# |
Apache::lonhtmlcommon::clear_breadcrumbs(); |
Apache::lonhtmlcommon::clear_breadcrumbs(); |
my ($brlink,$brtxt,$brhelp); |
my ($brlink,$brtxt,$brhelp,$ended); |
if (($env{'form.action'} eq 'changerolespref') && ($env{'form.returnurl'} eq '/adm/roles')) { |
if (($env{'form.action'} eq 'changerolespref') && ($env{'form.returnurl'} eq '/adm/roles')) { |
$brlink ='/adm/roles'; |
$brlink ='/adm/roles'; |
$brtxt = 'User Roles'; |
$brtxt = 'User Roles'; |
|
} elsif ((($env{'form.action'} eq 'changedomcoord') || |
|
($env{'form.action'} eq 'authorsettings')) && |
|
(($env{'form.returnurl'} =~ m{^/(priv/|res($|/))}) || |
|
($env{'form.returnurl'} eq '/adm/createuser'))) { |
|
$brlink = $env{'form.returnurl'}; |
|
if ($env{'form.returnurl'} eq '/adm/createuser') { |
|
$brtxt = 'User Management'; |
|
} elsif ($env{'form.returnurl'} =~ m{^/res($\/)}) { |
|
$brtxt = 'Browse published resources'; |
|
} else { |
|
$brtxt = 'Authoring Space'; |
|
} |
} else { |
} else { |
$brlink ='/adm/preferences'; |
$brlink ='/adm/preferences'; |
$brtxt = 'Set User Preferences'; |
$brtxt = 'Set User Preferences'; |
Line 2244 sub handler {
|
Line 2298 sub handler {
|
text => $brtxt, |
text => $brtxt, |
help => $brhelp,}); |
help => $brhelp,}); |
if(!exists $env{'form.action'}) { |
if(!exists $env{'form.action'}) { |
&print_main_menu($r); |
&print_main_menu($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'changepass'){ |
}elsif($env{'form.action'} eq 'changepass'){ |
&passwordchanger($r); |
&passwordchanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_pass'){ |
}elsif($env{'form.action'} eq 'verify_and_change_pass'){ |
&verify_and_change_password($r); |
&verify_and_change_password($r,'preferences','',\$ended); |
}elsif($env{'form.action'} eq 'changescreenname'){ |
}elsif($env{'form.action'} eq 'changescreenname'){ |
&screennamechanger($r); |
&screennamechanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_screenname'){ |
}elsif($env{'form.action'} eq 'verify_and_change_screenname'){ |
&verify_and_change_screenname($r); |
&verify_and_change_screenname($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'changemsgforward'){ |
}elsif($env{'form.action'} eq 'changemsgforward'){ |
&msgforwardchanger($r); |
&msgforwardchanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_msgforward'){ |
}elsif($env{'form.action'} eq 'verify_and_change_msgforward'){ |
Line 2261 sub handler {
|
Line 2317 sub handler {
|
&colorschanger($r); |
&colorschanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_colors'){ |
}elsif($env{'form.action'} eq 'verify_and_change_colors'){ |
&verify_and_change_colors($r); |
&verify_and_change_colors($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'changelanguages'){ |
}elsif($env{'form.action'} eq 'changelanguages'){ |
&languagechanger($r); |
&languagechanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_languages'){ |
}elsif($env{'form.action'} eq 'verify_and_change_languages'){ |
&verify_and_change_languages($r); |
&verify_and_change_languages($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'changewysiwyg'){ |
}elsif($env{'form.action'} eq 'changewysiwyg'){ |
&wysiwygchanger($r); |
&wysiwygchanger($r); |
}elsif($env{'form.action'} eq 'set_wysiwyg'){ |
}elsif($env{'form.action'} eq 'set_wysiwyg'){ |
&verify_and_change_wysiwyg($r); |
&verify_and_change_wysiwyg($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'changediscussions'){ |
}elsif($env{'form.action'} eq 'changediscussions'){ |
&discussionchanger($r); |
&discussionchanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_discussion'){ |
}elsif($env{'form.action'} eq 'verify_and_change_discussion'){ |
&verify_and_change_discussion($r); |
&verify_and_change_discussion($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'changerolespref'){ |
}elsif($env{'form.action'} eq 'changerolespref'){ |
&rolesprefchanger($r); |
&rolesprefchanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_rolespref'){ |
}elsif($env{'form.action'} eq 'verify_and_change_rolespref'){ |
&verify_and_change_rolespref($r); |
&verify_and_change_rolespref($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'changetexenginepref'){ |
}elsif($env{'form.action'} eq 'changetexenginepref'){ |
&texenginechanger($r); |
&texenginechanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_texengine'){ |
}elsif($env{'form.action'} eq 'verify_and_change_texengine'){ |
&verify_and_change_texengine($r); |
&verify_and_change_texengine($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'changeicons'){ |
}elsif($env{'form.action'} eq 'changeicons'){ |
&iconchanger($r); |
&iconchanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_icons'){ |
}elsif($env{'form.action'} eq 'verify_and_change_icons'){ |
&verify_and_change_icons($r); |
&verify_and_change_icons($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'changeclicker'){ |
}elsif($env{'form.action'} eq 'changeclicker'){ |
&clickerchanger($r); |
&clickerchanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_clicker'){ |
}elsif($env{'form.action'} eq 'verify_and_change_clicker'){ |
&verify_and_change_clicker($r); |
&verify_and_change_clicker($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'changedomcoord'){ |
}elsif($env{'form.action'} eq 'changedomcoord'){ |
&domcoordchanger($r); |
&domcoordchanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_domcoord'){ |
}elsif($env{'form.action'} eq 'verify_and_change_domcoord'){ |
&verify_and_change_domcoord($r); |
&verify_and_change_domcoord($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'lockwarning'){ |
}elsif($env{'form.action'} eq 'lockwarning'){ |
&lockwarning($r); |
&lockwarning($r); |
}elsif($env{'form.action'} eq 'verify_and_change_locks'){ |
}elsif($env{'form.action'} eq 'verify_and_change_locks'){ |
Line 2301 sub handler {
|
Line 2366 sub handler {
|
&coursedisplaychanger($r); |
&coursedisplaychanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_coursepage'){ |
}elsif($env{'form.action'} eq 'verify_and_change_coursepage'){ |
&verify_and_change_coursepage($r); |
&verify_and_change_coursepage($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'authorsettings'){ |
}elsif($env{'form.action'} eq 'authorsettings'){ |
&author_space_settings($r); |
&author_space_settings($r); |
}elsif($env{'form.action'} eq 'change_authoring_settings'){ |
}elsif($env{'form.action'} eq 'change_authoring_settings'){ |
&change_authoring_settings($r); |
&change_authoring_settings($r); |
|
$ended = 1; |
}elsif($env{'form.action'} eq 'debugtoggle'){ |
}elsif($env{'form.action'} eq 'debugtoggle'){ |
if (&can_toggle_debug()) { |
if (&can_toggle_debug()) { |
&toggle_debug(); |
&toggle_debug(); |
} |
} |
&print_main_menu($r); |
&print_main_menu($r); |
|
$ended = 1; |
} elsif ($env{'form.action'} eq 'changelockednames') { |
} elsif ($env{'form.action'} eq 'changelockednames') { |
&lockednameschanger($r); |
&lockednameschanger($r); |
} elsif ($env{'form.action'} eq 'verify_and_change_lockednames') { |
} elsif ($env{'form.action'} eq 'verify_and_change_lockednames') { |
&verify_and_change_lockednames($r); |
&verify_and_change_lockednames($r); |
|
$ended = 1; |
} |
} |
|
|
# Properly end the HTML page of all preference pages |
# Properly end the HTML page of all preference pages |
# started in each sub routine |
# started in each sub routine |
# Exception: print_main_menu has its own end_page call |
# Exception: print_main_menu has its own end_page call |
unless (!exists $env{'form.action'} || |
unless ($ended) { |
$env{'form.action'} eq 'debugtoggle') { |
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 2393 sub updateable_userinfo {
|
Line 2461 sub updateable_userinfo {
|
return %updateable; |
return %updateable; |
} |
} |
|
|
|
sub do_redirect { |
|
my ($r,$url,$msg) = @_; |
|
$r->print( |
|
&Apache::loncommon::start_page('Switching Server ...',undef, |
|
{'redirect' => [0.5,$url]}). |
|
'<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n". |
|
"$msg\n". |
|
&Apache::loncommon::end_page()); |
|
return; |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |