--- loncom/interface/lonpreferences.pm 2014/12/12 14:32:09 1.214 +++ 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.214 2014/12/12 14:32:09 raeburn Exp $ +# $Id: lonpreferences.pm,v 1.217 2016/01/27 00:24:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1262,6 +1262,12 @@ sub passwordchanger { $r->print(Apache::loncommon::start_page('Personal Data')); $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Password')); } + my ($blocked,$blocktext) = + &Apache::loncommon::blocking_status('passwd'); + if ($blocked) { + $r->print('
'.$blocktext.'
'); + return; + } if ((!defined($caller)) || ($caller eq 'preferences')) { $user = $env{'user.name'}; $domain = $env{'user.domain'}; @@ -1490,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'}; @@ -1876,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(<