--- loncom/interface/lonpreferences.pm 2014/02/12 20:29:36 1.211 +++ loncom/interface/lonpreferences.pm 2016/01/27 00:24:09 1.217 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.211 2014/02/12 20:29:36 raeburn Exp $ +# $Id: lonpreferences.pm,v 1.217 2016/01/27 00:24:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -183,6 +183,7 @@ sub texenginechanger { 'change' => 'Save', 'exmpl' => 'Examples', 'mathjax' => 'MathJax:', + '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):', 'mimetex' => 'mimetex (Convert to Images):', @@ -219,10 +220,10 @@ $lt{'exmpl'}
-MathJax provides rendered equations whose source code can be extracted in TeX and MathML formats by right clicking the equation. +$lt{'mathjaxinfo'}
- +
- +
ENDLSCREEN if ($env{'environment.texengine'} ne 'jsMath') { @@ -788,7 +789,7 @@ sub lockwarning { my $textbottom=&mt('Changing roles or logging out may result in data corruption.'); my ($num,%which)=&Apache::lonnet::get_locks(); my $which=''; - foreach my $id (keys %which) { + foreach my $id (keys(%which)) { $which.=''.$blocktext.'
'); + return; + } if ((!defined($caller)) || ($caller eq 'preferences')) { $user = $env{'user.name'}; $domain = $env{'user.domain'}; @@ -1317,9 +1324,9 @@ sub passwordchanger { return if ($currentauth !~ /^(unix|internal):/); # # Generate keys - my ($lkey_cpass ,$ukey_cpass ) = &des_keys(); - my ($lkey_npass1,$ukey_npass1) = &des_keys(); - my ($lkey_npass2,$ukey_npass2) = &des_keys(); + my ($lkey_cpass ,$ukey_cpass ) = &Apache::loncommon::des_keys(); + my ($lkey_npass1,$ukey_npass1) = &Apache::loncommon::des_keys(); + my ($lkey_npass2,$ukey_npass2) = &Apache::loncommon::des_keys(); # Store the keys in the log files my $lonhost = $r->dir_config('lonHostID'); my $logtoken=Apache::lonnet::reply('tmpput:' @@ -1489,6 +1496,12 @@ sub server_form { sub verify_and_change_password { my ($r,$caller,$mailtoken) = @_; my ($user,$domain,$homeserver); + my ($blocked,$blocktext) = + &Apache::loncommon::blocking_status('passwd'); + if ($blocked) { + $r->print(''.$blocktext.'
'); + return; + } if ($caller eq 'reset_by_email') { $user = $env{'form.uname'}; $domain = $env{'form.udom'}; @@ -1875,6 +1888,58 @@ sub verify_and_change_coursepage { &print_main_menu($r,$message); } +sub author_space_settings { + my $r = shift; + &Apache::lonhtmlcommon::add_breadcrumb( + { href => '/adm/preferences?action=authorsettings', + text => 'Authoring Space Settings'}); + my $user = $env{'user.name'}; + my $domain = $env{'user.domain'}; + my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au','ca','aa']); + if (keys(%author_roles) > 0) { + $r->print(Apache::loncommon::start_page('Authoring Space Settings')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Authoring Space Settings')); + my %userenv = &Apache::lonnet::get('environment',['nocodemirror']); + my $constchecked=''; + if ($env{'environment.nocodemirror'}) { + $constchecked=' checked="checked"'; + } + 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 $change=&mt('Save'); + $r->print(<