version 1.470, 2023/11/03 01:12:15
|
version 1.474, 2023/11/17 17:02:20
|
Line 279 sub build_tools_display {
|
Line 279 sub build_tools_display {
|
'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", |
'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 324 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', |
|
'domcoord.author'); |
@usertools = ('webdav','editors','managers'); |
@usertools = ('webdav','editors','managers'); |
$colspan = ' colspan="2"'; |
$colspan = ' colspan="2"'; |
} else { |
} else { |
Line 339 sub build_tools_display {
|
Line 340 sub build_tools_display {
|
$currdisp,$custdisp,$custradio,$onclick); |
$currdisp,$custdisp,$custradio,$onclick); |
$cust_off = 'checked="checked" '; |
$cust_off = 'checked="checked" '; |
$tool_on = 'checked="checked" '; |
$tool_on = 'checked="checked" '; |
$curr_access = |
unless (($context eq 'authordefaults') && ($item ne '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" '; |
Line 590 sub build_tools_display {
|
Line 593 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 3227 sub update_user_data {
|
Line 3232 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'); |
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 3432 sub update_user_data {
|
Line 3437 sub update_user_data {
|
'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 3783 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 3796 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 ne 'quota') { |
} elsif ($key ne 'quota') { |
Line 3814 sub update_user_data {
|
Line 3854 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 4068 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", |
'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 5498 sub display_coauthor_managers {
|
Line 5549 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 6393 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 6502 function updateCols(caller) {
|
Line 6553 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 6647 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 6892 sub print_main_menu {
|
Line 6961 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'}), |