--- loncom/interface/lonuserutils.pm 2010/01/20 20:28:40 1.97.2.6
+++ loncom/interface/lonuserutils.pm 2010/12/05 17:28:10 1.109.2.12
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.97.2.6 2010/01/20 20:28:40 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.109.2.12 2010/12/05 17:28:10 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,6 +36,7 @@ use Apache::loncommon();
use Apache::lonhtmlcommon;
use Apache::lonlocal;
use Apache::longroup;
+use Apache::lonnavmaps;
use LONCAPA qw(:DEFAULT :match);
###############################################################
@@ -295,7 +296,8 @@ sub hidden_input {
}
sub print_upload_manager_header {
- my ($r,$datatoken,$distotal,$krbdefdom,$context,$permission,$crstype)=@_;
+ my ($r,$datatoken,$distotal,$krbdefdom,$context,$permission,$crstype,$formname,
+ $can_assign)=@_;
my $javascript;
#
if (! exists($env{'form.upfile_associate'})) {
@@ -309,9 +311,9 @@ sub print_upload_manager_header {
}
}
if ($env{'form.upfile_associate'} eq 'reverse') {
- $javascript=&upload_manager_javascript_reverse_associate();
+ $javascript=&upload_manager_javascript_reverse_associate($can_assign);
} else {
- $javascript=&upload_manager_javascript_forward_associate();
+ $javascript=&upload_manager_javascript_forward_associate($can_assign);
}
#
# Deal with restored settings
@@ -325,9 +327,32 @@ sub print_upload_manager_header {
$password_choice = 'int';
}
#
- my $groupslist;
+ my ($sectionjs,$groupslist);
if ($context eq 'course') {
$groupslist = &get_groupslist();
+ if ($env{'form.context'} eq 'requestcrs') {
+ $sectionjs = <<"ENDJS";
+
+function toggleSectionsDefault() {
+ var usingsecs;
+ if (document.$formname.usesection.length > 1) {
+ for (var i=0; i\n");
$r->print('
'.
&mt('Identify fields in uploaded list')."
\n");
- $r->print(&mt('Enter as many fields as you can. The system will inform you and bring you back to this page, if the data selected are insufficient to add users.')." \n");
+ $r->print(&mt('Enter as many fields as you can.').' '.
+ &mt('The system will inform you and bring you back to this page,').
+ ' '.&mt('if the data selected are insufficient to add users.')." \n");
$r->print(&hidden_input('action','upload').
&hidden_input('state','got_file').
&hidden_input('associate','').
&hidden_input('datatoken',$datatoken).
&hidden_input('fileupload',$env{'form.fileupload'}).
&hidden_input('upfiletype',$env{'form.upfiletype'}).
- &hidden_input('upfile_associate',$env{'form.upfile_associate'}));
+ &hidden_input('upfile_associate',$env{'form.upfile_associate'}).
+ &hidden_input('context',$env{'form.context'}));
$r->print('
');
$r->print(' print("
\n".
'');
}
@@ -386,11 +414,14 @@ sub javascript_validations {
if (($context eq 'course') || ($context eq 'domain')) {
if ($context eq 'course') {
if ($env{'request.course.sec'} eq '') {
- $setsection_call = 'setSections(document.'.$param{'formname'}."'$crstype'".');';
-
- $setsections_js =
- &setsections_javascript($param{'formname'},$groupslist,
- $mode,'',$crstype);
+ $setsection_call = 'setSections(document.'.$param{'formname'}.",'$crstype'".');';
+ if ($env{'form.context'} eq 'requestcrs') {
+ $setsections_js = &newsections_javascript($param{'formname'});
+ } else {
+ $setsections_js =
+ &setsections_javascript($param{'formname'},$groupslist,
+ $mode,'',$crstype);
+ }
} else {
$setsection_call = "'ok'";
}
@@ -518,7 +549,9 @@ END
END
} else {
$section_checks = §ion_check_js();
- $optional_checks = (<{'krb4'} || $can_assign->{'krb5'}) {
+ $argreset .= " vf.krbarg.value='';\n";
+ $numbuttons ++ ;
+ }
+ if ($can_assign->{'int'}) {
+ $argreset .= " vf.intarg.value='';\n";
+ $numbuttons ++;
+ }
+ if ($can_assign->{'loc'}) {
+ $argreset .= " vf.locarg.value='';\n";
+ $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').
+ &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
+ // (see bug 6368).
+ if (nw==2) {
+ eval('vf.f'+tf+'.selectedIndex=0;')
+ alert('$warning');
+ }
+END
+ } elsif ($numbuttons > 1) {
+ $auth_update = <<"END";
+ // If we set the password, make the password form below correspond to
+ // the new value.
+ if (nw==2) {
+ changed_radio('int',document.studentform);
+ set_auth_radio_buttons('int',document.studentform);
+$argreset
+ }
+
+END
+ }
+ }
+
return(<=2) && (tw<=6)) { foundname=1; }
- if (tw==7) { foundid=1; }
- if (tw==8) { foundsec=1; }
- if (tw==9) { foundpwd=1; }
+ if (tw==2) { foundpwd=1; }
+ if ((tw>=3) && (tw<=7)) { foundname=1; }
+ if (tw==8) { foundid=1; }
+ if (tw==9) { foundsec=1; }
if (tw==10) { foundemail=1; }
if (tw==11) { foundrole=1; }
if (tw==12) { founddomain=1; }
@@ -621,14 +704,14 @@ function verify(vf,sec_caller) {
//
// 0 = none
// 1 = username
-// 2 = names (lastname, firstnames)
-// 3 = fname (firstname)
-// 4 = mname (middlename)
-// 5 = lname (lastname)
-// 6 = gen (generation)
-// 7 = id
-// 8 = section
-// 9 = ipwd (password)
+// 2 = ipwd (password)
+// 3 = names (lastname, firstnames)
+// 4 = fname (firstname)
+// 5 = mname (middlename)
+// 6 = lname (lastname)
+// 7 = gen (generation)
+// 8 = id
+// 9 = section
// 10 = email address
// 11 = role
// 12 = domain
@@ -644,39 +727,31 @@ function flip(vf,tf) {
}
}
// If we set this to 'lastname, firstnames', clear out all the ones
- // set to 'fname','mname','lname','gen' (3,4,5,6) currently.
- if (nw==2) {
+ // set to 'fname','mname','lname','gen' (4,5,6,7) currently.
+ if (nw==3) {
for (i=0;i<=vf.nfields.value;i++) {
- if ((eval('vf.f'+i+'.selectedIndex')>=3) &&
- (eval('vf.f'+i+'.selectedIndex')<=6)) {
+ if ((eval('vf.f'+i+'.selectedIndex')>=4) &&
+ (eval('vf.f'+i+'.selectedIndex')<=7)) {
eval('vf.f'+i+'.selectedIndex=0;')
}
}
}
- // If we set this to one of 'fname','mname','lname','gen' (3,4,5,6),
- // clear out any that are set to 'lastname, firstnames' (2)
- if ((nw>=3) && (nw<=6)) {
+ // If we set this to one of 'fname','mname','lname','gen' (4,5,6,7),
+ // clear out any that are set to 'lastname, firstnames' (3)
+ if ((nw>=4) && (nw<=7)) {
for (i=0;i<=vf.nfields.value;i++) {
- if (eval('vf.f'+i+'.selectedIndex')==2) {
+ if (eval('vf.f'+i+'.selectedIndex')==3) {
eval('vf.f'+i+'.selectedIndex=0;')
}
}
}
- // If we set the password, make the password form below correspond to
- // the new value.
- if (nw==9) {
- changed_radio('int',document.studentform);
- set_auth_radio_buttons('int',document.studentform);
- vf.intarg.value='';
- vf.krbarg.value='';
- vf.locarg.value='';
- }
+ $auth_update
}
function clearpwd(vf) {
var i;
for (i=0;i<=vf.nfields.value;i++) {
- if (eval('vf.f'+i+'.selectedIndex')==9) {
+ if (eval('vf.f'+i+'.selectedIndex')==2) {
eval('vf.f'+i+'.selectedIndex=0;')
}
}
@@ -688,6 +763,45 @@ ENDPICK
###############################################################
###############################################################
sub upload_manager_javascript_reverse_associate {
+ my ($can_assign) = @_;
+ my ($auth_update,$numbuttons,$argreset);
+ if (ref($can_assign) eq 'HASH') {
+ if ($can_assign->{'krb4'} || $can_assign->{'krb5'}) {
+ $argreset .= " vf.krbarg.value='';\n";
+ $numbuttons ++ ;
+ }
+ if ($can_assign->{'int'}) {
+ $argreset .= " vf.intarg.value='';\n";
+ $numbuttons ++;
+ }
+ if ($can_assign->{'loc'}) {
+ $argreset .= " vf.locarg.value='';\n";
+ $numbuttons ++;
+ }
+ if (!$can_assign->{'int'}) {
+ my $warning = &mt('You may not specify an initial password, 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
+ // (see bug 6368).
+ if (tf==1 && nw!=0) {
+ eval('vf.f'+tf+'.selectedIndex=0;')
+ alert('$warning');
+ }
+END
+ } elsif ($numbuttons > 1) {
+ $auth_update = <<"END";
+ // initial password specified, pick internal authentication
+ if (tf==1 && nw!=0) {
+ changed_radio('int',document.studentform);
+ set_auth_radio_buttons('int',document.studentform);
+$argreset
+ }
+
+END
+ }
+ }
+
return(<=1) && (i<=5)) && tw!=0 ) { foundname=1; }
- if (i==6 && tw!=0) { foundid=1; }
- if (i==7 && tw!=0) { foundsec=1; }
- if (i==8 && tw!=0) { foundpwd=1; }
- if (i==9 && tw!=0) { foundrole=1; }
- if (i==10 && tw!=0) { founddomain=1; }
- if (i==13 && tw!=0) { foundinstatus=1; }
+ if (i==1 && tw!=0) { foundpwd=1; }
+ if (((i>=2) && (i<=6)) && tw!=0 ) { foundname=1; }
+ if (i==7 && tw!=0) { foundid=1; }
+ if (i==8 && tw!=0) { foundsec=1; }
+ if (i==9 && tw!=0) { foundemail=1; }
+ if (i==10 && tw!=0) { foundrole=1; }
+ if (i==11 && tw!=0) { founddomain=1; }
+ if (i==12 && tw!=0) { foundinstatus=1; }
}
- verify_message(vf,founduname,foundpwd,foundname,foundid,foundsec,foundrole,founddomain,foundinststatus);
+ verify_message(vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail,foundrole,founddomain,foundinststatus);
}
function flip(vf,tf) {
var nw=eval('vf.f'+tf+'.selectedIndex');
var i;
// picked the all one name field, reset the other name ones to blank
- if (tf==1 && nw!=0) {
- for (i=2;i<=5;i++) {
+ if (tf==2 && nw!=0) {
+ for (i=3;i<=6;i++) {
eval('vf.f'+i+'.selectedIndex=0;')
}
}
//picked one of the piecewise name fields, reset the all in
//one field to blank
- if ((tf>=2) && (tf<=5) && (nw!=0)) {
- eval('vf.f1.selectedIndex=0;')
- }
- // intial password specified, pick internal authentication
- if (tf==8 && nw!=0) {
- changed_radio('int',document.studentform);
- set_auth_radio_buttons('int',document.studentform);
- vf.krbarg.value='';
- vf.intarg.value='';
- vf.locarg.value='';
+ if ((tf>=3) && (tf<=6) && (nw!=0)) {
+ eval('vf.f2.selectedIndex=0;')
}
+ $auth_update
}
function clearpwd(vf) {
var i;
- if (eval('vf.f8.selectedIndex')!=0) {
- eval('vf.f8.selectedIndex=0;')
+ if (eval('vf.f1.selectedIndex')!=0) {
+ eval('vf.f1.selectedIndex=0;')
}
}
ENDPICK
@@ -763,6 +872,9 @@ sub print_upload_manager_footer {
$env{'form.ipwd_choice'} ne '') {
$param{'curr_authtype'} = 'int';
}
+ if ($env{'form.context'} eq 'requestcrs') {
+ $param{'context'} = $env{'form.context'};
+ }
my $krbform = &Apache::loncommon::authform_kerberos(%param);
my $intform = &Apache::loncommon::authform_internal(%param);
my $locform = &Apache::loncommon::authform_local(%param);
@@ -775,8 +887,11 @@ sub print_upload_manager_footer {
$Str .= '
\n"
+ .&Apache::lonhtmlcommon::row_closure();
+ }
if ($context eq 'domain') {
$Str .= &Apache::lonhtmlcommon::row_title(
&mt('Settings for assigning roles'))
@@ -838,9 +958,22 @@ sub print_upload_manager_footer {
&mt('Default role'))
.&mt('Choose the role to assign to users without a value specified in the uploaded file.')
} elsif ($context eq 'course') {
- $Str .= &Apache::lonhtmlcommon::row_title(
+ if ($env{'form.context'} eq 'requestcrs') {
+ $Str .= &Apache::lonhtmlcommon::row_title(&mt('Default section')).
+ &mt('Students can be assigned to different sections.').' '.
+ &mt('Will you be using sections?').' '.
+ ''.
+ ' '.&mt('Yes').''.
+ ' ';
+ } else {
+ $Str .= &Apache::lonhtmlcommon::row_title(
&mt('Default role and section'))
- .&mt('Choose the role and/or section(s) to assign to users without values specified in the uploaded file.');
+ .&mt('Choose the role and/or section(s) to assign to users without values specified in the uploaded file.');
+ }
} else {
$Str .= &Apache::lonhtmlcommon::row_title(
&mt('Default role and/or section(s)'))
@@ -864,11 +997,22 @@ sub print_upload_manager_footer {
}
} else {
my ($cnum,$cdom) = &get_course_identity();
- my $rowtitle = &mt('section');
+ my ($rowtitle,$closure);
+ if ($env{'form.context'} eq 'requestcrs') {
+ $closure = 1;
+ $rowtitle = &mt('default section name (letters/numbers only)');
+ } else {
+ $rowtitle = &mt('section');
+ }
my $secbox = §ion_picker($cdom,$cnum,'Any',$rowtitle,
- $permission,$context,'upload',$crstype);
- $Str .= $secbox
- .&Apache::lonhtmlcommon::row_closure();
+ $permission,$context,'upload',$crstype,
+ $env{'form.context'}).
+ &Apache::lonhtmlcommon::row_closure($closure);
+ if ($env{'form.context'} eq 'requestcrs') {
+ $Str .= ''.$secbox.'
';
+ } else {
+ $Str .= $secbox;
+ }
my %lt;
if ($crstype eq 'Community') {
%lt = &Apache::lonlocal::texthash (
@@ -881,15 +1025,19 @@ sub print_upload_manager_footer {
stus => 'Students selected from this list can be dropped.'
);
}
- $Str .= &Apache::lonhtmlcommon::row_title(&mt('Full Update'))
- .' '
- .$lt{'stus'}
- .&Apache::lonhtmlcommon::row_closure();
+ unless ($env{'form.context'} eq 'requestcrs') {
+ $Str .= &Apache::lonhtmlcommon::row_title(&mt('Full Update'))
+ .' '
+ .$lt{'stus'}
+ .&Apache::lonhtmlcommon::row_closure();
+ }
}
if ($context eq 'course' || $context eq 'domain') {
- $Str .= &forceid_change($context);
+ unless ($env{'form.context'} eq 'requestcrs') {
+ $Str .= &forceid_change($context);
+ }
}
$Str .= &Apache::lonhtmlcommon::end_pick_box();
@@ -933,7 +1081,7 @@ sub forceid_change {
###############################################################
###############################################################
sub print_upload_manager_form {
- my ($r,$context,$permission,$crstype) = @_;
+ my ($r,$context,$permission,$crstype,$formname) = @_;
my $firstLine;
my $datatoken;
if (!$env{'form.datatoken'}) {
@@ -979,13 +1127,15 @@ sub print_upload_manager_form {
my ($krbdef,$krbdefdom) =
&Apache::loncommon::get_kerberos_defaults($defdom);
#
+ my ($authnum,%can_assign) = &Apache::loncommon::get_assignable_auth($defdom);
&print_upload_manager_header($r,$datatoken,$distotal,$krbdefdom,$context,
- $permission,$crstype);
+ $permission,$crstype,$formname,\%can_assign);
my $i;
my $keyfields;
if ($total>=0) {
my @field=
(['username',&mt('Username'), $env{'form.username_choice'}],
+ ['ipwd', &mt('Initial Password'),$env{'form.ipwd_choice'}],
['names',&mt('Last Name, First Names'),$env{'form.names_choice'}],
['fname',&mt('First Name'), $env{'form.fname_choice'}],
['mname',&mt('Middle Names/Initials'),$env{'form.mname_choice'}],
@@ -993,7 +1143,6 @@ sub print_upload_manager_form {
['gen', &mt('Generation'), $env{'form.gen_choice'}],
['id', &mt('Student/Employee ID'),$env{'form.id_choice'}],
['sec', &mt('Section'), $env{'form.sec_choice'}],
- ['ipwd', &mt('Initial Password'),$env{'form.ipwd_choice'}],
['email',&mt('E-mail Address'), $env{'form.email_choice'}],
['role',&mt('Role'), $env{'form.role_choice'}],
['domain',&mt('Domain'), $env{'form.domain_choice'}],
@@ -1074,15 +1223,15 @@ sub setup_date_selectors {
sub get_dates_from_form {
- my ($startname,$endname) = @_;
+ my ($startname,$endname,$timezone) = @_;
if ($startname eq '') {
$startname = 'startdate';
}
if ($endname eq '') {
$endname = 'enddate';
}
- my $startdate = &Apache::lonhtmlcommon::get_date_from_form($startname);
- my $enddate = &Apache::lonhtmlcommon::get_date_from_form($endname);
+ my $startdate = &Apache::lonhtmlcommon::get_date_from_form($startname,$timezone);
+ my $enddate = &Apache::lonhtmlcommon::get_date_from_form($endname,$timezone);
if ($env{'form.no_end_date'}) {
$enddate = 0;
}
@@ -1142,7 +1291,7 @@ sub date_setting_table {
}
sub make_dates_default {
- my ($startdate,$enddate,$context,$crstype = @_;
+ my ($startdate,$enddate,$context,$crstype) = @_;
my $result = '';
if ($context eq 'course') {
my ($cnum,$cdom) = &get_course_identity();
@@ -1177,7 +1326,7 @@ sub default_role_selector {
my %customroles;
my ($options,$coursepick,$cb_jscript);
if ($context ne 'author') {
- %customroles = &my_custom_roles();
+ %customroles = &my_custom_roles($crstype);
}
my %lt=&Apache::lonlocal::texthash(
@@ -1186,8 +1335,10 @@ sub default_role_selector {
'exs' => "Existing sections",
'new' => "New section",
);
- $options = '
\n");
}
my ($indexhash,$keylist) = &make_keylist_array();
my (%userlist,%userinfo,$clearcoursepick);
if (($context eq 'domain') &&
- ($env{'form.roletype'} eq 'course') ||
+ ($env{'form.roletype'} eq 'course') ||
($env{'form.roletype'} eq 'community')) {
my ($crstype,$numcodes,$title,$warning);
if ($env{'form.roletype'} eq 'course') {
@@ -1555,7 +1710,8 @@ sub print_userlist {
}
}
}
- } elsif ($env{'form.roletype'} eq 'course') {
+ } elsif (($env{'form.roletype'} eq 'course') ||
+ ($env{'form.roletype'} eq 'community')) {
if (($env{'form.coursepick'}) && (!$clearcoursepick)) {
my %courses = &process_coursepick();
my %allusers;
@@ -1959,13 +2115,17 @@ sub process_coursepick {
my $coursefilter = $env{'form.coursepick'};
my $cdom = $env{'request.role.domain'};
my %courses;
+ my $crssrch = 'Course';
+ if ($env{'form.roletype'} eq 'community') {
+ $crssrch = 'Community';
+ }
if ($coursefilter eq 'all') {
%courses = &Apache::lonnet::courseiddump($cdom,'.','.','.','.','.',
- undef,undef,'Course');
+ undef,undef,$crssrch);
} elsif ($coursefilter eq 'category') {
my $instcode = &instcode_from_coursefilter();
%courses = &Apache::lonnet::courseiddump($cdom,'.','.',$instcode,'.','.',
- undef,undef,'Course');
+ undef,undef,$crssrch);
} elsif ($coursefilter eq 'specific') {
if ($env{'form.coursetotal'} > 1) {
my @course_ids = split(/&&/,$env{'form.courselist'});
@@ -2085,6 +2245,7 @@ sub process_date_info {
sub show_users_list {
my ($r,$context,$mode,$permission,$statusmode,$userlist,$keylist,$formname)=@_;
+ my $custommenu;
if ($formname eq '') {
$formname = 'studentform';
}
@@ -2109,11 +2270,17 @@ sub show_users_list {
$sortby = 'username';
}
my $setting = $env{'form.roletype'};
- my ($cid,$cdom,$cnum,$classgroups,$displayphotos,$displayclickers,$crstype);
+ my ($cid,$cdom,$cnum,$classgroups,$displayphotos,$displayclickers,$crstype,
+ $clickersupport,$displaygroups);
if ($context eq 'course') {
$cid = $env{'request.course.id'};
$crstype = &Apache::loncommon::course_type();
($cnum,$cdom) = &get_course_identity($cid);
+ $custommenu = &Apache::loncommon::needs_gci_custom();
+ unless ($custommenu) {
+ $clickersupport = 1;
+ $displaygroups = 1;
+ }
($classgroups) = &Apache::loncoursedata::get_group_memberships(
$userlist,$keylist,$cdom,$cnum);
if ($mode eq 'autoenroll') {
@@ -2150,7 +2317,7 @@ END
} elsif ($context eq 'domain') {
if ($setting eq 'community') {
$crstype = 'Community';
- } elsif ($crstype eq 'course') {
+ } elsif ($setting eq 'course') {
$crstype = 'Course';
}
}
@@ -2234,6 +2401,8 @@ END
'role' => "role",
'type' => "enroll type/action",
'email' => "e-mail address",
+ 'lastlogin' => "last login",
+ 'submissions' => "test status",
'photo' => "photo",
'extent' => "extent",
'pr' => "Proceed",
@@ -2263,7 +2432,7 @@ END
push(@cols,'section');
}
if (!($context eq 'domain' && ($env{'form.roletype'} eq 'course')
- && ($env{'form.roletype'} eq 'community'))) {
+ && ($env{'form.roletype'} eq 'community'))) {
push(@cols,('start','end'));
}
if ($env{'form.showrole'} eq 'Any' || $env{'form.showrole'} eq 'cr') {
@@ -2274,35 +2443,48 @@ END
$env{'form.roletype'} eq 'community')) {
push (@cols,'extent');
}
- if (($statusmode eq 'Any') &&
+ if (($statusmode eq 'Any') &&
(!($context eq 'domain' && (($env{'form.roletype'} eq 'course')
|| ($env{'form.roletype'} eq 'community'))))) {
push(@cols,'status');
}
if ($context eq 'course') {
- push(@cols,'groups');
+ if ($displaygroups) {
+ push(@cols,'groups');
+ }
}
push(@cols,'email');
+ if ($context eq 'course') {
+ if ($custommenu) {
+ push(@cols,'lastlogin');
+ if (($env{'form.showrole'} eq 'Any') || ($env{'form.showrole'} eq 'st')) {
+ push(@cols,'submissions');
+ }
+ }
+ }
}
my $rolefilter = $env{'form.showrole'};
if ($env{'form.showrole'} eq 'cr') {
$rolefilter = &mt('custom');
} elsif ($env{'form.showrole'} ne 'Any') {
- $rolefilter = &Apache::lonnet::plaintext($env{'form.showrole'});
+ $rolefilter = &Apache::lonnet::plaintext($env{'form.showrole'},$crstype);
}
my $results_description;
if ($mode ne 'autoenroll') {
$results_description = &results_header_row($rolefilter,$statusmode,
$context,$permission,$mode,$crstype);
-
$r->print(''.$results_description.'
');
}
my ($output,$actionselect,%canchange,%canchangesec);
if ($mode eq 'html' || $mode eq 'view' || $mode eq 'autoenroll' || $mode eq 'pickauthor') {
if ($mode ne 'autoenroll' && $mode ne 'pickauthor') {
if ($permission->{'cusr'}) {
- $actionselect = &select_actions($context,$setting,$statusmode,$formname);
+ unless (($context eq 'domain') &&
+ (($setting eq 'course') || ($setting eq 'community'))) {
+ $actionselect =
+ &select_actions($context,$setting,$statusmode,$formname);
+ }
}
$r->print(<
@@ -2313,7 +2495,7 @@ END
END
if ($actionselect) {
$output .= <<"END";
-