');
$r->print(&personal_data_display($ccuname,$ccdomain,$newuser,$context,
- $inst_results{$ccuname.':'.$ccdomain}));
+ $inst_results{$ccuname.':'.$ccdomain},$readonly));
# Option to disable student/employee ID conflict checking not offerred for new users.
my ($home_server_pick,$numlib) =
&Apache::loncommon::home_server_form_item($ccdomain,'hserver',
@@ -1370,7 +1652,7 @@ $lt{'hs'}: $home_server_pick
}
if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) {
$r->print('
'.
- &mt('User Can Request Creation of Courses/Communities in this Domain?').'
'.
+ &mt('Can Request Creation of Courses/Communities in this Domain?').''.
&Apache::loncommon::start_data_table().
&build_tools_display($ccuname,$ccdomain,
'requestcourses').
@@ -1466,7 +1748,7 @@ ENDAUTH
$inst_results{$ccuname.':'.$ccdomain}));
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?').'
'.
+ $r->print('
'.&mt('Can Request Creation of Courses/Communities in this Domain?').'
');
- my @order = ('auth','quota','tools','requestauthor');
+ my @order = ('auth','quota','tools','requestauthor','authordefaults');
my %user_text;
my ($isadv,$isauthor) =
&Apache::lonnet::is_advanced_user($ccdomain,$ccuname);
- if ((!$isauthor) &&
- ((&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) ||
+ if (((&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) ||
(&Apache::lonnet::allowed('udp',$env{'request.role.domain'}))) &&
- ($env{'request.role.domain'} eq $ccdomain)) {
- $user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain);
+ ($env{'request.role.domain'} eq $ccdomain)) {
+ if (!$isauthor) {
+ $user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain);
+ }
+ $user_text{'authordefaults'} = &authoring_defaults($ccuname,$ccdomain);
+ if (&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) {
+ $need_quota_js = 1;
+ }
}
$user_text{'auth'} = &user_authentication($ccuname,$ccdomain,$formname,$crstype,$permission);
if ((&Apache::lonnet::allowed('mpq',$ccdomain)) ||
(&Apache::lonnet::allowed('mut',$ccdomain)) ||
(&Apache::lonnet::allowed('udp',$ccdomain))) {
+ $user_text{'quota'} = '
'.&mt('User Tools').'
'."\n".
+ &Apache::loncommon::start_data_table();
+ if ((&Apache::lonnet::allowed('mut',$ccdomain)) ||
+ (&Apache::lonnet::allowed('udp',$ccdomain))) {
+ $user_text{'quota'} .= &build_tools_display($ccuname,$ccdomain,'tools');
+ }
# Current user has quota modification privileges
- $user_text{'quota'} = &user_quotas($ccuname,$ccdomain);
+ if ((&Apache::lonnet::allowed('mpq',$ccdomain)) ||
+ (&Apache::lonnet::allowed('udp',$ccdomain))) {
+ $user_text{'quota'} .= &user_quotas($ccuname,$ccdomain,'portfolio');
+ $need_quota_js = 1;
+ }
+ $user_text{'quota'} .= &Apache::loncommon::end_data_table();
}
if (!&Apache::lonnet::allowed('mpq',$ccdomain)) {
if (&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) {
my %lt=&Apache::lonlocal::texthash(
- 'dska' => "Disk quotas for user's portfolio and Authoring Space",
- 'youd' => "You do not have privileges to modify the portfolio and/or Authoring Space quotas for this user.",
+ 'dska' => "Disk quotas for user's portfolio",
+ 'youd' => "You do not have privileges to modify the portfolio quota for this user.",
'ichr' => "If a change is required, contact a domain coordinator for the domain",
);
$user_text{'quota'} = < "User Tools Availability",
- 'yodo' => "You do not have privileges to modify Portfolio, Blog, WebDAV, or Personal Information Page settings for this user.",
+ 'yodo' => "You do not have privileges to modify Portfolio, Blog, Personal Information Page, or Time Zone settings for this user.",
'ifch' => "If a change is required, contact a domain coordinator for the domain",
);
$user_text{'tools'} = <print(' onclick="auth_check()" \>'."\n");
} else {
- $r->print('onclick="this.form.submit()" \>'."\n");
+ $r->print(' onclick="this.form.submit()" \>'."\n");
}
} else {
$r->print(''.
@@ -1609,6 +1907,9 @@ ENDNOTOOLSPRIV
$r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','userrole','ccdomain','prevphase','currstate','ccuname','ccdomain']));
$r->print('');
$r->print('
');
+ if ($need_quota_js) {
+ $r->print(&user_quota_js());
+ }
return;
}
@@ -1667,14 +1968,16 @@ sub date_sections_select {
sub validation_javascript {
my ($context,$ccdomain,$pjump_def,$crstype,$groupslist,$newuser,$formname,
- $loaditem) = @_;
+ $loaditem,$permission) = @_;
my $dc_setcourse_code = '';
my $nondc_setsection_code = '';
if ($context eq 'domain') {
- my $dcdom = $env{'request.role.domain'};
- $loaditem->{'onload'} = "document.cu.coursedesc.value='';";
- $dc_setcourse_code =
- &Apache::lonuserutils::dc_setcourse_js('cu','singleuser',$context);
+ if ((ref($permission) eq 'HASH') && ($permission->{'cusr'})) {
+ my $dcdom = $env{'request.role.domain'};
+ $loaditem->{'onload'} = "document.cu.coursedesc.value='';";
+ $dc_setcourse_code =
+ &Apache::lonuserutils::dc_setcourse_js('cu','singleuser',$context);
+ }
} else {
my $checkauth;
if (($newuser) || (&Apache::lonnet::allowed('mau',$ccdomain))) {
@@ -1746,7 +2049,12 @@ sub display_existing_roles {
next unless (($rnum eq $env{'course.'.$env{'request.course.id'}.'.num'})
&& ($rdom eq $env{'course.'.$env{'request.course.id'}.'.domain'}));
} elsif ($context eq 'author') {
- next unless (($rnum eq $env{'user.name'}) && ($rdom eq $env{'request.role.domain'}));
+ if ($env{'request.role'} =~ m{^ca\./($match_domain)/($match_username)$}) {
+ my ($audom,$auname) = ($1,$2);
+ next unless (($rnum eq $auname) && ($rdom eq $audom));
+ } else {
+ next unless (($rnum eq $env{'user.name'}) && ($rdom eq $env{'request.role.domain'}));
+ }
}
my ($newkey,$newvalue,$newrole);
$newkey = '/'.$rdom.'/'.$rnum;
@@ -1906,6 +2214,8 @@ sub display_existing_roles {
$area=~m{/($match_domain)/($match_username)};
if (&Apache::lonuserutils::authorpriv($2,$1)) {
$allowed=1;
+ } elsif (&Apache::lonuserutils::coauthorpriv($2,$1)) {
+ $allowed=1;
} else {
$allowed=0;
}
@@ -2008,6 +2318,9 @@ sub display_existing_roles {
}
} elsif ($env{'request.role'} =~ /^au\./) {
$contextrole = &mt('Existing Co-Author Roles in your Authoring Space');
+ } elsif ($env{'request.role'} =~ m{^ca\./($match_domain)/($match_username)/$}) {
+ $contextrole = &mt('Existing Co-Author Roles in [_1] Authoring Space',
+ ''.$1.'_'.$2.'');
} else {
if ($showall) {
$contextrole = &mt('Existing Roles in this Domain');
@@ -2049,13 +2362,25 @@ sub new_coauthor_roles {
#
# Co-Author
#
- if (&Apache::lonuserutils::authorpriv($env{'user.name'},
- $env{'request.role.domain'}) &&
- ($env{'user.name'} ne $ccuname || $env{'user.domain'} ne $ccdomain)) {
+ my ($cuname,$cudom);
+ if (($env{'request.role'} eq "au./$env{'user.domain'}/") ||
+ ($env{'request.role'} eq "dc./$env{'user.domain'}/")) {
+ $cuname=$env{'user.name'};
+ $cudom=$env{'request.role.domain'};
# No sense in assigning co-author role to yourself
- $addrolesdisplay = 1;
- my $cuname=$env{'user.name'};
- my $cudom=$env{'request.role.domain'};
+ if ((&Apache::lonuserutils::authorpriv($cuname,$cudom)) &&
+ ($env{'user.name'} ne $ccuname || $env{'user.domain'} ne $ccdomain)) {
+ $addrolesdisplay = 1;
+ }
+ } elsif ($env{'request.role'} =~ m{^ca\./($match_domain)/($match_username)$}) {
+ ($cudom,$cuname) = ($1,$2);
+ if ((&Apache::lonuserutils::coauthorpriv($cuname,$cudom)) &&
+ ($env{'user.name'} ne $ccuname || $env{'user.domain'} ne $ccdomain) &&
+ ($cudom ne $ccdomain || $cuname ne $ccuname)) {
+ $addrolesdisplay = 1;
+ }
+ }
+ if ($addrolesdisplay) {
my %lt=&Apache::lonlocal::texthash(
'cs' => "Authoring Space",
'act' => "Activate",
@@ -2110,6 +2435,17 @@ sub new_coauthor_roles {
($env{'user.domain'} eq $ccdomain)) {
$r->print(&mt('Assigning yourself a co-author or assistant co-author role in your own author area in Authoring Space is not permitted'));
}
+ } elsif ($env{'request.role'} =~ m{^ca\./($match_domain)/($match_username)$}) {
+ if (!(&Apache::lonuserutils::coauthorpriv($2,$1))) {
+ $r->print(''.
+ &mt('You do not have privileges to assign co-author roles.').
+ '');
+ } elsif (($env{'user.name'} eq $ccuname) &&
+ ($env{'user.domain'} eq $ccdomain)) {
+ $r->print(&mt('Assigning yourself a co-author or assistant co-author role in an author area in Authoring Space in which you already have a co-author role is not permitted'));
+ } elsif (($cudom eq $ccdomain) && ($cuname eq $ccuname)) {
+ $r->print(&mt("Assigning a co-author or assistant co-author role to an Authoring Space's author is not permitted"));
+ }
}
return $addrolesdisplay;;
}
@@ -2382,9 +2718,9 @@ sub modify_login_block {
}
sub personal_data_display {
- my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray,$now,
+ my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$readonly,$rolesarray,$now,
$captchaform,$emailusername,$usertype,$usernameset,$condition,$excluded,$showsubmit) = @_;
- my ($output,%userenv,%canmodify,%canmodify_status);
+ my ($output,%userenv,%canmodify,%canmodify_status,$disabled);
my @userinfo = ('firstname','middlename','lastname','generation',
'permanentemail','id');
my $rowcount = 0;
@@ -2453,6 +2789,8 @@ sub personal_data_display {
%canmodify = &selfcreate_canmodify($context,$ccdomain,\@userinfo,
$inst_results,$rolesarray);
}
+ } elsif ($readonly) {
+ $disabled = ' disabled="disabled"';
}
my $genhelp=&Apache::loncommon::help_open_topic('Generation');
@@ -2493,8 +2831,8 @@ sub personal_data_display {
}
$rowcount ++;
$output .= &Apache::lonhtmlcommon::row_closure(1);
- my $upassone = '';
- my $upasstwo = '';
+ my $upassone = '';
+ my $upasstwo = '';
$output .= &Apache::lonhtmlcommon::row_title(&mt('Password').'*',
'LC_pick_box_title',
'LC_oddrow_value')."\n".
@@ -2540,7 +2878,7 @@ sub personal_data_display {
$hiderow = 1;
}
} else {
- $row .= '';
+ $row .= '';
}
}
} else {
@@ -2556,7 +2894,7 @@ sub personal_data_display {
$hiderow = 1;
}
} else {
- $row .= '';
+ $row .= '';
}
}
} else {
@@ -2626,9 +2964,10 @@ sub personal_data_display {
' ';
if ($usertype ne '') {
- $output .= ''.
- &Apache::lonhtmlcommon::row_closure(1);
+ $output .= '';
}
+ $output .= &Apache::lonhtmlcommon::row_closure(1);
}
}
$output .= &Apache::lonhtmlcommon::end_pick_box();
@@ -2849,9 +3188,10 @@ sub update_user_data {
my (%alerts,%rulematch,%inst_results,%curr_rules);
my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id');
- my @usertools = ('aboutme','blog','webdav','portfolio');
+ my @usertools = ('aboutme','blog','portfolio','portaccess','timezone');
my @requestcourses = ('official','unofficial','community','textbook');
my @requestauthor = ('requestauthor');
+ my @authordefaults = ('webdav','editors','archive');
my ($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'});
my %canmodify_status =
@@ -2960,6 +3300,35 @@ sub update_user_data {
$newcustom{'requestauthor'},
\%changeHash,'requestauthor');
}
+ if ($env{'form.customeditors'} == 1) {
+ my @editors;
+ my @posseditors = &Apache::loncommon::get_env_multiple('form.custom_editor');
+ if (@posseditors) {
+ foreach my $editor (@posseditors) {
+ if (grep(/^\Q$editor\E$/,@posseditors)) {
+ unless (grep(/^\Q$editor\E$/,@editors)) {
+ push(@editors,$editor);
+ }
+ }
+ }
+ }
+ if (@editors) {
+ @editors = sort(@editors);
+ $changed{'editors'} = &tool_admin('editors',join(',',@editors),
+ \%changeHash,'authordefaults');
+ }
+ }
+ if ($env{'form.customwebdav'} == 1) {
+ $newcustom{'webdav'} = $env{'form.authordefaults_webdav'};
+ $changed{'webdav'} = &tool_admin('webdav',$newcustom{'webdav'},
+ \%changeHash,'authordefaults');
+ }
+ if ($env{'form.customarchive'} == 1) {
+ $newcustom{'archive'} = $env{'form.authordefaults_archive'};
+ $changed{'archive'} = &tool_admin('archive',$newcustom{'archive'},
+ \%changeHash,'authordefaults');
+
+ }
}
if ($canmodify_status{'inststatus'}) {
if (exists($env{'form.inststatus'})) {
@@ -3025,17 +3394,24 @@ sub update_user_data {
my %userenv = &Apache::lonnet::get
('environment',['firstname','middlename','lastname','generation',
'id','permanentemail','portfolioquota','authorquota','inststatus',
- 'tools.aboutme','tools.blog','tools.webdav','tools.portfolio',
+ 'tools.aboutme','tools.blog','tools.webdav',
+ 'tools.portfolio','tools.timezone','tools.portaccess',
+ 'authormanagers','authoreditors','authorarchive','requestauthor',
'requestcourses.official','requestcourses.unofficial',
'requestcourses.community','requestcourses.textbook',
'reqcrsotherdom.official','reqcrsotherdom.unofficial',
'reqcrsotherdom.community','reqcrsotherdom.textbook',
- 'requestauthor'],
+ 'domcoord.author'],
$env{'form.ccdomain'},$env{'form.ccuname'});
my ($tmp) = keys(%userenv);
if ($tmp =~ /^(con_lost|error)/i) {
%userenv = ();
}
+ unless (($userenv{'domcoord.author'} eq 'blocked') &&
+ (($env{'user.name'} ne $env{'form.ccuname'}) ||
+ ($env{'user.domain'} ne $env{'form.ccdomain'}))) {
+ push(@authordefaults,'managers');
+ }
my $no_forceid_alert;
# Check to see if user information can be changed
my %domconfig =
@@ -3158,7 +3534,7 @@ sub update_user_data {
%oldsettingstatus,%newsettingstatus);
@disporder = ('inststatus');
if ($env{'request.role.domain'} eq $env{'form.ccdomain'}) {
- push(@disporder,'requestcourses','requestauthor');
+ push(@disporder,('requestcourses','requestauthor','authordefaults'));
} else {
push(@disporder,'reqcrsotherdom');
}
@@ -3186,6 +3562,7 @@ sub update_user_data {
}
if (&Apache::lonnet::allowed('cau',$env{'form.ccdomain'})) {
$canshow{'requestauthor'} = 1;
+ $canshow{'authordefaults'} = 1;
}
my (%changeHash,%changed);
if ($oldinststatus eq '') {
@@ -3294,8 +3671,14 @@ sub update_user_data {
if ($env{'form.ccdomain'} eq $env{'request.role.domain'}) {
&tool_changes('requestcourses',\@requestcourses,\%oldsettings,\%oldsettingstext,
\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext);
- &tool_changes('requestauthor',\@requestauthor,\%oldsettings,\%oldsettingstext,
- \%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext);
+ my ($isadv,$isauthor) =
+ &Apache::lonnet::is_advanced_user($env{'form.ccdomain'},$env{'form.ccuname'});
+ unless ($isauthor) {
+ &tool_changes('requestauthor',\@requestauthor,\%oldsettings,\%oldsettingstext,
+ \%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext);
+ }
+ &tool_changes('authordefaults',\@authordefaults,\%oldsettings,\%oldsettingstext,
+ \%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext);
} else {
&tool_changes('reqcrsotherdom',\@requestcourses,\%oldsettings,\%oldsettingstext,
\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext);
@@ -3313,13 +3696,61 @@ sub update_user_data {
if ((keys(%namechanged) > 0) || (keys(%changed) > 0)) {
my ($chgresult,$namechgresult);
if (keys(%changed) > 0) {
- $chgresult =
+ $chgresult =
&Apache::lonnet::put('environment',\%changeHash,
$env{'form.ccdomain'},$env{'form.ccuname'});
if ($chgresult eq 'ok') {
+ my ($ca_mgr_del,%ca_mgr_add);
+ if ($changed{'managers'}) {
+ my (@adds,@dels);
+ if ($changeHash{'authormanagers'} eq '') {
+ @dels = split(/,/,$userenv{'authormanagers'});
+ } elsif ($userenv{'authormanagers'} eq '') {
+ @adds = split(/,/,$changeHash{'authormanagers'});
+ } else {
+ my @old = split(/,/,$userenv{'authormanagers'});
+ my @new = split(/,/,$changeHash{'authormanagers'});
+ my @diffs = &Apache::loncommon::compare_arrays(\@old,\@new);
+ if (@diffs) {
+ foreach my $user (@diffs) {
+ if (grep(/^\Q$user\E$/,@old)) {
+ push(@dels,$user);
+ } elsif (grep(/^\Q$user\E$/,@new)) {
+ push(@adds,$user);
+ }
+ }
+ }
+ }
+ my $key = "internal.manager./$env{'form.ccdomain'}/$env{'form.ccuname'}";
+ if (@dels) {
+ foreach my $user (@dels) {
+ if ($user =~ /^($match_username):($match_domain)$/) {
+ &Apache::lonnet::del('environment',[$key],$2,$1);
+ }
+ }
+ my $curruser = $env{'user.name'}.':'.$env{'user.domain'};
+ if (grep(/^\Q$curruser\E$/,@dels)) {
+ $ca_mgr_del = $key;
+ }
+ }
+ if (@adds) {
+ foreach my $user (@adds) {
+ if ($user =~ /^($match_username):($match_domain)$/) {
+ &Apache::lonnet::put('environment',{$key => 1},$2,$1);
+ }
+ }
+ my $curruser = $env{'user.name'}.':'.$env{'user.domain'};
+ if (grep(/^\Q$curruser\E$/,@adds)) {
+ $ca_mgr_add{$key} = 1;
+ }
+ }
+ }
if (($env{'user.name'} eq $env{'form.ccuname'}) &&
($env{'user.domain'} eq $env{'form.ccdomain'})) {
- my %newenvhash;
+ my (%newenvhash,$got_domdefs,%domdefaults,$got_userenv,
+ %userenv);
+ my @fromenv = keys(%changed);
+ push(@fromenv,'inststatus');
foreach my $key (keys(%changed)) {
if (($key eq 'official') || ($key eq 'unofficial')
|| ($key eq 'community') || ($key eq 'textbook')) {
@@ -3328,18 +3759,71 @@ sub update_user_data {
if ($changeHash{'requestcourses.'.$key}) {
$newenvhash{'environment.canrequest.'.$key} = 1;
} else {
+ unless ($got_domdefs) {
+ %domdefaults =
+ &Apache::lonnet::get_domain_defaults($env{'user.domain'});
+ $got_domdefs = 1;
+ }
+ unless ($got_userenv) {
+ %userenv =
+ &Apache::lonnet::userenvironment($env{'user.domain'},
+ $env{'user.name'},@fromenv);
+ $got_userenv = 1;
+ }
$newenvhash{'environment.canrequest.'.$key} =
&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},
- $key,'reload','requestcourses');
+ $key,'reload','requestcourses',\%userenv,\%domdefaults);
}
} elsif ($key eq 'requestauthor') {
$newenvhash{'environment.'.$key} = $changeHash{$key};
if ($changeHash{$key}) {
$newenvhash{'environment.canrequest.author'} = 1;
} else {
+ unless ($got_domdefs) {
+ %domdefaults =
+ &Apache::lonnet::get_domain_defaults($env{'user.domain'});
+ $got_domdefs = 1;
+ }
+ unless ($got_userenv) {
+ %userenv =
+ &Apache::lonnet::userenvironment($env{'user.domain'},
+ $env{'user.name'},@fromenv);
+ $got_userenv = 1;
+ }
$newenvhash{'environment.canrequest.author'} =
&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},
- $key,'reload','requestauthor');
+ $key,'reload','requestauthor',\%userenv,\%domdefaults);
+ }
+ } elsif ($key eq 'editors') {
+ $newenvhash{'environment.author'.$key} = $changeHash{'author'.$key};
+ if ($env{'form.customeditors'}) {
+ $newenvhash{'environment.editors'} = $changeHash{'author'.$key};
+ } else {
+ unless ($got_domdefs) {
+ %domdefaults =
+ &Apache::lonnet::get_domain_defaults($env{'user.domain'});
+ $got_domdefs = 1;
+ }
+ if ($domdefaults{'editors'} ne '') {
+ $newenvhash{'environment.editors'} = $domdefaults{'editors'};
+ } else {
+ $newenvhash{'environment.editors'} = 'edit,xml';
+ }
+ }
+ } elsif ($key eq 'archive') {
+ $newenvhash{'environment.author.'.$key} =
+ $changeHash{'author.'.$key};
+ if ($changeHash{'author.'.$key} ne '') {
+ $newenvhash{'environment.canarchive'} =
+ $changeHash{'author.'.$key};
+ } else {
+ unless ($got_domdefs) {
+ %domdefaults =
+ &Apache::lonnet::get_domain_defaults($env{'user.domain'});
+ $got_domdefs = 1;
+ }
+ $newenvhash{'environment.canarchive'} =
+ $domdefaults{'archive'};
}
} elsif ($key ne 'quota') {
$newenvhash{'environment.tools.'.$key} =
@@ -3348,15 +3832,37 @@ sub update_user_data {
$newenvhash{'environment.availabletools.'.$key} =
$changeHash{'tools.'.$key};
} else {
+ unless ($got_domdefs) {
+ %domdefaults =
+ &Apache::lonnet::get_domain_defaults($env{'user.domain'});
+ $got_domdefs = 1;
+ }
+ unless ($got_userenv) {
+ %userenv =
+ &Apache::lonnet::userenvironment($env{'user.domain'},
+ $env{'user.name'},@fromenv);
+ $got_userenv = 1;
+ }
$newenvhash{'environment.availabletools.'.$key} =
&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},
- $key,'reload','tools');
+ $key,'reload','tools',\%userenv,\%domdefaults);
}
}
}
if (keys(%newenvhash)) {
&Apache::lonnet::appenv(\%newenvhash);
}
+ } else {
+ if ($ca_mgr_del) {
+ &Apache::lonnet::delenv($ca_mgr_del);
+ }
+ if (keys(%ca_mgr_add)) {
+ &Apache::lonnet::appenv(\%ca_mgr_add);
+ }
+ }
+ if ($changed{'aboutme'}) {
+ &Apache::loncommon::devalidate_aboutme_cache($env{'form.ccuname'},
+ $env{'form.ccdomain'});
}
}
}
@@ -3527,6 +4033,8 @@ sub display_userinfo {
'webdav' => 'WebDAV Availability',
'aboutme' => 'Personal Information Page Availability',
'portfolio' => 'Portfolio Availability',
+ 'portaccess' => 'Portfolio Shareable',
+ 'timezone' => 'Can set own Time Zone',
'official' => 'Can Request Official Courses',
'unofficial' => 'Can Request Unofficial Courses',
'community' => 'Can Request Communities',
@@ -3534,7 +4042,13 @@ sub display_userinfo {
'requestauthor' => 'Can Request Author Role',
'inststatus' => "Affiliation",
'prvs' => 'Previous Value:',
- 'chto' => 'Changed To:'
+ 'chto' => 'Changed To:',
+ 'editors' => "Available Editors in Authoring Space",
+ 'managers' => "Co-authors who can add/revoke roles",
+ 'archive' => "Managers can download tar.gz file of Authoring Space",
+ 'edit' => 'Standard editor (Edit)',
+ 'xml' => 'Text editor (EditXML)',
+ 'daxe' => 'Daxe editor (Daxe)',
);
if ($changed) {
$r->print('
'.$lt{'uic'}.'
'.
@@ -3559,10 +4073,13 @@ sub display_userinfo {
}
foreach my $entry (@{$order}) {
if ($canshow->{$entry}) {
- if (($entry eq 'requestcourses') || ($entry eq 'reqcrsotherdom') || ($entry eq 'requestauthor')) {
+ if (($entry eq 'requestcourses') || ($entry eq 'reqcrsotherdom') ||
+ ($entry eq 'requestauthor') || ($entry eq 'authordefaults')) {
my @items;
if ($entry eq 'requestauthor') {
@items = ($entry);
+ } elsif ($entry eq 'authordefaults') {
+ @items = ('webdav','managers','editors','archive');
} else {
@items = @{$requestcourses};
}
@@ -3570,19 +4087,27 @@ sub display_userinfo {
if (($newsetting->{$item} ne $oldsetting->{$item}) ||
($newsettingtext->{$item} ne $oldsettingtext->{$item})) {
$r->print(&Apache::loncommon::start_data_table_row()."\n");
- $r->print("
'."\n";
-
- my $visactions = &cat_visibility();
+ my $visactions = &cat_visibility($cdom);
my ($cathash,%cattype);
my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
if (ref($domconfig{'coursecategories'}) eq 'HASH') {
@@ -6574,6 +7579,7 @@ sub visible_in_stdcat {
}
sub cat_visibility {
+ my ($cdom) = @_;
my %visactions = &Apache::lonlocal::texthash(
vis => 'This course/community currently appears in the Course/Community Catalog for this domain.',
gen => 'Courses can be both self-cataloging, based on an institutional code (e.g., fs08phy231), or can be assigned categories from a hierarchy defined for the domain.',
@@ -6586,13 +7592,24 @@ sub cat_visibility {
dc_chgconf => 'Ask a domain coordinator to change the Catalog type for this domain.',
dc_setcode => 'Ask a domain coordinator to assign a six character code to the course',
dc_unhide => 'Ask a domain coordinator to change the "Exclude from course catalog" setting.',
- dc_addinst => 'Ask a domain coordinator to enable display the catalog of "Official courses (with institutional codes)".',
+ dc_addinst => 'Ask a domain coordinator to enable catalog display of "Official courses (with institutional codes)".',
dc_instcode => 'Ask a domain coordinator to assign an institutional code (if this is an official course).',
dc_catalog => 'Ask a domain coordinator to enable or create at least one course category in the domain.',
dc_categories => 'Ask a domain coordinator to create a hierarchy of categories and sub categories for courses in the domain.',
dc_chgcat => 'Ask a domain coordinator to change the category assigned to the course, as the one currently assigned is no longer used in the domain',
dc_addcat => 'Ask a domain coordinator to assign a category to the course.',
);
+ if ($env{'request.role'} eq "dc./$cdom/") {
+ $visactions{'dc_chgconf'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to change the Catalog type for this domain.','»');
+ $visactions{'dc_setcode'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to assign a six character code to the course.','»');
+ $visactions{'dc_unhide'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to change the "Exclude from course catalog" setting.','»');
+ $visactions{'dc_addinst'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to enable catalog display of "Official courses (with institutional codes)".','»');
+ $visactions{'dc_instcode'} = &mt('Use: "Main menu" [_1] "View or modify a course or community" [_1] "View/Modify course owner, institutional code ... " to assign an institutional code (if this is an official course).','»');
+ $visactions{'dc_catalog'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to enable or create at least one course category in the domain.','»');
+ $visactions{'dc_categories'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to create a hierarchy of categories and sub categories for courses in the domain.','»');
+ $visactions{'dc_chgcat'} = &mt('Use: "Main menu" [_1] "View or modify a course or community" [_1] "View/Modify catalog settings for course" to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','»');
+ $visactions{'dc_addcat'} = &mt('Use: "Main menu" [_1] "View or modify a course or community" [_1] "View/Modify catalog settings for course" to assign a category to the course.','»');
+ }
$visactions{'unhide'} = &mt('Use [_1]Categorize course[_2] to change the "Exclude from course catalog" setting.','','"');
$visactions{'chgcat'} = &mt('Use [_1]Categorize course[_2] to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','"','"');
$visactions{'addcat'} = &mt('Use [_1]Categorize course[_2] to assign a category to the course.','"','"');
@@ -6718,9 +7735,11 @@ sub print_userchangelogs_display {
&Apache::loncommon::restore_course_settings('roles_log',
\%saveable_parameters);
} elsif ($context eq 'author') {
- $domain = $env{'user.domain'};
+ $domain = $env{'user.domain'};
if ($env{'request.role'} =~ m{^au\./\Q$domain\E/$}) {
$username = $env{'user.name'};
+ } elsif ($env{'request.role'} =~ m{^ca\./($match_domain)/($match_username)$}) {
+ ($domain,$username) = ($1,$2);
} else {
undef($domain);
}
@@ -7397,7 +8416,7 @@ sub role_display_filter {
} elsif ($context eq 'domain') {
@posscontexts = ('any','domain','requestauthor','domconfig','server');
} else {
- @posscontexts = ('any','author','domain');
+ @posscontexts = ('any','author','coauthor','domain');
}
foreach my $chgtype (@posscontexts) {
my $selstr = '';
@@ -7468,6 +8487,7 @@ sub rolechg_contexts {
any => 'Any',
domain => 'User Management in domain',
author => 'User Management by author',
+ coauthor => 'User Management by coauthor',
);
}
return %lt;
@@ -9212,7 +10232,7 @@ sub course_level_dc {
ENDTIMEENTRY
$otheritems .= &Apache::loncommon::end_data_table_row().
&Apache::loncommon::end_data_table()."\n";
- return $cb_jscript.$header.$hiddenitems.$otheritems;
+ return $cb_jscript.$hiddenitems.$header.$otheritems;
}
sub update_selfenroll_config {
@@ -9548,7 +10568,7 @@ sub update_selfenroll_config {
} else {
$r->print(&mt('No changes were made to the existing self-enrollment settings in this course.'));
}
- my $visactions = &cat_visibility();
+ my $visactions = &cat_visibility($cdom);
my ($cathash,%cattype);
my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
if (ref($domconfig{'coursecategories'}) eq 'HASH') {