--- loncom/interface/loncreateuser.pm 2014/06/30 14:49:35 1.403 +++ loncom/interface/loncreateuser.pm 2016/01/31 21:25:38 1.407 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.403 2014/06/30 14:49:35 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.407 2016/01/31 21:25:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3110,7 +3110,7 @@ sub update_user_data { \%newsettingstext); if ($env{'form.cid'} ne $userenv{'id'}) { &Apache::lonnet::idput($env{'form.ccdomain'}, - ($env{'form.ccuname'} => $env{'form.cid'})); + {$env{'form.ccuname'} => $env{'form.cid'}},$uhome,'ids'); if (($recurseid) && (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) { my $idresult = @@ -3625,7 +3625,7 @@ sub update_roles { my @rolechanges; my %disallowed; $r->print('

'.&mt('Modifying Roles').'

'); - foreach my $key (keys (%env)) { + foreach my $key (keys(%env)) { next if (! $env{$key}); next if ($key eq 'form.action'); # Revoke roles @@ -3807,7 +3807,7 @@ sub update_roles { } else { my %curr_groups = &Apache::longroup::coursegroups($one,$two); - foreach my $sec (sort {$a cmp $b} keys %sections) { + foreach my $sec (sort {$a cmp $b} keys(%sections)) { if (($sec eq 'none') || ($sec eq 'all') || exists($curr_groups{$sec})) { $disallowed{$sec} = $url; @@ -3853,7 +3853,7 @@ sub update_roles { my %curr_groups = &Apache::longroup::coursegroups($one,$two); my $emptysec = 0; - foreach my $sec (sort {$a cmp $b} keys %sections) { + foreach my $sec (sort {$a cmp $b} keys(%sections)) { $sec =~ s/\W//g; if ($sec ne '') { if (($sec eq 'none') || ($sec eq 'all') || @@ -3893,7 +3893,7 @@ sub update_roles { $r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$two,$start,$end,$one,undef,'',$context)); } else { my $emptysec = 0; - foreach my $sec (sort {$a cmp $b} keys %sections) { + foreach my $sec (sort {$a cmp $b} keys(%sections)) { if ($sec ne '') { my $securl = $url.'/'.$sec; $r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$two,$start,$end,$one,undef,$sec,$context)); @@ -5544,6 +5544,7 @@ sub print_selfenroll_menu { butn => 'but no user types have been checked.', wilf => "Please uncheck 'activate' or check at least one type.", ); + &js_escape(\%alerts); my $selfenroll_js = <<"ENDSCRIPT"; function update_types(caller,num) { var delidx = getIndexByName('selfenroll_delete'); @@ -5745,6 +5746,12 @@ ENDSCRIPT $cathash = $domconfig{'coursecategories'}{'cats'}; $cattype{'auth'} = $domconfig{'coursecategories'}{'auth'}; $cattype{'unauth'} = $domconfig{'coursecategories'}{'unauth'}; + if ($cattype{'auth'} eq '') { + $cattype{'auth'} = 'std'; + } + if ($cattype{'unauth'} eq '') { + $cattype{'unauth'} = 'std'; + } } else { $cathash = {}; $cattype{'auth'} = 'std'; @@ -7451,8 +7458,8 @@ sub course_level_dc { my $plrole=&Apache::lonnet::plaintext($role); $otheritems .= ' '; } - if ( keys %customroles > 0) { - foreach my $cust (sort keys %customroles) { + if ( keys(%customroles) > 0) { + foreach my $cust (sort(keys(%customroles))) { my $custrole='cr_cr_'.$env{'user.domain'}. '_'.$env{'user.name'}.'_'.$cust; $otheritems .= ' ';