'
+ .&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))
+ .'
'.
@@ -7593,7 +7797,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;
@@ -7609,8 +7814,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');
}
@@ -7624,10 +7829,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') {
@@ -7640,18 +7846,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;
@@ -7719,13 +7931,13 @@ sub role_priv_table {
$checked = ' checked="checked"';
}
$customstatus = '';
- $ineffect = $customstatus;
+ $ineffect = $customstatus;
} elsif ((!$levelscurrent->{'course'}{$priv}) && ($on{$priv})) {
if ($permission->{'owner'}) {
- $checked = ' checked="checked"';
+ $checked = ' checked="checked"';
}
$customstatus = '';
- $ineffect = $customstatus;
+ $ineffect = $customstatus;
}
if ($permission->{'owner'}) {
$output .= '';
@@ -7740,7 +7952,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'})) {
@@ -7832,7 +8044,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';
@@ -7842,7 +8054,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)) {
@@ -7869,7 +8081,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');
@@ -7905,7 +8117,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') {
@@ -7951,7 +8163,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)) {
@@ -7964,7 +8176,7 @@ sub update_helpdeskaccess {
}
}
if (@updatedon) {
- $newsettings{$role}{'on'} = join('
');
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 {
@@ -8123,15 +8341,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.').'
');
}
} else {
- $r->print(&mt('No changes made to helpdesk access settings.'));
+ $r->print(&mt('No changes made to helpdesk access settings.'));
}
}
return;
@@ -8198,18 +8416,18 @@ 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 .= ' ';
}
} else {
unless (($context eq 'requestcrs') && ($srch->{'srchtype'} eq 'exact')) {
my $domd_chk = &domdirectorysrch_check($srch);
- if ($domd_chk ne 'ok') {
+ if (($domd_chk ne 'ok') && ($env{'form.action'} ne 'accesslogs')) {
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 .= ' ';
}
@@ -8310,7 +8528,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.').
' ';
}
}
@@ -8383,7 +8601,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.').
' ';
}
}
@@ -8556,7 +8774,7 @@ sub build_search_response {
if ($srch->{'srchin'} ne 'alc') {
$forcenewuser = 1;
my $cansrchinst = 0;
- if ($srch->{'srchdomain'}) {
+ if (($srch->{'srchdomain'}) && ($env{'form.action'} ne 'accesslogs')) {
my %domconfig = &Apache::lonnet::get_dom('configuration',['directorysrch'],$srch->{'srchdomain'});
if (ref($domconfig{'directorysrch'}) eq 'HASH') {
if ($domconfig{'directorysrch'}{'available'}) {
@@ -8619,7 +8837,6 @@ sub build_search_response {
,' '
,'')
.' ';
-
}
}
}