--- loncom/interface/lonuserutils.pm 2013/05/03 16:29:34 1.152 +++ loncom/interface/lonuserutils.pm 2013/12/09 21:33:32 1.159 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.152 2013/05/03 16:29:34 bisitz Exp $ +# $Id: lonuserutils.pm,v 1.159 2013/12/09 21:33:32 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -642,7 +642,7 @@ sub upload_manager_javascript_forward_as $numbuttons ++; } if (!$can_assign->{'int'}) { - my $warning = &mt('You may not specify an initial password for each user, as this is only available when new users use LON-CAPA internal authentication.').'\n' + my $warning = &mt('You may not specify an initial password for each user, as this is only available when new users use LON-CAPA internal authentication.').'\n'. &mt('Your current role does not have rights to create users with that authentication type.'); $auth_update = <<"END"; // Currently the initial password field is only supported for internal auth @@ -1637,7 +1637,7 @@ sub print_userlist { return; } my ($indexhash,$keylist) = &make_keylist_array(); - my (%userlist,%userinfo,$clearcoursepick); + my (%userlist,%userinfo,$clearcoursepick,$needauthorquota,$needauthorusage); if (($context eq 'domain') && ($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community')) { @@ -1709,6 +1709,12 @@ sub print_userlist { \%cstr_roles,$permission); } elsif ($context eq 'domain') { if ($env{'form.roletype'} eq 'domain') { + if (grep(/^authorusage$/,@cols)) { + $needauthorusage = 1; + } + if (grep(/^authorquota$/,@cols)) { + $needauthorquota = 1; + } %dom_roles = &Apache::lonnet::get_domain_roles($env{'request.role.domain'}); foreach my $key (keys(%dom_roles)) { if (ref($dom_roles{$key}) eq 'HASH') { @@ -1821,7 +1827,7 @@ sub print_userlist { } else { ($usercount) = &show_users_list($r,$context,$env{'form.output'}, $permission,$env{'form.Status'},\%userlist, - $keylist,'',$showcredits); + $keylist,'',$showcredits,$needauthorquota,$needauthorusage); } if (!$usercount) { $r->print('
' @@ -1988,10 +1994,10 @@ sub get_cols_array { } if (($context eq 'course') && ($mode ne 'autoenroll') && ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'})) { - push(@cols,'photos'); + push(@cols,'photo'); } if ($context eq 'domain') { - push (@cols,'extent'); + push (@cols,('authorusage','authorquota','extent')); } } return @cols; @@ -2027,6 +2033,8 @@ sub column_checkboxes { if (($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community')) { $disabledchk{'status'} = 1; + $disabledchk{'authorusage'} = 1; + $disabledchk{'authorquota'} = 1; } elsif ($env{'form.roletype'} eq 'domain') { $disabledchk{'extent'} = 1; } @@ -2078,7 +2086,11 @@ sub column_checkboxes { if (($env{'form.roletype'} eq 'domain') || ($env{'form.roletype'} eq '')) { $style = ' style="display: none;"'; } - } + } elsif (($cols[$i] eq 'authorusage') || ($cols[$i] eq 'authorquota')) { + if ($env{'form.roletype'} ne 'domain') { + $style = ' style="display: none;"'; + } + } $output .= '