--- loncom/interface/loncreateuser.pm 2008/12/08 22:46:28 1.267
+++ loncom/interface/loncreateuser.pm 2008/12/28 22:12:10 1.272
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.267 2008/12/08 22:46:28 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.272 2008/12/28 22:12:10 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -213,7 +213,6 @@ END_SCRIPT
$tool_on = '';
}
}
- $curr_access = &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item);
$output .= '
'."\n".
' '.$lt{$item}.' | '."\n".
'
'."\n".
@@ -2071,7 +2070,6 @@ sub update_user_data {
}
} else {
$changed{$tool} = &tool_admin($tool,'',\%changeHash);
- print STDERR "for $tool - changed is $changed{$tool}\n";
if ($changed{$tool}) {
$newaccess{$tool} = &mt('default');
} else {
@@ -2125,18 +2123,20 @@ sub update_user_data {
&Apache::lonnet::put('environment',\%changeHash,
$env{'form.ccdomain'},$env{'form.ccuname'});
if ($chgresult eq 'ok') {
- my %newenvhash;
- my $hashid="$env{'form.ccuname'}:$env{'form.ccdomain'}";
- foreach my $key (keys(%changed)) {
- if ($key ne 'quota') {
- &Apache::lonnet::devalidate_cache_new('usertools.'.$key,$hashid);
- $newenvhash{'environment.tools.'.$key} =
- $changeHash{'tools.'.$key};
- }
- }
if (($env{'user.name'} eq $env{'form.ccuname'}) &&
($env{'user.domain'} eq $env{'form.ccdomain'})) {
- &Apache::lonnet::appenv(\%newenvhash);
+ my %newenvhash;
+ foreach my $key (keys(%changed)) {
+ if ($key ne 'quota') {
+ $newenvhash{'environment.tools.'.$key} =
+ $changeHash{'tools.'.$key};
+ $newenvhash{'environment.availabletools.'.$key} =
+ $changeHash{'tools.'.$key};
+ }
+ }
+ if (keys(%newenvhash)) {
+ &Apache::lonnet::appenv(\%newenvhash);
+ }
}
}
}
@@ -2480,7 +2480,7 @@ sub update_roles {
my $result = &Apache::lonnet::assigncustomrole(
$env{'form.ccdomain'}, $env{'form.ccuname'},
$url,$rdom,$rnam,$rolename,0,$now,undef,$context);
- $r->print(&mt('Re-enabling custom role [_1] by [_2]@[_3] in [_4] : [_5]',
+ $r->print(&mt('Re-enabling custom role [_1] by [_2]:[_3] in [_4] : [_5]',
$rolename,$rnam,$rdom,$url,''.$result.'').'
');
if (!grep(/^cr$/,@rolechanges)) {
push(@rolechanges,'cr');
@@ -2928,34 +2928,35 @@ sub make_script_template {
my ($priv_item, $dummy) = split(/\&/,$priv);
$role_c{$priv_item} = 1;
}
+ my %role_d;
+ @temp = split(/:/,$Apache::lonnet::pr{$role.':d'});
+ foreach my $priv(@temp) {
+ my ($priv_item, $dummy) = split(/\&/,$priv);
+ $role_d{$priv_item} = 1;
+ }
+ my %role_s;
+ @temp = split(/:/,$Apache::lonnet::pr{$role.':s'});
+ foreach my $priv(@temp) {
+ my ($priv_item, $dummy) = split(/\&/,$priv);
+ $role_s{$priv_item} = 1;
+ }
foreach my $priv_item (keys(%full_c)) {
my ($priv, $dummy) = split(/\&/,$priv_item);
- if (exists($role_c{$priv})) {
+ if ((exists($role_c{$priv})) || (exists($role_d{$priv})) ||
+ (exists($role_s{$priv}))) {
$return_script .= "document.form1.$priv"."_c.checked = true;\n";
} else {
$return_script .= "document.form1.$priv"."_c.checked = false;\n";
}
}
- my %role_d;
- @temp = split(/:/,$Apache::lonnet::pr{$role.':d'});
- foreach my $priv(@temp) {
- my ($priv_item, $dummy) = split(/\&/,$priv);
- $role_d{$priv_item} = 1;
- }
foreach my $priv_item (keys(%full_d)) {
my ($priv, $dummy) = split(/\&/,$priv_item);
- if (exists($role_d{$priv})) {
+ if ((exists($role_d{$priv})) || (exists($role_s{$priv}))) {
$return_script .= "document.form1.$priv"."_d.checked = true;\n";
} else {
$return_script .= "document.form1.$priv"."_d.checked = false;\n";
}
}
- my %role_s;
- @temp = split(/:/,$Apache::lonnet::pr{$role.':s'});
- foreach my $priv(@temp) {
- my ($priv_item, $dummy) = split(/\&/,$priv);
- $role_s{$priv_item} = 1;
- }
foreach my $priv_item (keys(%full_s)) {
my ($priv, $dummy) = split(/\&/,$priv_item);
if (exists($role_s{$priv})) {