\n");
+ "\n".''.&mt('Warning: data retrieval for multiple courses can take considerable time, as this operation is not currently optimized.').''."\n");
if ($env{'form.coursepick'}) {
$r->print(''.&mt('Searching').' ...
');
}
@@ -1342,8 +1329,9 @@ sub print_userlist {
$showroles = undef;
}
my $withsec = 1;
+ my $hidepriv = 1;
my %advrolehash = &Apache::lonnet::get_my_roles($cnum,$cdom,undef,
- \@statuses,$showroles,undef,$withsec);
+ \@statuses,$showroles,undef,$withsec,$hidepriv);
&gather_userinfo($context,$format,\%userlist,$indexhash,\%userinfo,
\%advrolehash,$permission);
} else {
@@ -1394,7 +1382,8 @@ sub print_userlist {
} elsif ($env{'form.roletype'} eq 'course') {
if ($env{'form.coursepick'}) {
my %courses = &process_coursepick();
- my %allusers;
+ my %allusers;
+ my $hidepriv = 1;
foreach my $cid (keys(%courses)) {
my ($cnum,$cdom,$cdesc) = &get_course_identity($cid);
next if ($cnum eq '' || $cdom eq '');
@@ -1412,7 +1401,7 @@ sub print_userlist {
foreach my $type (@statuses) {
$access{$type} = $type;
}
- &Apache::loncommon::get_course_users($cdom,$cnum,\%access,\@roles,\@sections,\%users,\%userdata,\%statushash);
+ &Apache::loncommon::get_course_users($cdom,$cnum,\%access,\@roles,\@sections,\%users,\%userdata,\%statushash,$hidepriv);
foreach my $user (keys(%userdata)) {
next if (ref($userinfo{$user}) eq 'HASH');
foreach my $item ('fullname','id') {
@@ -1877,7 +1866,7 @@ sub show_users_list {
$sortby = 'username';
}
my $setting = $env{'form.roletype'};
- my ($cid,$cdom,$cnum,$classgroups,$displayphotos,$displayclickers,$secfilter,$grpfilter);
+ my ($cid,$cdom,$cnum,$classgroups,$displayphotos,$displayclickers);
if ($context eq 'course') {
$cid = $env{'request.course.id'};
($cnum,$cdom) = &get_course_identity($cid);
@@ -2377,7 +2366,6 @@ END
$r->print("
$cellentry
\n");
} else {
$r->print("
$rowcount
\n");
- $checkval;
if ($actionselect) {
my $showcheckbox;
if ($role =~ /^cr\//) {
@@ -4170,7 +4158,7 @@ sub get_groupslist {
}
sub setsections_javascript {
- my ($formname,$groupslist,$mode) = @_;
+ my ($formname,$groupslist,$mode,$checkauth) = @_;
my ($checkincluded,$finish,$rolecode,$setsection_js);
if ($mode eq 'upload') {
$checkincluded = 'formname.name == "'.$formname.'"';
@@ -4178,12 +4166,26 @@ sub setsections_javascript {
$rolecode = "var role = formname.defaultrole.options[formname.defaultrole.selectedIndex].value;\n";
} elsif ($formname eq 'cu') {
$checkincluded = 'formname.elements[i-1].checked == true';
- $finish = 'formname.submit()';
+ if ($checkauth) {
+ $finish = "var authcheck = auth_check();\n".
+ " if (authcheck == 'ok') {\n".
+ " formname.submit();\n".
+ " }\n";
+ } else {
+ $finish = 'formname.submit()';
+ }
$rolecode = "var match = str.split('_');
var role = match[3];\n";
} elsif ($formname eq 'enrollstudent') {
$checkincluded = 'formname.name == "'.$formname.'"';
- $finish = 'formname.submit()';
+ if ($checkauth) {
+ $finish = "var authcheck = auth_check();\n".
+ " if (authcheck == 'ok') {\n".
+ " formname.submit();\n".
+ " }\n";
+ } else {
+ $finish = 'formname.submit()';
+ }
$rolecode = "var match = str.split('_');
var role = match[1];\n";
} else {
@@ -4520,15 +4522,19 @@ sub get_course_identity {
}
sub dc_setcourse_js {
- my ($formname,$mode) = @_;
- my $dc_setcourse_code;
+ my ($formname,$mode,$context) = @_;
+ my ($dc_setcourse_code,$authen_check);
my $cctext = &Apache::lonnet::plaintext('cc');
my %alerts = §ioncheck_alerts();
my $role = 'role';
if ($mode eq 'upload') {
$role = 'courserole';
+ } else {
+ $authen_check = &verify_authen($formname,$context);
}
$dc_setcourse_code = (<<"SCRIPTTOP");
+$authen_check
+
function setCourse() {
var course = document.$formname.dccourse.value;
if (course != "") {
@@ -4613,9 +4619,11 @@ SCRIPTTOP
}
}
}
- document.$formname.submit();
+ var authcheck = auth_check();
+ if (authcheck == 'ok') {
+ document.$formname.submit();
+ }
}
-
ENDSCRIPT
} else {
$dc_setcourse_code .= "
@@ -4636,6 +4644,66 @@ ENDSCRIPT
return -1;
}
ENDSCRIPT
+ return $dc_setcourse_code;
+}
+
+sub verify_authen {
+ my ($formname,$context) = @_;
+ my %alerts = &authcheck_alerts();
+ my $finish = "return 'ok';";
+ if ($context eq 'author') {
+ $finish = "document.$formname.submit();";
+ }
+ my $outcome = <<"ENDSCRIPT";
+
+function auth_check() {
+ var logintype;
+ if (document.$formname.login.length) {
+ if (document.$formname.login.length > 0) {
+ var loginpicked = 0;
+ for (var i=0; i 'You must choose an authentication type.',
+ krb => 'You need to specify the Kerberos domain.',
+ ipass => 'You need to specify the initial password.',
+ );
+ return %alerts;
+}
+
1;