--- loncom/interface/loncreateuser.pm 2017/01/02 19:44:06 1.428 +++ loncom/interface/loncreateuser.pm 2017/03/26 22:19:24 1.437 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.428 2017/01/02 19:44:06 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.437 2017/03/26 22:19:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -755,6 +755,7 @@ sub print_username_entry_form { } } else { my $actiontext = $lt{'srad'}; + my $fixeddom; if ($env{'form.action'} eq 'singlestudent') { if ($crstype eq 'Community') { $actiontext = $lt{'srme'}; @@ -763,6 +764,7 @@ sub print_username_entry_form { } } elsif ($env{'form.action'} eq 'accesslogs') { $actiontext = $lt{'srva'}; + $fixeddom = 1; } elsif (($env{'form.action'} eq 'singleuser') && ($context eq 'domain') && (!&Apache::lonnet::allowed('mau',$defdom))) { $actiontext = $lt{'srvu'}; @@ -774,7 +776,7 @@ sub print_username_entry_form { '
'); } } - $r->print(&entry_form($defdom,$srch,$forcenewuser,$context,$response,$crstype,1)); + $r->print(&entry_form($defdom,$srch,$forcenewuser,$context,$response,$crstype,$fixeddom)); } } @@ -860,7 +862,7 @@ ENDBLOCK $output = '

'.$userpicker.'

'; } if (($env{'form.phase'} eq '') && ($env{'form.action'} ne 'accesslogs') && - (!(($env{'form.action'} eq 'singleuser') && ($context eq 'domain') && + (!(($env{'form.action'} eq 'singleuser') && ($context eq 'domain') && (!&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))))) { my $defdom=$env{'request.role.domain'}; my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain'); @@ -1435,7 +1437,7 @@ ENDAUTH $r->print('
'); $r->print(&personal_data_display($ccuname,$ccdomain,$newuser,$context, $inst_results{$ccuname.':'.$ccdomain})); - if ((&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) || + if ((&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) || (&Apache::lonnet::allowed('udp',$env{'request.role.domain'}))) { $r->print('

'.&mt('User Can Request Creation of Courses/Communities in this Domain?').'

'. &Apache::loncommon::start_data_table()); @@ -1455,7 +1457,7 @@ ENDAUTH if ((!$isauthor) && ((&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) || (&Apache::lonnet::allowed('udp',$env{'request.role.domain'}))) && - ($env{'request.role.domain'} eq $ccdomain)) { + ($env{'request.role.domain'} eq $ccdomain)) { $user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain); } $user_text{'auth'} = &user_authentication($ccuname,$ccdomain,$formname); @@ -1526,7 +1528,7 @@ ENDNOTOOLSPRIV } elsif (($context eq 'course') && ((&Apache::lonnet::allowed('vcl',$env{'request.course.id'})) || ($env{'request.course.sec'} && &Apache::lonnet::allowed('vcl',$env{'request.course.id'}.'/'.$env{'request.course.sec'})))) { - $statuses = ['active']; + $statuses = ['active']; } if ($env{'form.action'} ne 'singlestudent') { &display_existing_roles($r,$ccuname,$ccdomain,\%inccourses,$context, @@ -1760,7 +1762,7 @@ sub display_existing_roles { if ($active) { next unless($showall || $showactive); } else { - next unless($showall || $showexpired); + next unless($showall || $showexpired); } # Is this a custom role? Get role owner and title. my ($croleudom,$croleuname,$croletitle)= @@ -1905,7 +1907,7 @@ sub display_existing_roles { } else { $row.=' '; } - $row.= ''; + $row.= ''; } my $plaintext=''; if (!$croletitle) { @@ -4384,7 +4386,6 @@ sub custom_role_editor { ); my $args = { bread_crumbs => $brcrum, bread_crumbs_component => 'User Management'}; - $r->print(&Apache::loncommon::start_page('Custom Role Editor', $head_script,$args). $body_top); @@ -5025,7 +5026,7 @@ sub handler { } elsif ($env{'form.state'} eq 'done') { $r->print('

'.&mt('Enrollment request processing').'

'."\n"); $r->print(&Apache::loncoursequeueadmin::update_request_queue($context, - $cdom,$cnum,$coursedesc)); + $cdom,$cnum,$coursedesc)); } } else { $r->print(&header(undef,{'no_nav_bar' => 1}). @@ -5045,7 +5046,7 @@ sub handler { &update_helpdeskaccess($r,$permission,$brcrum); } else { &print_helpdeskaccess_display($r,$permission,$brcrum); - } + } } else { &print_helpdeskaccess_display($r,$permission,$brcrum); } @@ -5306,9 +5307,8 @@ sub print_main_menu { ); if ($linkcontext eq 'domain') { unless ($permission->{'cusr'}) { - $links{'domain'}{'singleuser'} = 'View a User'; + $links{'domain'}{'singleuser'} = 'View a User'; $linktitles{'domain'}{'singleuser'} = 'View information about a user in the domain'; - } } elsif ($linkcontext eq 'course') { unless ($permission->{'cusr'}) { @@ -6062,7 +6062,7 @@ ENDSCRIPT } elsif ($item eq 'approval') { my ($currnotified,$currapproval,%appchecked); my %selfdescs = &Apache::lonuserutils::selfenroll_default_descs(); - if (ref($currsettings) eq 'HASH') { + if (ref($currsettings) eq 'HASH') { $currnotified = $currsettings->{'selfenroll_notifylist'}; $currapproval = $currsettings->{'selfenroll_approval'}; } @@ -6596,7 +6596,7 @@ ENDSCRIPT } } if (($context eq 'course') && ($viewablesec ne '')) { - next if ($roleslog{$id}{'logentry'}{'section'} ne $viewablesec); + next if ($roleslog{$id}{'logentry'}{'section'} ne $viewablesec); } $count ++; next if ($count < $minshown); @@ -6686,20 +6686,25 @@ sub print_useraccesslogs_display { # set breadcrumbs my %breadcrumb_text = &singleuser_breadcrumb('','domain',$udom); - push (@{$brcrum}, - {href => "javascript:backPage($form)", - text => $breadcrumb_text{'search'}}); - my (@prevphases,$prevphasestr); - if ($env{'form.prevphases'}) { - @prevphases = split(/,/,$env{'form.prevphases'}); - $prevphasestr = $env{'form.prevphases'}; - } - if (($env{'form.phase'} eq 'userpicked') || (grep(/^userpicked$/,@prevphases))) { - push(@{$brcrum}, - {href => "javascript:backPage($form,'get_user_info','select')", - text => $breadcrumb_text{'userpicked'}}); - if ($env{'form.phase'} eq 'userpicked') { - $prevphasestr = 'userpicked'; + my $prevphasestr; + if ($env{'form.popup'}) { + $brcrum = []; + } else { + push (@{$brcrum}, + {href => "javascript:backPage($form)", + text => $breadcrumb_text{'search'}}); + my @prevphases; + if ($env{'form.prevphases'}) { + @prevphases = split(/,/,$env{'form.prevphases'}); + $prevphasestr = $env{'form.prevphases'}; + } + if (($env{'form.phase'} eq 'userpicked') || (grep(/^userpicked$/,@prevphases))) { + push(@{$brcrum}, + {href => "javascript:backPage($form,'get_user_info','select')", + text => $breadcrumb_text{'userpicked'}}); + if ($env{'form.phase'} eq 'userpicked') { + $prevphasestr = 'userpicked'; + } } } push(@{$brcrum}, @@ -6711,6 +6716,7 @@ sub print_useraccesslogs_display { bread_crumbs_component => 'User Management'}; if ($env{'form.popup'}) { $args->{'no_nav_bar'} = 1; + $args->{'bread_crumbs_nomenu'} = 1; } # set javascript @@ -6736,8 +6742,12 @@ ENDSCRIPT unless ($permission->{'activity'}) { $r->print('

' .&mt('You do not have rights to display user access logs.') - .'

' - .&earlyout_accesslog_form($formname,$prevphasestr,$udom)); + .'

'); + if ($env{'form.popup'}) { + $r->print('

'.&mt('Close window').'

'); + } else { + $r->print(&earlyout_accesslog_form($formname,$prevphasestr,$udom)); + } return; } @@ -6757,6 +6767,24 @@ ENDSCRIPT return; } + if (&Apache::lonnet::privileged($uname,$udom, + [$env{'request.role.domain'}],['dc','su'])) { + unless (&Apache::lonnet::privileged($env{'user.name'},$env{'user.domain'}, + [$env{'request.role.domain'}],['dc','su'])) { + $r->print('

' + .&mt('You need to be a privileged user to display user access logs for [_1]', + &Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom), + $uname,$udom)) + .'

'); + if ($env{'form.popup'}) { + $r->print('

'.&mt('Close window').'

'); + } else { + $r->print(&earlyout_accesslog_form($formname,$prevphasestr,$udom)); + } + return; + } + } + # set defaults my $now = time(); my $defstart = $now - (7*24*3600); @@ -6803,8 +6831,10 @@ ENDSCRIPT my ($nav_script,$nav_links); # table header - my $tableheader = - &Apache::loncommon::start_data_table_header_row() + my $tableheader = '

'. + &mt('User access logs for: [_1]', + &Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom),$uname,$udom)).'

' + .&Apache::loncommon::start_data_table_header_row() .' ' .''.&mt('When').'' .''.&mt('HostID').'' @@ -6841,7 +6871,7 @@ ENDSCRIPT $showntableheader = 1; } my ($shown,$extra); - my ($event,$data) = split(/\s+/,&unescape($event)); + my ($event,$data) = split(/\s+/,&unescape($event),2); if ($event eq 'Role') { my ($rolecode,$extent) = split(/\./,$data,2); next if ($extent eq ''); @@ -6893,8 +6923,17 @@ ENDSCRIPT $shown = &mt('Role selection: [_1]',$rolename); } else { $shown = &mt($event); - if ($data ne '') { - $extra = &mt('Client IP address: [_1]',$data); + if ($data =~ /^webdav/) { + my ($path,$clientip) = split(/\s+/,$data,2); + $path =~ s/^webdav//; + if ($clientip ne '') { + $extra = &mt('Client IP address: [_1]',$clientip); + } + if ($path ne '') { + $shown .= ' '.&mt('(WebDAV access to [_1])',$path); + } + } elsif ($data ne '') { + $extra = &mt('Client IP address: [_1]',$data); } } $r->print( @@ -7003,7 +7042,7 @@ sub activity_display_filter { # Update Display button $output .= '

' .'' - .'

'; + .'


'; return $output; } @@ -7197,18 +7236,18 @@ sub print_helpdeskaccess_display { my $confname = $cdom.'-domainconfig'; my $crstype = &Apache::loncommon::course_type(); - my @accesstypes = ('all','none'); + my @accesstypes = ('all','dh','da','none'); my ($numstatustypes,@jsarray); my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($cdom); if (ref($types) eq 'ARRAY') { - if (@{$types} > 0) { + if (@{$types} > 0) { $numstatustypes = scalar(@{$types}); push(@accesstypes,'status'); @jsarray = ('bystatus'); } } my %customroles = &get_domain_customroles($cdom,$confname); - my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh']); + my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh','da']); if (keys(%domhelpdesk)) { push(@accesstypes,('inc','exc')); push(@jsarray,('notinc','notexc')); @@ -7251,7 +7290,7 @@ sub print_helpdeskaccess_display { $elements{$role.'_staff_inc'} = 'checkbox'; $elements{$role.'_staff_exc'} = 'checkbox'; } - $elements{$role.'_override'} = 'checkbox'; + $elements{$role.'_override'} = 'checkbox'; if (ref($settings{$role}) eq 'HASH') { if ($settings{$role}{'access'} ne '') { my $curraccess = $settings{$role}{'access'}; @@ -7315,7 +7354,7 @@ function switchRoleTab(caller,role) { } } return false; -} +} function helpdeskAccess(role) { var curraccess = null; @@ -7329,11 +7368,11 @@ function helpdeskAccess(role) { var shown = Array(); var hidden = Array(); if (curraccess == 'none') { - hidden = Array ('$hiddenstr'); + hidden = Array ('$hiddenstr'); } else { if (curraccess == 'status') { - shown = Array ('bystatus','privs'); - hidden = Array ('notinc','notexc'); + shown = Array ('bystatus','privs'); + hidden = Array ('notinc','notexc'); } else { if (curraccess == 'exc') { shown = Array ('notexc','privs'); @@ -7352,7 +7391,7 @@ function helpdeskAccess(role) { if (hidden.length > 0) { for (var i=0; i 'Role usage', 'whi' => 'Which helpdesk personnel may use this role?', 'udd' => 'Use domain default', - 'all' => 'All', + 'all' => 'All with domain helpdesk or helpdesk assistant role', + 'dh' => 'All with domain helpdesk role', + 'da' => 'All with domain helpdesk assistant role', 'none' => 'None', 'status' => 'Determined based on institutional status', - 'inc' => 'Include all, but exclude specific personnel', + 'inc' => 'Include all, but exclude specific personnel', 'exc' => 'Exclude all, but include specific personnel', 'hel' => 'Helpdesk', 'rpr' => 'Role privileges', @@ -7445,8 +7486,8 @@ ENDJS my @roles_by_num = (); foreach my $item (sort {$a <=> $b } (keys(%ordered))) { push(@roles_by_num,$ordered{$item}); - } - $r->print('

'.$lt{'tfh'}.': '.join(', ',map { $description{$_}; } @roles_by_num).'.'); + } + $r->print('

'.$lt{'tfh'}.': '.join(', ',map { $description{$_}; } @roles_by_num).'.'); if ($permission->{'owner'}) { $r->print('
'.$lt{'aco'}.'

'); $r->print(''. @@ -7468,7 +7509,7 @@ ENDJS my $id; if ($count == 0) { $id=' id="LC_current_minitab"'; - $visibility{$role} = ' style="display:block"'; + $visibility{$role} = ' style="display:block"'; } else { $visibility{$role} = ' style="display:none"'; } @@ -7488,11 +7529,11 @@ ENDJS priv => 'block', ); my (%selected,$overridden,$incrscheck,$indomcheck,$indomvis,$incrsvis); - if (ref($settings{$role}) eq 'HASH') { + if (ref($settings{$role}) eq 'HASH') { if ($settings{$role}{'access'} ne '') { $indomvis = ' style="display:none"'; $incrsvis = ' style="display:block"'; - $incrscheck = ' checked="checked"'; + $incrscheck = ' checked="checked"'; if ($settings{$role}{'access'} ne 'all') { $usecheck{$settings{$role}{'access'}} = $usecheck{'all'}; delete($usecheck{'all'}); @@ -7519,7 +7560,7 @@ ENDJS } } else { $indomcheck = ' checked="checked"'; - $indomvis = ' style="display:block"'; + $indomvis = ' style="display:block"'; $incrsvis = ' style="display:none"'; } $r->print('

'. @@ -7572,6 +7613,9 @@ ENDJS &role_priv_table($role,$permission,$crstype,\%full,\%levels,\%levelscurrent,$overridden{$role}). '
'); } + if ($permission->{'owner'}) { + $r->print('

'); + } } else { $r->print(&mt('Helpdesk roles have not yet been created in this domain.')); } @@ -7590,7 +7634,8 @@ sub domain_adhoc_access { my $access = $domcurrent->{$role}{'access'}; if (($access eq '') || (!grep(/^\Q$access\E$/,@{$accesstypes}))) { $access = 'all'; - $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh')); + $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role',&Apache::lonnet::plaintext('dh'), + &Apache::lonnet::plaintext('da')); } elsif ($access eq 'status') { if (ref($domcurrent->{$role}{$access}) eq 'ARRAY') { my @shown; @@ -7606,8 +7651,8 @@ sub domain_adhoc_access { } if (@shown) { my $shownstatus = join(' '.&mt('or').' ',@shown); - $domusage{$role} = &mt('Any user in domain with active [_1] role, and institutional status: [_2]', - &Apache::lonnet::plaintext('dh'),$shownstatus); + $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role, and institutional status: [_3]', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'),$shownstatus); } else { $domusage{$role} = &mt('No one in the domain'); } @@ -7621,10 +7666,11 @@ sub domain_adhoc_access { } my $showninc = join(', ',@dominc); if ($showninc ne '') { - $domusage{$role} = &mt('Include any user in domain with active [_1] role, except: [_2]', - &Apache::lonnet::plaintext('dh'),$showninc); + $domusage{$role} = &mt('Include any user in domain with active [_1] or [_2] role, except: [_3]', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'),$showninc); } else { - $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh')); + $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da')); } } } elsif ($access eq 'exc') { @@ -7637,18 +7683,24 @@ sub domain_adhoc_access { } my $shownexc = join(', ',@domexc); if ($shownexc ne '') { - $domusage{$role} = &mt('Only the following in the domain with active [_1] role: [_2]', - &Apache::lonnet::plaintext('dh'),$shownexc); + $domusage{$role} = &mt('Only the following in the domain with active [_1] or [_2] role: [_3]', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'),$shownexc); } else { $domusage{$role} = &mt('No one in the domain'); } } elsif ($access eq 'none') { $domusage{$role} = &mt('No one in the domain'); - } elsif ($access eq 'all') { + } elsif ($access eq 'dh') { $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh')); + } elsif ($access eq 'da') { + $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('da')); + } elsif ($access eq 'all') { + $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da')); } } else { - $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh')); + $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da')); } } return %domusage; @@ -7716,13 +7768,13 @@ sub role_priv_table { $checked = ' checked="checked"'; } $customstatus = ''.$lt{'dis'}.''; - $ineffect = $customstatus; + $ineffect = $customstatus; } elsif ((!$levelscurrent->{'course'}{$priv}) && ($on{$priv})) { if ($permission->{'owner'}) { - $checked = ' checked="checked"'; + $checked = ' checked="checked"'; } $customstatus = ''.$lt{'ena'}.''; - $ineffect = $customstatus; + $ineffect = $customstatus; } if ($permission->{'owner'}) { $output .= ''; @@ -7737,7 +7789,7 @@ sub role_priv_table { } sub get_adhocrole_settings { - my ($cid,$accesstypes,$types,$customroles,$settings,$overridden) = @_; + my ($cid,$accesstypes,$types,$customroles,$settings,$overridden) = @_; return unless ((ref($accesstypes) eq 'ARRAY') && (ref($customroles) eq 'HASH') && (ref($settings) eq 'HASH') && (ref($overridden) eq 'HASH')); foreach my $role (split(/,/,$env{'course.'.$cid.'.internal.adhocaccess'})) { @@ -7829,7 +7881,7 @@ sub update_helpdeskaccess { $r->print('

