version 1.470, 2023/11/03 01:12:15
|
version 1.483, 2025/01/13 01:00:58
|
Line 245 function toggleCustom(form,item,name) {
|
Line 245 function toggleCustom(form,item,name) {
|
if (radioname) { |
if (radioname) { |
if (radioname.length > 0) { |
if (radioname.length > 0) { |
var setvis; |
var setvis; |
|
var RegExp = /^customtext_(aboutme|blog|portfolio|portaccess|timezone|webdav|archive)\$/; |
for (var i=0; i<radioname.length; i++) { |
for (var i=0; i<radioname.length; i++) { |
if (radioname[i].checked == true) { |
if (radioname[i].checked == true) { |
if (radioname[i].value == 1) { |
if (radioname[i].value == 1) { |
divid.style.display = 'block'; |
if (RegExp.test(item)) { |
|
divid.style.display = 'inline'; |
|
} else { |
|
divid.style.display = 'block'; |
|
} |
setvis = 1; |
setvis = 1; |
} |
} |
break; |
break; |
Line 273 sub build_tools_display {
|
Line 278 sub build_tools_display {
|
my ($ccuname,$ccdomain,$context) = @_; |
my ($ccuname,$ccdomain,$context) = @_; |
my (@usertools,%userenv,$output,@options,%validations,%reqtitles,%reqdisplay, |
my (@usertools,%userenv,$output,@options,%validations,%reqtitles,%reqdisplay, |
$colspan,$isadv,%domconfig,@defaulteditors,@customeditors,@custommanagers, |
$colspan,$isadv,%domconfig,@defaulteditors,@customeditors,@custommanagers, |
@possmanagers,$editorsty,$customsty); |
@possmanagers); |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
'blog' => "Personal User Blog", |
'blog' => "Personal User Blog", |
'aboutme' => "Personal Information Page", |
'aboutme' => "Personal Information Page", |
'webdav' => "WebDAV access to Authoring Spaces (https)", |
'webdav' => "WebDAV access to Authoring Spaces (https)", |
'editors' => "Available Editors", |
'editors' => "Available Editors", |
'managers' => "Co-authors who can add/revoke co-authors", |
'managers' => "Co-authors who can add/revoke roles", |
|
'archive' => "Managers can download tar.gz file of Authoring Space", |
'portfolio' => "Personal User Portfolio", |
'portfolio' => "Personal User Portfolio", |
'portaccess' => "Portfolio Shareable", |
'portaccess' => "Portfolio Shareable", |
'timezone' => "Can set Time Zone", |
'timezone' => "Can set Time Zone", |
Line 324 sub build_tools_display {
|
Line 330 sub build_tools_display {
|
%domconfig = |
%domconfig = |
&Apache::lonnet::get_dom('configuration',['quotas','authordefaults'],$ccdomain); |
&Apache::lonnet::get_dom('configuration',['quotas','authordefaults'],$ccdomain); |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,'tools.webdav', |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,'tools.webdav', |
'authoreditors','authormanagers'); |
'authoreditors','authormanagers', |
@usertools = ('webdav','editors','managers'); |
'authorarchive','domcoord.author'); |
|
@usertools = ('webdav','editors','managers','archive'); |
$colspan = ' colspan="2"'; |
$colspan = ' colspan="2"'; |
} else { |
} else { |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
Line 336 sub build_tools_display {
|
Line 343 sub build_tools_display {
|
} |
} |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
my ($custom_access,$curr_access,$cust_on,$cust_off,$tool_on,$tool_off, |
my ($custom_access,$curr_access,$cust_on,$cust_off,$tool_on,$tool_off, |
$currdisp,$custdisp,$custradio,$onclick); |
$currdisp,$custdisp,$custradio,$onclick,$customsty,$editorsty); |
$cust_off = 'checked="checked" '; |
$cust_off = 'checked="checked" '; |
$tool_on = 'checked="checked" '; |
$tool_on = 'checked="checked" '; |
$curr_access = |
unless (($context eq 'authordefaults') || ($item eq 'webdav')) { |
&Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef, |
$curr_access = |
$context,\%userenv,'', |
&Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef, |
{'is_adv' => $isadv}); |
$context,\%userenv,'', |
|
{'is_adv' => $isadv}); |
|
} |
if ($context eq 'requestauthor') { |
if ($context eq 'requestauthor') { |
if ($userenv{$context} ne '') { |
if ($userenv{$context} ne '') { |
$cust_on = ' checked="checked" '; |
$cust_on = ' checked="checked" '; |
$cust_off = ''; |
$cust_off = ''; |
} |
} |
} elsif ($context eq 'authordefaults') { |
} elsif ($context eq 'authordefaults') { |
if ($item eq 'editors') { |
if (($item eq 'editors') || ($item eq 'archive')) { |
if ($userenv{'author'.$item} ne '') { |
if ($userenv{'author'.$item} ne '') { |
$cust_on = ' checked="checked" '; |
$cust_on = ' checked="checked" '; |
$cust_off = ''; |
$cust_off = ''; |
|
if ($item eq 'archive') { |
|
$curr_access = $userenv{'author'.$item}; |
|
} |
|
} elsif ($item eq 'archive') { |
|
$curr_access = 0; |
|
if (ref($domconfig{'authordefaults'}) eq 'HASH') { |
|
$curr_access = $domconfig{'authordefaults'}{'archive'}; |
|
} |
} |
} |
} elsif ($item eq 'webdav') { |
} elsif ($item eq 'webdav') { |
if ($userenv{'tools.'.$item} ne '') { |
if ($userenv{'tools.'.$item} ne '') { |
$cust_on = ' checked="checked" '; |
$cust_on = ' checked="checked" '; |
$cust_off = ''; |
$cust_off = ''; |
|
$curr_access = $userenv{'tools.'.$item}; |
|
} else { |
|
$curr_access = |
|
&Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,'reload', |
|
undef,\%userenv,'', |
|
{'is_adv' => $isadv}); |
} |
} |
} |
} |
} elsif ($userenv{$context.'.'.$item} ne '') { |
} elsif ($userenv{$context.'.'.$item} ne '') { |
Line 449 sub build_tools_display {
|
Line 472 sub build_tools_display {
|
my $current = $userenv{$context.'.'.$item}; |
my $current = $userenv{$context.'.'.$item}; |
if ($item eq 'webdav') { |
if ($item eq 'webdav') { |
$current = $userenv{'tools.webdav'}; |
$current = $userenv{'tools.webdav'}; |
|
} elsif ($item eq 'archive') { |
|
$current = $userenv{'author'.$item}; |
} |
} |
if ($current eq '') { |
if ($current eq '') { |
$custom_access = |
$custom_access = |
Line 473 sub build_tools_display {
|
Line 498 sub build_tools_display {
|
' </tr>'."\n". |
' </tr>'."\n". |
&Apache::loncommon::start_data_table_row()."\n"; |
&Apache::loncommon::start_data_table_row()."\n"; |
if (($context eq 'requestcourses') || ($context eq 'requestauthor')) { |
if (($context eq 'requestcourses') || ($context eq 'requestauthor')) { |
my ($curroption,$currlimit,$customsty); |
my ($curroption,$currlimit); |
my $envkey = $context.'.'.$item; |
my $envkey = $context.'.'.$item; |
if ($context eq 'requestauthor') { |
if ($context eq 'requestauthor') { |
$envkey = $context; |
$envkey = $context; |
} |
} |
if ($userenv{$envkey} ne '') { |
if ($userenv{$envkey} ne '') { |
$curroption = $userenv{$envkey}; |
$curroption = $userenv{$envkey}; |
$customsty = ' style="display:block"'; |
|
} else { |
} else { |
$customsty = ' style="display:none"'; |
|
my (@inststatuses); |
my (@inststatuses); |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
$curroption = |
$curroption = |
Line 590 sub build_tools_display {
|
Line 613 sub build_tools_display {
|
} elsif ($item eq 'managers') { |
} elsif ($item eq 'managers') { |
$output .= '<td'.$colspan.'>'.$custom_access.'</td>'."\n". |
$output .= '<td'.$colspan.'>'.$custom_access.'</td>'."\n". |
&Apache::loncommon::end_data_table_row()."\n"; |
&Apache::loncommon::end_data_table_row()."\n"; |
unless (&Apache::lonnet::allowed('udp',$ccdomain)) { |
unless ((&Apache::lonnet::allowed('udp',$ccdomain)) || |
|
(($userenv{'domcoord.author'} eq 'blocked') && |
|
(($env{'user.name'} ne $ccuname) || ($env{'user.domain'} ne $ccdomain)))) { |
$output .= |
$output .= |
&Apache::loncommon::start_data_table_row()."\n". |
&Apache::loncommon::start_data_table_row()."\n". |
'<td'.$colspan.'>'; |
'<td'.$colspan.'>'; |
Line 1506 sub print_user_modification_page {
|
Line 1531 sub print_user_modification_page {
|
'bread_crumbs_component' => 'User Management'}; |
'bread_crumbs_component' => 'User Management'}; |
if ($env{'form.popup'}) { |
if ($env{'form.popup'}) { |
$args->{'no_nav_bar'} = 1; |
$args->{'no_nav_bar'} = 1; |
|
$args->{'add_modal'} = 1; |
} |
} |
if (($context eq 'domain') && ($env{'request.role.domain'} eq $ccdomain)) { |
if (($context eq 'domain') && ($env{'request.role.domain'} eq $ccdomain)) { |
my @toggles; |
my @toggles; |
Line 1515 sub print_user_modification_page {
|
Line 1541 sub print_user_modification_page {
|
unless ($isauthor) { |
unless ($isauthor) { |
push(@toggles,'requestauthor'); |
push(@toggles,'requestauthor'); |
} |
} |
push(@toggles,('webdav','editors')); |
push(@toggles,('webdav','editors','archive')); |
} |
} |
if (&Apache::lonnet::allowed('mut',$ccdomain)) { |
if (&Apache::lonnet::allowed('mut',$ccdomain)) { |
push(@toggles,('aboutme','blog','portfolio','portaccess','timezone')); |
push(@toggles,('aboutme','blog','portfolio','portaccess','timezone')); |
Line 2891 sub personal_data_display {
|
Line 2917 sub personal_data_display {
|
$rowcount ++; |
$rowcount ++; |
} |
} |
} |
} |
|
my %shownfields; |
|
if ($env{'request.role.domain'} ne $ccdomain) { |
|
my %shownfields_by_type = |
|
&Apache::lonuserutils::get_othdom_shownfields($ccdomain,\@userinfo); |
|
my @types = split(/:/,$userenv{'inststatus'}); |
|
if (@types == 0) { |
|
@types = ('default'); |
|
} |
|
foreach my $type (@types) { |
|
if (ref($shownfields_by_type{$type}) eq 'HASH') { |
|
foreach my $field (keys(%{$shownfields_by_type{$type}})) { |
|
if ($shownfields_by_type{$type}{$field}) { |
|
$shownfields{$field} = 1; |
|
} |
|
} |
|
} |
|
} |
|
} |
foreach my $item (@userinfo) { |
foreach my $item (@userinfo) { |
my $rowtitle = $lt{$item}; |
my $rowtitle = $lt{$item}; |
my $hiderow = 0; |
my $hiderow = 0; |
Line 2937 sub personal_data_display {
|
Line 2981 sub personal_data_display {
|
$row .= '<br />'.&Apache::lonuserutils::forceid_change($context); |
$row .= '<br />'.&Apache::lonuserutils::forceid_change($context); |
} |
} |
} else { |
} else { |
$row .= $userenv{$item}; |
if ($env{'request.role.domain'} ne $ccdomain) { |
|
if ($shownfields{$item}) { |
|
$row .= $userenv{$item}; |
|
} else { |
|
$row .= &mt('not shown'); |
|
} |
|
} else { |
|
$row .= $userenv{$item}; |
|
} |
} |
} |
} |
} |
$row .= &Apache::lonhtmlcommon::row_closure(1); |
$row .= &Apache::lonhtmlcommon::row_closure(1); |
Line 3227 sub update_user_data {
|
Line 3279 sub update_user_data {
|
my @usertools = ('aboutme','blog','portfolio','portaccess','timezone'); |
my @usertools = ('aboutme','blog','portfolio','portaccess','timezone'); |
my @requestcourses = ('official','unofficial','community','textbook','placement','lti'); |
my @requestcourses = ('official','unofficial','community','textbook','placement','lti'); |
my @requestauthor = ('requestauthor'); |
my @requestauthor = ('requestauthor'); |
my @authordefaults = ('webdav','editors','managers'); |
my @authordefaults = ('webdav','editors','archive'); |
my ($othertitle,$usertypes,$types) = |
my ($othertitle,$usertypes,$types) = |
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'}); |
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'}); |
my %canmodify_status = |
my %canmodify_status = |
Line 3357 sub update_user_data {
|
Line 3409 sub update_user_data {
|
if ($env{'form.customwebdav'} == 1) { |
if ($env{'form.customwebdav'} == 1) { |
$newcustom{'webdav'} = $env{'form.authordefaults_webdav'}; |
$newcustom{'webdav'} = $env{'form.authordefaults_webdav'}; |
$changed{'webdav'} = &tool_admin('webdav',$newcustom{'webdav'}, |
$changed{'webdav'} = &tool_admin('webdav',$newcustom{'webdav'}, |
\%changeHash,'authordefaults'); |
\%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 ($canmodify_status{'inststatus'}) { |
Line 3426 sub update_user_data {
|
Line 3484 sub update_user_data {
|
'id','permanentemail','portfolioquota','authorquota','inststatus', |
'id','permanentemail','portfolioquota','authorquota','inststatus', |
'tools.aboutme','tools.blog','tools.webdav', |
'tools.aboutme','tools.blog','tools.webdav', |
'tools.portfolio','tools.timezone','tools.portaccess', |
'tools.portfolio','tools.timezone','tools.portaccess', |
'authormanagers','authoreditors','requestauthor', |
'authormanagers','authoreditors','authorarchive','requestauthor', |
'requestcourses.official','requestcourses.unofficial', |
'requestcourses.official','requestcourses.unofficial', |
'requestcourses.community','requestcourses.textbook', |
'requestcourses.community','requestcourses.textbook', |
'requestcourses.placement','requestcourses.lti', |
'requestcourses.placement','requestcourses.lti', |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.community','reqcrsotherdom.textbook', |
'reqcrsotherdom.community','reqcrsotherdom.textbook', |
'reqcrsotherdom.placement'], |
'reqcrsotherdom.placement','domcoord.author'], |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
my ($tmp) = keys(%userenv); |
my ($tmp) = keys(%userenv); |
if ($tmp =~ /^(con_lost|error)/i) { |
if ($tmp =~ /^(con_lost|error)/i) { |
%userenv = (); |
%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; |
my $no_forceid_alert; |
# Check to see if user information can be changed |
# Check to see if user information can be changed |
my %domconfig = |
my %domconfig = |
Line 3773 sub update_user_data {
|
Line 3836 sub update_user_data {
|
} |
} |
if (($env{'user.name'} eq $env{'form.ccuname'}) && |
if (($env{'user.name'} eq $env{'form.ccuname'}) && |
($env{'user.domain'} eq $env{'form.ccdomain'})) { |
($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)) { |
foreach my $key (keys(%changed)) { |
if (($key eq 'official') || ($key eq 'unofficial') || |
if (($key eq 'official') || ($key eq 'unofficial') || |
($key eq 'community') || ($key eq 'textbook') || |
($key eq 'community') || ($key eq 'textbook') || |
Line 3783 sub update_user_data {
|
Line 3849 sub update_user_data {
|
if ($changeHash{'requestcourses.'.$key}) { |
if ($changeHash{'requestcourses.'.$key}) { |
$newenvhash{'environment.canrequest.'.$key} = 1; |
$newenvhash{'environment.canrequest.'.$key} = 1; |
} else { |
} 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} = |
$newenvhash{'environment.canrequest.'.$key} = |
&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, |
&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, |
$key,'reload','requestcourses'); |
$key,'reload','requestcourses',\%userenv,\%domdefaults); |
} |
} |
} elsif ($key eq 'requestauthor') { |
} elsif ($key eq 'requestauthor') { |
$newenvhash{'environment.'.$key} = $changeHash{$key}; |
$newenvhash{'environment.'.$key} = $changeHash{$key}; |
if ($changeHash{$key}) { |
if ($changeHash{$key}) { |
$newenvhash{'environment.canrequest.author'} = 1; |
$newenvhash{'environment.canrequest.author'} = 1; |
} else { |
} 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'} = |
$newenvhash{'environment.canrequest.author'} = |
&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, |
&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, |
$key,'reload','requestauthor'); |
$key,'reload','requestauthor',\%userenv,\%domdefaults); |
} |
} |
} elsif ($key eq 'editors') { |
} elsif ($key eq 'editors') { |
$newenvhash{'environment.author'.$key} = $changeHash{'author'.$key}; |
$newenvhash{'environment.author'.$key} = $changeHash{'author'.$key}; |
if ($key eq 'editors') { |
if ($env{'form.customeditors'}) { |
if ($env{'form.customeditors'}) { |
$newenvhash{'environment.editors'} = $changeHash{'author'.$key}; |
$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 { |
} else { |
$newenvhash{'environment.editors'} = |
$newenvhash{'environment.editors'} = 'edit,xml'; |
&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, |
} |
$key,'reload','authordefaults'); |
} |
|
} 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') { |
} elsif ($key ne 'quota') { |
$newenvhash{'environment.tools.'.$key} = |
$newenvhash{'environment.tools.'.$key} = |
Line 3814 sub update_user_data {
|
Line 3922 sub update_user_data {
|
$newenvhash{'environment.availabletools.'.$key} = |
$newenvhash{'environment.availabletools.'.$key} = |
$changeHash{'tools.'.$key}; |
$changeHash{'tools.'.$key}; |
} else { |
} 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} = |
$newenvhash{'environment.availabletools.'.$key} = |
&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, |
&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, |
$key,'reload','tools'); |
$key,'reload','tools',\%userenv,\%domdefaults); |
} |
} |
} |
} |
} |
} |
Line 4017 sub display_userinfo {
|
Line 4136 sub display_userinfo {
|
'prvs' => 'Previous Value:', |
'prvs' => 'Previous Value:', |
'chto' => 'Changed To:', |
'chto' => 'Changed To:', |
'editors' => "Available Editors in Authoring Space", |
'editors' => "Available Editors in Authoring Space", |
'managers' => "Co-authors who can add/revoke co-authors", |
'managers' => "Co-authors who can add/revoke roles", |
|
'archive' => "Managers can download tar.gz file of Authoring Space", |
'edit' => 'Standard editor (Edit)', |
'edit' => 'Standard editor (Edit)', |
'xml' => 'Text editor (EditXML)', |
'xml' => 'Text editor (EditXML)', |
'daxe' => 'Daxe editor (Daxe)', |
'daxe' => 'Daxe editor (Daxe)', |
Line 4051 sub display_userinfo {
|
Line 4171 sub display_userinfo {
|
if ($entry eq 'requestauthor') { |
if ($entry eq 'requestauthor') { |
@items = ($entry); |
@items = ($entry); |
} elsif ($entry eq 'authordefaults') { |
} elsif ($entry eq 'authordefaults') { |
@items = ('webdav','managers','editors'); |
@items = ('webdav','managers','editors','archive'); |
} else { |
} else { |
@items = @{$requestcourses}; |
@items = @{$requestcourses}; |
} |
} |
Line 4302 sub tool_changes {
|
Line 4422 sub tool_changes {
|
} elsif ($tool eq 'webdav') { |
} elsif ($tool eq 'webdav') { |
$envkey = 'tools.webdav'; |
$envkey = 'tools.webdav'; |
$newval = $env{'form.'.$context.'_'.$tool}; |
$newval = $env{'form.'.$context.'_'.$tool}; |
|
} elsif ($tool eq 'archive') { |
|
$envkey = 'authorarchive'; |
|
$newval = $env{'form.'.$context.'_'.$tool}; |
} |
} |
} else { |
} else { |
$newval = $env{'form.'.$context.'_'.$tool}; |
$newval = $env{'form.'.$context.'_'.$tool}; |
Line 4333 sub tool_changes {
|
Line 4456 sub tool_changes {
|
} elsif ($tool eq 'editors') { |
} elsif ($tool eq 'editors') { |
$oldaccesstext->{$tool} = &mt('can use: [_1]', |
$oldaccesstext->{$tool} = &mt('can use: [_1]', |
join(', ', map { $tooldesc{$_} } split(/,/,$userenv->{$envkey}))); |
join(', ', map { $tooldesc{$_} } split(/,/,$userenv->{$envkey}))); |
} elsif ($tool eq 'webdav') { |
} elsif (($tool eq 'webdav') || ($tool eq 'archive')) { |
if ($userenv->{$envkey}) { |
if ($userenv->{$envkey}) { |
$oldaccesstext->{$tool} = &mt("availability set to 'on'"); |
$oldaccesstext->{$tool} = &mt("availability set to 'on'"); |
} else { |
} else { |
Line 4379 sub tool_changes {
|
Line 4502 sub tool_changes {
|
$managers =~ s/,/, /g; |
$managers =~ s/,/, /g; |
$newaccesstext->{$tool} = $managers; |
$newaccesstext->{$tool} = $managers; |
} |
} |
} elsif ($tool eq 'webdav') { |
} elsif (($tool eq 'webdav') || ($tool eq 'archive')) { |
if ($newval) { |
if ($newval) { |
$newaccesstext->{$tool} = &mt("availability set to 'on'"); |
$newaccesstext->{$tool} = &mt("availability set to 'on'"); |
} else { |
} else { |
Line 4419 sub tool_changes {
|
Line 4542 sub tool_changes {
|
$managers =~ s/,/, /g; |
$managers =~ s/,/, /g; |
$newaccesstext->{$tool} = $managers; |
$newaccesstext->{$tool} = $managers; |
} |
} |
} elsif ($tool eq 'webdav') { |
} elsif (($tool eq 'webdav') || ($tool eq 'archive')) { |
if ($userenv->{$envkey}) { |
if ($userenv->{$envkey}) { |
$newaccesstext->{$tool} = &mt("availability set to 'on'"); |
$newaccesstext->{$tool} = &mt("availability set to 'on'"); |
} else { |
} else { |
Line 4468 sub tool_changes {
|
Line 4591 sub tool_changes {
|
$managers =~ s/,/, /g; |
$managers =~ s/,/, /g; |
$newaccesstext->{$tool} = $managers; |
$newaccesstext->{$tool} = $managers; |
} |
} |
} elsif ($tool eq 'webdav') { |
} elsif (($tool eq 'webdav') || ($tool eq 'archive')) { |
if ($userenv->{$envkey}) { |
if ($userenv->{$envkey}) { |
$newaccesstext->{$tool} = &mt("availability set to 'on'"); |
$newaccesstext->{$tool} = &mt("availability set to 'on'"); |
} else { |
} else { |
Line 4516 sub tool_changes {
|
Line 4639 sub tool_changes {
|
} elsif ($tool eq 'editors') { |
} elsif ($tool eq 'editors') { |
$newaccesstext->{$tool} = &mt('can use: [_1]', |
$newaccesstext->{$tool} = &mt('can use: [_1]', |
join(', ', map { $tooldesc{$_} } split(/,/,$newval))); |
join(', ', map { $tooldesc{$_} } split(/,/,$newval))); |
} elsif ($tool eq 'webdav') { |
} elsif (($tool eq 'webdav') || ($tool eq 'archive')) { |
if ($newval) { |
if ($newval) { |
$newaccesstext->{$tool} = &mt("availability set to 'on'"); |
$newaccesstext->{$tool} = &mt("availability set to 'on'"); |
} else { |
} else { |
Line 5180 sub tool_admin {
|
Line 5303 sub tool_admin {
|
$toolchanged = 1; |
$toolchanged = 1; |
if ($tool eq 'requestauthor') { |
if ($tool eq 'requestauthor') { |
$changeHash->{$context} = $settool; |
$changeHash->{$context} = $settool; |
} elsif (($tool eq 'managers') || ($tool eq 'editors')) { |
} elsif (($tool eq 'managers') || ($tool eq 'editors') || ($tool eq 'archive')) { |
$changeHash->{'author'.$tool} = $settool; |
$changeHash->{'author'.$tool} = $settool; |
} elsif ($tool eq 'webdav') { |
} elsif ($tool eq 'webdav') { |
$changeHash->{'tools.'.$tool} = $settool; |
$changeHash->{'tools.'.$tool} = $settool; |
Line 5498 sub display_coauthor_managers {
|
Line 5621 sub display_coauthor_managers {
|
} |
} |
$output .= "</p>\n"; |
$output .= "</p>\n"; |
if (@possmanagers) { |
if (@possmanagers) { |
$output .= '<p>'.&mt('Select manager(s)').': '; |
$output .= '<p>'.&mt('If checked, can manage').': '; |
foreach my $user (@possmanagers) { |
foreach my $user (@possmanagers) { |
my $checked; |
my $checked; |
if (grep(/^\Q$user\E$/,@custommanagers)) { |
if (grep(/^\Q$user\E$/,@custommanagers)) { |
Line 6342 sub handler {
|
Line 6465 sub handler {
|
if (($permission->{cusr}) && ($context eq 'author')) { |
if (($permission->{cusr}) && ($context eq 'author')) { |
push(@{$brcrum}, |
push(@{$brcrum}, |
{href => '/adm/createuser?action=camanagers', |
{href => '/adm/createuser?action=camanagers', |
text => 'Co-authors who manage', |
text => 'Co-author Managers', |
help => 'Author_Manage_Coauthors'}); |
help => 'Author_Manage_Coauthors'}); |
if ($env{'form.state'} eq 'process') { |
if ($env{'form.state'} eq 'process') { |
push(@{$brcrum}, |
push(@{$brcrum}, |
Line 6396 sub handler {
|
Line 6519 sub handler {
|
$r->internal_redirect('/adm/viewcoauthors'); |
$r->internal_redirect('/adm/viewcoauthors'); |
return OK; |
return OK; |
} |
} |
|
} elsif (($env{'form.action'} eq 'setenv') && ($context eq 'author')) { |
|
my ($role,$audom,$auname,$canview,$canedit) = |
|
&Apache::lonviewcoauthors::get_allowable(); |
|
push(@{$brcrum}, |
|
{href => '/adm/createuser?action=calist', |
|
text => 'Coauthor-viewable list', |
|
help => 'Author_List_Coauthors'}); |
|
my $args = { 'bread_crumbs' => $brcrum }; |
|
$r->print(&Apache::loncommon::start_page('Coauthor-viewable list',undef, |
|
$args)); |
|
my %viewsettings = |
|
&Apache::lonviewcoauthors::retrieve_view_settings($auname,$audom,$role); |
|
if ($viewsettings{'show'} eq 'none') { |
|
$r->print('<h3>'.&mt('Coauthor-viewable listing').'</h3>'. |
|
'<p class="LC_info">'. |
|
&mt('Listing of co-authors not enabled for this Authoring Space'). |
|
'</p>'); |
|
} else { |
|
&Apache::lonviewcoauthors::print_coauthors($r,$auname,$audom,$role, |
|
'/adm/createuser',\%viewsettings); |
|
} |
} else { |
} else { |
$bread_crumbs_component = 'User Management'; |
$bread_crumbs_component = 'User Management'; |
$args = { bread_crumbs => $brcrum, |
$args = { bread_crumbs => $brcrum, |
Line 6502 function updateCols(caller) {
|
Line 6646 function updateCols(caller) {
|
document.getElementById('showcolstart').checked = false; |
document.getElementById('showcolstart').checked = false; |
document.getElementById('showcolend').checked = false; |
document.getElementById('showcolend').checked = false; |
} |
} |
|
if (context == 'author') { |
|
if (document.studentform.Status.options[document.studentform.Status.selectedIndex].value == 'Expired') { |
|
document.getElementById('showcolmanager').checked = false; |
|
document.getElementById('showcolmanager').disabled = 'disabled'; |
|
} else if (document.studentform.showrole.options[document.studentform.showrole.selectedIndex].value != 'aa') { |
|
document.getElementById('showcolmanager').checked = true; |
|
document.getElementById('showcolmanager').disabled = ''; |
|
} |
|
} |
} |
} |
} |
} |
if (caller == 'output') { |
if (caller == 'output') { |
Line 6587 function updateCols(caller) {
|
Line 6740 function updateCols(caller) {
|
} |
} |
} |
} |
} |
} |
|
if (context == 'author') { |
|
if (document.studentform.showrole.options[document.studentform.showrole.selectedIndex].value == 'aa') { |
|
document.getElementById('showcolmanager').checked = false; |
|
document.getElementById('showcolmanager').disabled = 'disabled'; |
|
} else if (document.studentform.Status.options[document.studentform.Status.selectedIndex].value != 'Expired') { |
|
document.getElementById('showcolmanager').checked = true; |
|
document.getElementById('showcolmanager').disabled = ''; |
|
} |
|
} |
} |
} |
return; |
return; |
} |
} |
Line 6882 sub print_main_menu {
|
Line 7044 sub print_main_menu {
|
); |
); |
} |
} |
} elsif ($context eq 'author') { |
} elsif ($context eq 'author') { |
|
my $coauthorlist; |
|
if ($env{'request.role'} =~ m{^(?:ca|aa)\./($match_domain)/($match_username)$}) { |
|
if ($env{'environment.internal.coauthorlist./'.$1.'/'.$2}) { |
|
$coauthorlist = 1; |
|
} |
|
} elsif ($env{'request.role'} eq "au./$env{'user.domain'}/") { |
|
if ($env{'environment.coauthorlist'}) { |
|
$coauthorlist = 1; |
|
} |
|
} |
|
if ($coauthorlist) { |
|
push(@{ $menu[1]->{items} }, |
|
{ |
|
linktext => 'Co-author-viewable list', |
|
icon => 'clst.png', |
|
#help => 'Coauthor_Listing', |
|
url => '/adm/createuser?action=calist&forceedit=0', |
|
permission => $permission->{'cusr'}, |
|
linktitle => 'Co-author-viewable listing', |
|
}); |
|
} |
push(@{ $menu[2]->{items} }, #Category: Administration |
push(@{ $menu[2]->{items} }, #Category: Administration |
{ |
{ |
linktext => 'Change Log', |
linktext => 'Change Log', |
Line 6892 sub print_main_menu {
|
Line 7075 sub print_main_menu {
|
linktitle => 'View change log.', |
linktitle => 'View change log.', |
}, |
}, |
{ |
{ |
linktext => 'Co-authors who can add/revoke co-author roles', |
linktext => 'Co-author Managers', |
icon => 'helpdesk-access.png', |
icon => 'camanager.png', |
#help => 'Coauthor_Management', |
#help => 'Coauthor_Management', |
url => '/adm/createuser?action=camanagers', |
url => '/adm/createuser?action=camanagers', |
permission => $permission->{'author'}, |
permission => $permission->{'author'}, |
linktitle => 'Assign/Revoke right to manage co-author roles', |
linktitle => 'Assign/Revoke right to manage co-author roles', |
}, |
}, |
{ |
{ |
linktext => 'Configure coauthor-viewable listing', |
linktext => 'Configure Co-author Listing', |
icon => 'helpdesk-access.png', |
icon => 'coauthors.png', |
#help => 'Coauthor_Settings', |
#help => 'Coauthor_Settings', |
url => '/adm/createuser?action=calist&forceedit=1', |
url => '/adm/createuser?action=calist&forceedit=1', |
permission => ($permission->{'cusr'}), |
permission => ($permission->{'cusr'}), |