'.&mt('No information to display for this account request.').'
');
}
+ } else {
+ $r->print('
'.&mt('No information available for this account request.').'
');
}
}
}
}
- $r->print(&close_popup_form());
}
+ $r->print(&close_popup_form());
} elsif (($env{'form.action'} eq 'listusers') &&
($permission->{'view'} || $permission->{'cusr'})) {
+ my $helpitem = 'Course_View_Class_List';
+ if ($context eq 'author') {
+ $helpitem = 'Author_View_Coauthor_List';
+ } elsif ($context eq 'domain') {
+ $helpitem = 'Domain_View_Users_List';
+ }
if ($env{'form.phase'} eq 'bulkchange') {
push(@{$brcrum},
{href => '/adm/createuser?action=listusers',
text => "List Users"},
{href => "/adm/createuser",
text => "Result",
- help => 'Course_View_Class_List'});
+ help => $helpitem});
$bread_crumbs_component = 'Update Users';
$args = {bread_crumbs => $brcrum,
bread_crumbs_component => $bread_crumbs_component};
@@ -4872,7 +5084,7 @@ sub handler {
push(@{$brcrum},
{href => '/adm/createuser?action=listusers',
text => "List Users",
- help => 'Course_View_Class_List'});
+ help => $helpitem});
$bread_crumbs_component = 'List Users';
$args = {bread_crumbs => $brcrum,
bread_crumbs_component => $bread_crumbs_component};
@@ -4953,9 +5165,6 @@ sub handler {
}
} elsif ($env{'form.action'} eq 'selfenroll') {
if ($permission->{selfenrolladmin}) {
- my $cid = $env{'request.course.id'};
- my $cdom = $env{'course.'.$cid.'.domain'};
- my $cnum = $env{'course.'.$cid.'.num'};
my %currsettings = (
selfenroll_types => $env{'course.'.$cid.'.internal.selfenroll_types'},
selfenroll_registered => $env{'course.'.$cid.'.internal.selfenroll_registered'},
@@ -5001,21 +5210,18 @@ sub handler {
push(@{$brcrum},
{href => '/adm/createuser?action=selfenrollqueue',
text => 'Enrollment requests',
- help => 'Course_Self_Enrollment'});
+ help => 'Course_Approve_Selfenroll'});
$bread_crumbs_component = 'Enrollment requests';
if ($env{'form.state'} eq 'done') {
push(@{$brcrum},
{href => '/adm/createuser?action=selfenrollqueue',
text => 'Result',
- help => 'Course_Self_Enrollment'});
+ help => 'Course_Approve_Selfenroll'});
$bread_crumbs_component = 'Enrollment result';
}
$args = { bread_crumbs => $brcrum,
bread_crumbs_component => $bread_crumbs_component};
$r->print(&header(undef,$args));
- my $cid = $env{'request.course.id'};
- my $cdom = $env{'course.'.$cid.'.domain'};
- my $cnum = $env{'course.'.$cid.'.num'};
my $coursedesc = $env{'course.'.$cid.'.description'};
if (!exists($env{'form.state'})) {
$r->print('
'.&mt('Pending enrollment requests').'
'."\n");
@@ -5716,12 +5922,13 @@ function validate_types(form) {
}
function check_types(num,countfail,needaction) {
- var typeidx = getIndexByName('selfenroll_types_'+num);
+ var boxname = 'selfenroll_types_'+num;
+ var typeidx = getIndexByName(boxname);
var count = 0;
if (typeidx != -1) {
- if (document.$formname.elements[typeidx].length) {
- for (var k=0; k'.$add_domtitle.' '
.&Apache::loncommon::select_dom_form('','selfenroll_newdom',
- $includeempty,$showdomdesc,'','','',$readonly)
+ $includeempty,$showdomdesc,'',$trusted,$untrusted,$readonly)
.''
.''.&Apache::loncommon::end_data_table_row()
.&Apache::loncommon::end_data_table();
@@ -6484,6 +6692,10 @@ sub print_userchangelogs_display {
my $helpitem;
if ($context eq 'course') {
$helpitem = 'Course_User_Logs';
+ } elsif ($context eq 'domain') {
+ $helpitem = 'Domain_Role_Logs';
+ } elsif ($context eq 'author') {
+ $helpitem = 'Author_User_Logs';
}
push (@{$brcrum},
{href => '/adm/createuser?action=changelogs',
@@ -6765,6 +6977,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))
+ .'
');
+ } else {
+ $r->print(&earlyout_accesslog_form($formname,$prevphasestr,$udom));
+ }
+ return;
+ }
+ }
+
# set defaults
my $now = time();
my $defstart = $now - (7*24*3600);
@@ -6851,7 +7081,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 '');
@@ -6903,8 +7133,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(
@@ -7207,7 +7446,7 @@ 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') {
@@ -7218,7 +7457,7 @@ sub print_helpdeskaccess_display {
}
}
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'));
@@ -7416,7 +7655,9 @@ ENDJS
'rou' => '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',
@@ -7603,7 +7844,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;
@@ -7619,8 +7861,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');
}
@@ -7634,10 +7876,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') {
@@ -7650,18 +7893,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;
@@ -7842,7 +8091,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';
@@ -7852,7 +8101,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)) {
@@ -8093,6 +8342,12 @@ sub update_helpdeskaccess {
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') {
@@ -8208,18 +8463,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 .= ' ';
}
@@ -8320,7 +8575,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.').
' ';
}
}
@@ -8393,7 +8648,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.').
' ';
}
}
@@ -8566,7 +8821,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'}) {