'.
+ &Apache::loncommon::end_data_table_header_row().
+ &Apache::loncommon::start_data_table_row());
+ foreach my $item ('firstname','middlename','lastname','generation') {
if (&Apache::lonnet::allowed('mau',$ccdomain)) {
- $r->print(<<"END");
-
+ $r->print(<<"END");
+
END
} else {
- $r->print('
'.$userenv{$_}.'
');
+ $r->print('
'.$userenv{$item}.'
');
}
}
- $r->print(<
-
-END
+ $r->print(&Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::end_data_table());
# Build up table of user roles to allow revocation of a role.
my ($tmp) = keys(%rolesdump);
unless ($tmp =~ /^(con_lost|error)/i) {
@@ -772,7 +799,7 @@ END
$currentauth=~/^internal:/ or
$currentauth=~/^localauth:/
) { # bad authentication scheme
- if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) {
+ if (&Apache::lonnet::allowed('mau',$ccdomain)) {
&initialize_authen_forms();
my %lt=&Apache::lonlocal::texthash(
'err' => "ERROR",
@@ -795,7 +822,7 @@ $lt{'uuas'} ($currentauth). $lt{'sldb'}.
$authformloc
ENDBADAUTH
} else {
- # This user is not allowed to modify the users
+ # This user is not allowed to modify the user's
# authentication scheme, so just notify them of the problem
my %lt=&Apache::lonlocal::texthash(
'err' => "ERROR",
@@ -804,9 +831,6 @@ ENDBADAUTH
);
$r->print(<
-
$lt{'err'}:
$lt{'uuas'} ($currentauth). $lt{'adcs'}.
@@ -837,7 +861,7 @@ ENDBADAUTH
"
$authformint
$authformfsys
";
}
$authformcurrent.=' (will override current values) ';
- if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) {
+ if (&Apache::lonnet::allowed('mau',$ccdomain)) {
# Current user has login modification privileges
my %lt=&Apache::lonlocal::texthash(
'ccld' => "Change Current Login Data",
@@ -855,6 +879,23 @@ $loginscript
$lt{'enld'}
$authform_other
ENDOTHERAUTHS
+ } else {
+ if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) {
+ my %lt=&Apache::lonlocal::texthash(
+ 'ccld' => "Change Current Login Data",
+ 'yodo' => "You do not have privileges to modify the authentication configuration for this user.",
+ 'ifch' => "If a change is required, contact a domain coordinator for the domain",
+ );
+ $r->print(<
+
$lt{'ccld'}
+$lt{'yodo'} $lt{'ifch'}: $ccdomain
+ENDNOPRIV
+ }
+ }
+ if (&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) {
+ # Current user has quota modification privileges
+ $r->print(&portfolio_quota($ccuname,$ccdomain));
}
} ## End of "check for bad authentication type" logic
} ## End of new user/old user logic
@@ -879,34 +920,38 @@ ENDOTHERAUTHS
'ssd' => "Set Start Date",
'sed' => "Set End Date"
);
- $r->print(<$lt{'cs'}
-
+"javascript:pjump('."'date_end','End Date Co-Author',document.cu.end_$cudom\_$cuname\_ca.value,'end_$cudom\_$cuname\_ca','cu.pres','dateset'".')">'.$lt{'sed'}.'
+"javascript:pjump('."'date_start','Start Date Assistant Co-Author',document.cu.start_$cudom\_$cuname\_aa.value,'start_$cudom\_$cuname\_aa','cu.pres','dateset'".')">'.$lt{'ssd'}.'
+"javascript:pjump('."'date_start','Start Date $plrole',document.cu.start_$thisdomain\_$role.value,'start_$thisdomain\_$role','cu.pres','dateset'".')">'.$lt{'ssd'}.'
-ENDDROW
+"javascript:pjump('."'date_end','End Date $plrole',document.cu.end_$thisdomain\_$role.value,'end_$thisdomain\_$role','cu.pres','dateset'".')">'.$lt{'sed'}.''.
+&Apache::loncommon::end_data_table_row();
}
}
}
- $domaintext.='
';
+ $domaintext.= &Apache::loncommon::end_data_table();
if ($num_domain_level > 0) {
$r->print($domaintext);
}
@@ -1103,24 +1150,42 @@ ENDMODIFYUSERHEAD
if (! $env{'form.makeuser'} ) {
# Check for need to change
my %userenv = &Apache::lonnet::get
- ('environment',['firstname','middlename','lastname','generation'],
- $env{'form.ccdomain'},$env{'form.ccuname'});
+ ('environment',['firstname','middlename','lastname','generation',
+ 'portfolioquota'],$env{'form.ccdomain'},$env{'form.ccuname'});
my ($tmp) = keys(%userenv);
if ($tmp =~ /^(con_lost|error)/i) {
%userenv = ();
}
# Check to see if we need to change user information
- foreach ('firstname','middlename','lastname','generation') {
+ foreach my $item ('firstname','middlename','lastname','generation') {
# Strip leading and trailing whitespace
- $env{'form.c'.$_} =~ s/(\s+$|^\s+)//g;
+ $env{'form.c'.$item} =~ s/(\s+$|^\s+)//g;
+ }
+ my ($quotachanged,$namechanged,$oldportfolioquota);
+ my %changeHash;
+ if (exists($userenv{'portfolioquota'})) {
+ $oldportfolioquota = $userenv{'portfolioquota'};
+ if (exists($env{'form.portfolioquota'})) {
+ if ($env{'form.portfolioquota'} ne $userenv{'portfolioquota'}) {
+ if (&Apache::lonnet::allowed('mpq',$env{'form.ccdomain'})) {
+ # Current user has quota modification privileges
+ $quotachanged = 1;
+ $changeHash{'portfolioquota'} = $env{'form.portfolioquota'};
+ }
+ }
+ }
+ } else {
+ $oldportfolioquota = &default_quota($env{'form.ccdomain'});
}
if (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}) &&
($env{'form.cfirstname'} ne $userenv{'firstname'} ||
$env{'form.cmiddlename'} ne $userenv{'middlename'} ||
$env{'form.clastname'} ne $userenv{'lastname'} ||
$env{'form.cgeneration'} ne $userenv{'generation'} )) {
+ $namechanged = 1;
+ }
+ if ($namechanged) {
# Make the change
- my %changeHash;
$changeHash{'firstname'} = $env{'form.cfirstname'};
$changeHash{'middlename'} = $env{'form.cmiddlename'};
$changeHash{'lastname'} = $env{'form.clastname'};
@@ -1136,6 +1201,7 @@ ENDMODIFYUSERHEAD
'mddl' => "middle",
'lst' => "last",
'gen' => "generation",
+ 'disk' => "disk space allocated to portfolio files",
'prvs' => "Previous",
'chto' => "Changed To"
);
@@ -1146,17 +1212,21 @@ ENDMODIFYUSERHEAD
$lt{'frst'}
$lt{'mddl'}
$lt{'lst'}
-
$lt{'gen'}
+
$lt{'gen'}
+
$lt{'disk'}
$lt{'prvs'}
$userenv{'firstname'}
$userenv{'middlename'}
$userenv{'lastname'}
-
$userenv{'generation'}
+
$userenv{'generation'}
+
$oldportfolioquota
+
$lt{'chto'}
$env{'form.cfirstname'}
$env{'form.cmiddlename'}
$env{'form.clastname'}
-
$env{'form.cgeneration'}
+
$env{'form.cgeneration'}
+
$env{'form.portfolioquota'} Mb
END
} else { # error occurred
@@ -1165,28 +1235,40 @@ END
$env{'form.ccdomain'}."");
}
} else { # End of if ($env ... ) logic
+ my $putresult;
+ if ($quotachanged) {
+ $putresult = &Apache::lonnet::put
+ ('environment',\%changeHash,
+ $env{'form.ccdomain'},$env{'form.ccuname'});
+ }
# They did not want to change the users name but we can
# still tell them what the name is
my %lt=&Apache::lonlocal::texthash(
'usr' => "User",
'id' => "in domain",
- 'gen' => "Generation"
+ 'gen' => "Generation",
+ 'disk' => "Disk space allocated to user's portfolio files",
);
- $r->print(<<"END");
+ $r->print(<<"END");
');
- foreach (keys (%env)) {
- next if (! $env{$_});
+ foreach my $key (keys (%env)) {
+ next if (! $env{$key});
# Revoke roles
- if ($_=~/^form\.rev/) {
- if ($_=~/^form\.rev\:([^\_]+)\_([^\_\.]+)$/) {
+ if ($key=~/^form\.rev/) {
+ if ($key=~/^form\.rev\:([^\_]+)\_([^\_\.]+)$/) {
# Revoke standard role
$r->print(&mt('Revoking').' '.$2.' in '.$1.': '.
&Apache::lonnet::revokerole($env{'form.ccdomain'},
@@ -1204,7 +1286,7 @@ END
$env{'course.'.$cid.'.home'}).' ');
}
}
- if ($_=~/^form\.rev\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
+ if ($key=~/^form\.rev\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
# Revoke custom role
$r->print(&mt('Revoking custom role:').
' '.$4.' by '.$3.'@'.$2.' in '.$1.': '.
@@ -1212,8 +1294,8 @@ END
$env{'form.ccuname'},$1,$2,$3,$4).
' ');
}
- } elsif ($_=~/^form\.del/) {
- if ($_=~/^form\.del\:([^\_]+)\_([^\_\.]+)$/) {
+ } elsif ($key=~/^form\.del/) {
+ if ($key=~/^form\.del\:([^\_]+)\_([^\_\.]+)$/) {
# Delete standard role
$r->print(&mt('Deleting').' '.$2.' in '.$1.': '.
&Apache::lonnet::assignrole($env{'form.ccdomain'},
@@ -1231,7 +1313,7 @@ END
$env{'course.'.$cid.'.home'}).' ');
}
}
- if ($_=~/^form\.del\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
+ if ($key=~/^form\.del\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4);
# Delete custom role
$r->print(&mt('Deleting custom role [_1] by [_2]@[_3] in [_4]',
@@ -1240,11 +1322,11 @@ END
$env{'form.ccuname'},$url,$rdom,$rnam,$rolename,$now,
0,1).' ');
}
- } elsif ($_=~/^form\.ren/) {
+ } elsif ($key=~/^form\.ren/) {
my $udom = $env{'form.ccdomain'};
my $uname = $env{'form.ccuname'};
# Re-enable standard role
- if ($_=~/^form\.ren\:([^\_]+)\_([^\_\.]+)$/) {
+ if ($key=~/^form\.ren\:([^\_]+)\_([^\_\.]+)$/) {
my $url = $1;
my $role = $2;
my $logmsg;
@@ -1270,7 +1352,7 @@ END
$r->print($output);
}
# Re-enable custom role
- if ($_=~/^form\.ren\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
+ if ($key=~/^form\.ren\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4);
my $result = &Apache::lonnet::assigncustomrole(
$env{'form.ccdomain'}, $env{'form.ccuname'},
@@ -1278,10 +1360,10 @@ END
$r->print(&mt('Re-enabling custom role [_1] by [_2]@[_3] in [_4] : [_5]',
$rolename,$rnam,$rdom,$url,$result).' ');
}
- } elsif ($_=~/^form\.act/) {
+ } elsif ($key=~/^form\.act/) {
my $udom = $env{'form.ccdomain'};
my $uname = $env{'form.ccuname'};
- if ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_cr_cr_([^\_]+)_(\w+)_([^\_]+)$/) {
+ if ($key=~/^form\.act\_([^\_]+)\_([^\_]+)\_cr_cr_([^\_]+)_(\w+)_([^\_]+)$/) {
# Activate a custom role
my ($one,$two,$three,$four,$five)=($1,$2,$3,$4,$5);
my $url='/'.$one.'/'.$two;
@@ -1312,7 +1394,7 @@ END
$r->print(&Apache::loncommon::commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end));
}
}
- } elsif ($_=~/^form\.act\_([^\_]+)\_(\w+)\_([^\_]+)$/) {
+ } elsif ($key=~/^form\.act\_([^\_]+)\_(\w+)\_([^\_]+)$/) {
# Activate roles for sections with 3 id numbers
# set start, end times, and the url for the class
my ($one,$two,$three)=($1,$2,$3);
@@ -1351,7 +1433,7 @@ END
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$three,$start,$end,$one,$two,''));
}
}
- } elsif ($_=~/^form\.act\_([^\_]+)\_([^\_]+)$/) {
+ } elsif ($key=~/^form\.act\_([^\_]+)\_([^\_]+)$/) {
# Activate roles for sections with two id numbers
# set start, end times, and the url for the class
my $start = ( $env{'form.start_'.$1.'_'.$2} ?
@@ -1381,7 +1463,7 @@ END
}
}
} else {
- $r->print('