--- loncom/interface/loncreateuser.pm 2010/03/21 21:05:42 1.337 +++ loncom/interface/loncreateuser.pm 2010/04/14 13:58:11 1.340 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.337 2010/03/21 21:05:42 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.340 2010/04/14 13:58:11 wenzelju Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2574,7 +2574,8 @@ sub update_user_data { } my ($quotachanged,$oldportfolioquota,$newportfolioquota,$oldinststatus, $newinststatus,$oldisdefault,$newisdefault,%oldsettings, - %oldsettingstext,%newsettings,%newsettingstext,@disporder); + %oldsettingstext,%newsettings,%newsettingstext,@disporder, + $olddefquota,$oldsettingstatus,$newdefquota,$newsettingstatus); @disporder = ('inststatus'); if ($env{'request.role.domain'} eq $env{'form.ccdomain'}) { push(@disporder,'requestcourses'); @@ -2582,8 +2583,10 @@ sub update_user_data { push(@disporder,'reqcrsotherdom'); } push(@disporder,('quota','tools')); - my ($defquota,my $settingstatus) = + $oldinststatus = $userenv{'inststatus'}; + ($olddefquota,$oldsettingstatus) = &Apache::loncommon::default_quota($env{'form.ccdomain'},$oldinststatus); + ($newdefquota,$newsettingstatus) = ($olddefquota,$oldsettingstatus); my %canshow; if (&Apache::lonnet::allowed('mpq',$env{'form.ccdomain'})) { $canshow{'quota'} = 1; @@ -2600,7 +2603,6 @@ sub update_user_data { $canshow{'inststatus'} = 1; } my (%changeHash,%changed); - $oldinststatus = $userenv{'inststatus'}; if ($oldinststatus eq '') { $oldsettings{'inststatus'} = $othertitle; } else { @@ -2620,6 +2622,8 @@ sub update_user_data { $changeHash{'inststatus'} = $newinststatus; if ($newinststatus ne $oldinststatus) { $changed{'inststatus'} = $newinststatus; + ($newdefquota,$newsettingstatus) = + &Apache::loncommon::default_quota($env{'form.ccdomain'},$newinststatus); } if (ref($usertypes) eq 'HASH') { $newsettings{'inststatus'} = join(', ',map{ $usertypes->{$_}; } (@inststatuses)); @@ -2633,6 +2637,8 @@ sub update_user_data { $newsettings{'inststatus'} = $othertitle; if ($newinststatus ne $oldinststatus) { $changed{'inststatus'} = $changeHash{'inststatus'}; + ($newdefquota,$newsettingstatus) = + &Apache::loncommon::default_quota($env{'form.ccdomain'},$newinststatus); } } } elsif ($context ne 'selfcreate') { @@ -2655,12 +2661,12 @@ sub update_user_data { } } else { $changed{'quota'} = "a_admin('',\%changeHash); - $newportfolioquota = $defquota; + $newportfolioquota = $newdefquota; $newisdefault = 1; } } else { $oldisdefault = 1; - $oldportfolioquota = $defquota; + $oldportfolioquota = $olddefquota; if ($env{'form.customquota'} == 1) { if ($env{'form.portfolioquota'} eq '') { $newportfolioquota = 0; @@ -2670,15 +2676,15 @@ sub update_user_data { } $changed{'quota'} = "a_admin($newportfolioquota,\%changeHash); } else { - $newportfolioquota = $defquota; + $newportfolioquota = $newdefquota; $newisdefault = 1; } } if ($oldisdefault) { - $oldsettingstext{'quota'} = &get_defaultquota_text($settingstatus); + $oldsettingstext{'quota'} = &get_defaultquota_text($oldsettingstatus); } if ($newisdefault) { - $newsettingstext{'quota'} = &get_defaultquota_text($settingstatus); + $newsettingstext{'quota'} = &get_defaultquota_text($newsettingstatus); } &tool_changes('tools',\@usertools,\%oldsettings,\%oldsettingstext,\%userenv, \%changeHash,\%changed,\%newsettings,\%newsettingstext); @@ -4380,7 +4386,7 @@ sub print_main_menu { [ { linktext => $links{$linkcontext}{'upload'}, - icon => 'sctr.png', + icon => 'uplusr.png', #help => 'Course_Create_Class_List', url => '/adm/createuser?action=upload', permission => $permission->{'cusr'}, @@ -4388,7 +4394,7 @@ sub print_main_menu { }, { linktext => $links{$linkcontext}{'listusers'}, - icon => 'edit-find.png', + icon => 'mngcu.png', #help => 'Course_View_Class_List', url => '/adm/createuser?action=listusers', permission => ($permission->{'view'} || $permission->{'cusr'}), @@ -6269,7 +6275,8 @@ sub update_selfenroll_config { $newnum ++; } } - for (my $j=0; $j<$env{'form.selfenroll_types_total'}; $j++) { if ((!grep(/^$j$/,@deletedoms)) && (!grep(/^$j$/,@activations))) { + for (my $j=0; $j<$env{'form.selfenroll_types_total'}; $j++) { + if ((!grep(/^$j$/,@deletedoms)) && (!grep(/^$j$/,@activations))) { my @types = &Apache::loncommon::get_env_multiple('form.selfenroll_types_'.$j); if (@types > 0) { @types = sort(@types);