'.&mt('You do not have permission to change helpdesk access.').'

'); return; } - my @accesstypes = ('all','none','status','inc','exc'); + my @accesstypes = ('all','dh','da','none','status','inc','exc'); my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; my $confname = $cdom.'-domainconfig'; @@ -7839,7 +7891,7 @@ sub update_helpdeskaccess { my (%settings,%overridden); &get_adhocrole_settings($env{'request.course.id'},\@accesstypes, $types,\%customroles,\%settings,\%overridden); - my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh']); + my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh','da']); my (%changed,%storehash,@todelete); if (keys(%customroles)) { @@ -7866,7 +7918,7 @@ sub update_helpdeskaccess { push(@incrs,$role); unless ($current{'access'} eq $access) { $changed{$role}{'access'} = 1; - $storehash{'internal.adhoc.'.$role} = $access; + $storehash{'internal.adhoc.'.$role} = $access; } if ($access eq 'status') { my @statuses = &Apache::loncommon::get_env_multiple('form.'.$role.'_status'); @@ -7902,7 +7954,7 @@ sub update_helpdeskaccess { my @currstaff; foreach my $person (sort(@personnel)) { if ($domhelpdesk{$person}) { - push(@stored,$person); + push(@stored,$person); } } if (ref($current{$access}) eq 'ARRAY') { @@ -7948,7 +8000,7 @@ sub update_helpdeskaccess { &Apache::lonuserutils::custom_role_privs($customroles{$role},\%full,\%levels,\%levelscurrent); my (@updatedon,@updatedoff,@override); @override = &Apache::loncommon::get_env_multiple('form.'.$role.'_override'); - if (@override) { + if (@override) { foreach my $priv (sort(keys(%full))) { next unless ($levels{'course'}{$priv}); if (grep(/^\Q$priv\E$/,@override)) { @@ -7961,7 +8013,7 @@ sub update_helpdeskaccess { } } if (@updatedon) { - $newsettings{$role}{'on'} = join('
  • ', map { &Apache::lonnet::plaintext($_,$crstype) } (@updatedon)); + $newsettings{$role}{'on'} = join('
  • ', map { &Apache::lonnet::plaintext($_,$crstype) } (@updatedon)); } if (@updatedoff) { $newsettings{$role}{'off'} = join('
  • ', map { &Apache::lonnet::plaintext($_,$crstype) } (@updatedoff)); @@ -8069,23 +8121,29 @@ sub update_helpdeskaccess { push(@roles_by_num,$ordered{$item}); } %domusage = &domain_adhoc_access(\%changed,\%domcurrent,\@accesstypes,$usertypes,$othertitle); - $r->print(&mt('Helpdesk access settings have been changed as follows').'
    '); + $r->print(&mt('Helpdesk access settings have been changed as follows').'
    '); $r->print('
      '); foreach my $role (@roles_by_num) { next unless (ref($changed{$role}) eq 'HASH'); $r->print('
    • '.&mt('Ad hoc role').': '.$description{$role}.''. '
        '); - if ($changed{$role}{'access'} || $changed{$role}{'status'} || $changed{$role}{'inc'} || $changed{$role}{'exc'}) { + if ($changed{$role}{'access'} || $changed{$role}{'status'} || $changed{$role}{'inc'} || $changed{$role}{'exc'}) { $r->print('
      • '); if ($env{'form.'.$role.'_incrs'}) { if ($newsettings{$role}{'access'} eq 'all') { $r->print(&mt('All helpdesk staff can access '.lc($crstype).' with this role.')); + } elsif ($newsettings{$role}{'access'} eq 'dh') { + $r->print(&mt('Helpdesk staff can use this role if they have an active [_1] role', + &Apache::lonnet::plaintext('dh'))); + } elsif ($newsettings{$role}{'access'} eq 'da') { + $r->print(&mt('Helpdesk staff can use this role if they have an active [_1] role', + &Apache::lonnet::plaintext('da'))); } elsif ($newsettings{$role}{'access'} eq 'none') { $r->print(&mt('No helpdesk staff can access '.lc($crstype).' with this role.')); } elsif ($newsettings{$role}{'access'} eq 'status') { if ($newsettings{$role}{'status'}) { my ($access,$rest) = split(/=/,$storehash{'internal.adhoc.'.$role}); - if (split(/,/,$rest) > 1) { + if (split(/,/,$rest) > 1) { $r->print(&mt('Helpdesk staff can use this role if their institutional type is one of: [_1].', $newsettings{$role}{'status'})); } else { @@ -8120,15 +8178,15 @@ sub update_helpdeskaccess { $r->print('
      • '.&mt('Privileges which are available by default for this ad hoc role, but are disabled for this specific '.lc($crstype).':'). '
        • '.$newsettings{$role}{'off'}.'
      • '); } else { - $r->print('
      • '.&mt('All privileges available by default for this ad hoc role are enabled.').'
      • '); + $r->print('
      • '.&mt('All privileges available by default for this ad hoc role are enabled.').'
      • '); } } - if ($changed{$role}{'on'}) { + if ($changed{$role}{'on'}) { if ($newsettings{$role}{'on'}) { $r->print('
      • '.&mt('Privileges which are not available by default for this ad hoc role, but are enabled for this specific '.lc($crstype).':'). '
        • '.$newsettings{$role}{'on'}.'
      • '); } else { - $r->print('
      • '.&mt('None of the privileges unavailable by default for this ad hoc role are enabled.').'
      • '); + $r->print('
      • '.&mt('None of the privileges unavailable by default for this ad hoc role are enabled.').'
      • '); } } } @@ -8137,7 +8195,7 @@ sub update_helpdeskaccess { $r->print('
      '); } } else { - $r->print(&mt('No changes made to helpdesk access settings.')); + $r->print(&mt('No changes made to helpdesk access settings.')); } } return; @@ -8195,7 +8253,7 @@ sub user_search_result { my $domd_chk = &domdirectorysrch_check($srch); $response .= ''.$instd_chk.'
      '; if ($domd_chk eq 'ok') { - $response .= &mt('You may want to search in the LON-CAPA domain instead of the institutional directory.'); + $response .= &mt('You may want to search in the LON-CAPA domain instead of in the institutional directory.'); } $response .= '
      '; } @@ -8206,7 +8264,7 @@ sub user_search_result { my $instd_chk = &instdirectorysrch_check($srch); $response .= ''.$domd_chk.'
      '; if ($instd_chk eq 'ok') { - $response .= &mt('You may want to search in the institutional directory instead of the LON-CAPA domain.'); + $response .= &mt('You may want to search in the institutional directory instead of in the LON-CAPA domain.'); } $response .= '
      '; } @@ -8307,7 +8365,7 @@ sub user_search_result { $response = ''. &mt('Institutional directory search is not available in domain: [_1]',$showdom). '
      '. - &mt('You may want to search in the LON-CAPA domain instead of the institutional directory.'). + &mt('You may want to search in the LON-CAPA domain instead of in the institutional directory.'). '
      '; } } @@ -8380,7 +8438,7 @@ sub user_search_result { $response = ''. &mt('Institutional directory search is not available in domain: [_1]',$showdom). '
      '. - &mt('You may want to search in the LON-CAPA domain instead of the institutional directory.'). + &mt('You may want to search in the LON-CAPA domain instead of in the institutional directory.'). '
      '; } } @@ -8616,7 +8674,6 @@ sub build_search_response { ,' ' ,'') .'
      '; - } } }