');
$r->print(&personal_data_display($ccuname,$ccdomain,$newuser,$context,
- $inst_results{$ccuname.':'.$ccdomain},$readonly));
+ $inst_results{$ccuname.':'.$ccdomain}));
# 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',
@@ -1646,7 +1383,7 @@ $lt{'hs'}: $home_server_pick
}
if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) {
$r->print('
'.
- &mt('Can Request Creation of Courses/Communities in this Domain?').'
'.
+ &mt('User Can Request Creation of Courses/Communities in this Domain?').''.
&Apache::loncommon::start_data_table().
&build_tools_display($ccuname,$ccdomain,
'requestcourses').
@@ -1742,55 +1479,41 @@ 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('Can Request Creation of Courses/Communities in this Domain?').'
'."\n".
+ $r->print('
'.&mt('User Can Request Creation of Courses/Communities in this Domain?').'
');
- my @order = ('auth','quota','tools','requestauthor','authordefaults');
+ my @order = ('auth','quota','tools','requestauthor');
my %user_text;
my ($isadv,$isauthor) =
&Apache::lonnet::is_advanced_user($ccdomain,$ccuname);
- if (((&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) ||
+ if ((!$isauthor) &&
+ ((&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) ||
(&Apache::lonnet::allowed('udp',$env{'request.role.domain'}))) &&
- ($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;
- }
+ ($env{'request.role.domain'} eq $ccdomain)) {
+ $user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain);
}
- $user_text{'auth'} = &user_authentication($ccuname,$ccdomain,$formname,$crstype,$permission);
+ $user_text{'auth'} = &user_authentication($ccuname,$ccdomain,$formname);
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
- 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();
+ $user_text{'quota'} = &user_quotas($ccuname,$ccdomain);
}
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",
- 'youd' => "You do not have privileges to modify the portfolio quota for this user.",
+ '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.",
'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, Personal Information Page, or Time Zone settings for this user.",
+ 'yodo' => "You do not have privileges to modify Portfolio, Blog, WebDAV, or Personal Information Page 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(''.
@@ -1901,9 +1624,6 @@ 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;
}
@@ -1962,16 +1682,14 @@ sub date_sections_select {
sub validation_javascript {
my ($context,$ccdomain,$pjump_def,$crstype,$groupslist,$newuser,$formname,
- $loaditem,$permission) = @_;
+ $loaditem) = @_;
my $dc_setcourse_code = '';
my $nondc_setsection_code = '';
if ($context eq 'domain') {
- 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);
- }
+ 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))) {
@@ -2043,12 +1761,7 @@ 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') {
- 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'}));
- }
+ next unless (($rnum eq $env{'user.name'}) && ($rdom eq $env{'request.role.domain'}));
}
my ($newkey,$newvalue,$newrole);
$newkey = '/'.$rdom.'/'.$rnum;
@@ -2208,8 +1921,6 @@ 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;
}
@@ -2312,9 +2023,6 @@ 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');
@@ -2356,25 +2064,13 @@ sub new_coauthor_roles {
#
# Co-Author
#
- 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'};
+ if (&Apache::lonuserutils::authorpriv($env{'user.name'},
+ $env{'request.role.domain'}) &&
+ ($env{'user.name'} ne $ccuname || $env{'user.domain'} ne $ccdomain)) {
# No sense in assigning co-author role to yourself
- 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) {
+ $addrolesdisplay = 1;
+ my $cuname=$env{'user.name'};
+ my $cudom=$env{'request.role.domain'};
my %lt=&Apache::lonlocal::texthash(
'cs' => "Authoring Space",
'act' => "Activate",
@@ -2429,17 +2125,6 @@ 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;;
}
@@ -2460,11 +2145,20 @@ sub new_domain_roles {
'
'.&mt('Start').'
'.&mt('End').'
'.
&Apache::loncommon::end_data_table_header_row();
my @allroles = &Apache::lonuserutils::roles_by_context('domain');
+ my $uprimary = &Apache::lonnet::domain($env{'request.role.domain'},'primary');
+ my $uintdom = &Apache::lonnet::internet_dom($uprimary);
foreach my $thisdomain (sort(&Apache::lonnet::all_domains())) {
foreach my $role (@allroles) {
next if ($role eq 'ad');
next if (($role eq 'au') && ($ccdomain ne $thisdomain));
if (&Apache::lonnet::allowed('c'.$role,$thisdomain)) {
+ if ($role eq 'dc') {
+ unless ($thisdomain eq $env{'request.role.domain'}) {
+ my $domprim = &Apache::lonnet::domain($thisdomain,'primary');
+ my $intdom = &Apache::lonnet::internet_dom($domprim);
+ next unless ($uintdom eq $intdom);
+ }
+ }
my $plrole=&Apache::lonnet::plaintext($role);
my %lt=&Apache::lonlocal::texthash(
'ssd' => "Set Start Date",
@@ -2495,7 +2189,7 @@ sub new_domain_roles {
}
sub user_authentication {
- my ($ccuname,$ccdomain,$formname,$crstype,$permission) = @_;
+ my ($ccuname,$ccdomain,$formname) = @_;
my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain);
my $outcome;
my %lt=&Apache::lonlocal::texthash(
@@ -2533,6 +2227,7 @@ $lt{'uuas'} ($currentauth). $lt{'adcs'}.
ENDBADAUTH
}
} else { # Authentication type is valid
+
&initialize_authen_forms($ccdomain,$formname,$currentauth,'modifyuser');
my ($authformcurrent,$can_modify,@authform_others) =
&modify_login_block($ccdomain,$currentauth);
@@ -2567,43 +2262,6 @@ ENDBADAUTH
}
$outcome .= &Apache::loncommon::end_data_table();
} else {
- if (($currentauth =~ /^internal:/) &&
- (&Apache::lonuserutils::can_change_internalpass($ccuname,$ccdomain,$crstype,$permission))) {
- $outcome = <<"ENDJS";
-
-ENDJS
-
- $outcome .= '
'.&Apache::loncommon::end_data_table_row()
.&Apache::loncommon::end_data_table();
@@ -7573,7 +6531,6 @@ 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.',
@@ -7586,24 +6543,13 @@ 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 catalog display of "Official courses (with institutional codes)".',
+ dc_addinst => 'Ask a domain coordinator to enable display the catalog 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.','"','"');
@@ -7729,11 +6675,9 @@ 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);
}
@@ -8096,10 +7040,9 @@ ENDSCRIPT
my ($nav_script,$nav_links);
# table header
- my $heading = '