--- loncom/interface/lonuserutils.pm 2024/08/31 20:02:12 1.222 +++ loncom/interface/lonuserutils.pm 2025/01/13 00:57:39 1.224 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.222 2024/08/31 20:02:12 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.224 2025/01/13 00:57:39 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3714,9 +3714,11 @@ END foreach my $item (@{$keylist}) { $in{$item} = $sdata->[$index{$item}]; } - my $clickers = (&Apache::lonnet::userenvironment($in{'domain'},$in{'username'},'clickers'))[1]; - if ($clickers!~/\w/) { $clickers='-'; } - $in{'clicker'} = $clickers; + if (grep(/^clicker$/,@cols)) { + my $clickers = (&Apache::lonnet::userenvironment($in{'domain'},$in{'username'},'clickers'))[1]; + if ($clickers!~/\w/) { $clickers='-'; } + $in{'clicker'} = $clickers; + } my $role = $in{'role'}; $in{'role'}=&Apache::lonnet::plaintext($sdata->[$index{'role'}],$crstype); unless ($mode eq 'excel') { @@ -3838,10 +3840,7 @@ END } elsif ($item eq 'clicker') { if (($context eq 'course') && ($mode ne 'autoenroll')) { if ($env{'form.showrole'} eq 'st' || $env{'form.showrole'} eq 'Any') { - my $clickers = - (&Apache::lonnet::userenvironment($in{'domain'},$in{'username'},'clickers'))[1]; - if ($clickers!~/\w/) { $clickers='-'; } - $r->print(''.$clickers.''); + $r->print(''.$in{'clicker'}.''); } else { $r->print(' '."\n"); } @@ -6700,6 +6699,10 @@ sub can_modify_userinfo { $canmodify{$field} = 0; if (&Apache::lonnet::allowed('mau',$dom)) { $canmodify{$field} = 1; + } elsif (($context ne 'selfcreate') && + ($env{'request.role.dom'} ne $dom) && + ($env{'user.domain'} ne $dom)) { + $canmodify{$field} = 0; } else { if (ref($domconfig{'usermodification'}) eq 'HASH') { if (ref($domconfig{'usermodification'}{$context}) eq 'HASH') {