--- loncom/interface/lonuserutils.pm 2008/10/15 14:12:41 1.73 +++ loncom/interface/lonuserutils.pm 2008/12/06 12:49:18 1.74 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.73 2008/10/15 14:12:41 bisitz Exp $ +# $Id: lonuserutils.pm,v 1.74 2008/12/06 12:49:18 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3636,8 +3636,8 @@ sub upfile_drop_add { if ($entries{$fields{'username'}} ne &LONCAPA::clean_username($entries{$fields{'username'}})) { $r->print('
'. - &mt('[_1]: Unacceptable username for user [_2] [_3] [_4] [_5]', - $entries{$fields{'username'}},$fname,$mname,$lname,$gen). + &mt('[_1]: Unacceptable username for user [_2] [_3] [_4] [_5]', + ''.$entries{$fields{'username'}}.'',$fname,$mname,$lname,$gen). ''); next; } else { @@ -3657,10 +3657,10 @@ sub upfile_drop_add { $entries{$fields{'sec'}} =~ s/\W//g; my $item = $entries{$fields{'sec'}}; if ($item eq "none" || $item eq 'all') { - $r->print('
'.&mt('[_1]: Unable to enroll user [_2] [_3] [_4] [_5] in a section named "[_6]" - this is a reserved word.',$username,$fname,$mname,$lname,$gen,$item)); + $r->print('
'.&mt('[_1]: Unable to enroll user [_2] [_3] [_4] [_5] in a section named "[_6]" - this is a reserved word.',''.$username.'',$fname,$mname,$lname,$gen,$item)); next; } elsif (exists($curr_groups{$item})) { - $r->print('
'.&mt('[_1]: Unable to enroll user [_2] [_3] [_4] [_5] in a section named "[_6]" - this is a course group.',$username,$fname,$mname,$lname,$gen,$item).' '.&mt('Section names and group names must be distinct.')); + $r->print('
'.&mt('[_1]: Unable to enroll user [_2] [_3] [_4] [_5] in a section named "[_6]" - this is a course group.',''.$username.'',$fname,$mname,$lname,$gen,$item).' '.&mt('Section names and group names must be distinct.')); next; } else { push(@secs,$item); @@ -3672,7 +3672,7 @@ sub upfile_drop_add { if (ref($userlist{$username.':'.$userdomain}) eq 'ARRAY') { my $currsec = $userlist{$username.':'.$userdomain}[$secidx]; if ($currsec ne $env{'request.course.sec'}) { - $r->print('
'.&mt('[_1]: Unable to enroll user [_2] [_3] [_4] [_5] in a section named "[_6]".',$username,$fname,$mname,$lname,$gen,$secs[0]).'
'); + $r->print('
'.&mt('[_1]: Unable to enroll user [_2] [_3] [_4] [_5] in a section named "[_6]".',''.$username.'',$fname,$mname,$lname,$gen,$secs[0]).'
'); if ($currsec eq '') { $r->print(&mt('This user already has an active/future student role in the course, unaffiliated to any section.')); @@ -3722,8 +3722,13 @@ sub upfile_drop_add { } if ($role eq '') { my $rolestr = join(', ',@permitted_roles); - $r->print('
'. - &mt('[_1]: You do not have permission to add the requested role [_2] for the user.',$entries{$fields{'username'}},$entries{$fields{'role'}}).'
'.&mt('Allowable role(s) is/are: [_1].',$rolestr)."\n"); + $r->print('
' + .&mt('[_1]: You do not have permission to add the requested role [_2] for the user.' + ,''.$entries{$fields{'username'}}.'' + ,$entries{$fields{'role'}}) + .'
' + .&mt('Allowable role(s) is/are: [_1].',$rolestr)."\n" + ); next; } } @@ -3883,15 +3888,15 @@ sub upfile_drop_add { } else { if ($context eq 'course') { $r->print('
'. - &mt('[_1]: Unable to enroll. No password specified.',$username) + &mt('[_1]: Unable to enroll. No password specified.',''.$username.'') ); } elsif ($context eq 'author') { $r->print('
'. - &mt('[_1]: Unable to add co-author. No password specified.',$username) + &mt('[_1]: Unable to add co-author. No password specified.',''.$username.'') ); } else { $r->print('
'. - &mt('[_1]: Unable to add user. No password specified.',$username) + &mt('[_1]: Unable to add user. No password specified.',''.$username.'') ); } } @@ -3994,7 +3999,7 @@ sub user_change_result { if ($userresult =~ /^error:(.+)$/) { my $error = $1; $r->print('
'. - &mt('[_1]: Unable to add/modify: [_2]',$username.':'.$userdomain,$error)); + &mt('[_1]: Unable to add/modify: [_2]',''.$username.':'.$userdomain.'',$error)); } } else { $counts->{'user'} ++; @@ -4004,7 +4009,7 @@ sub user_change_result { if ($authresult =~ /^error:(.+)$/) { my $error = $1; $r->print('
'. - &mt('[_1]: Unable to modify authentication: [_2]',$username.':'.$userdomain,$error)); + &mt('[_1]: Unable to modify authentication: [_2]',''.$username.':'.$userdomain.'',$error)); } } else { $counts->{'auth'} ++; @@ -4014,7 +4019,7 @@ sub user_change_result { if ($roleresult =~ /^error:(.+)$/) { my $error = $1; $r->print('
'. - &mt('[_1]: Unable to add role: [_2]',$username.':'.$userdomain,$error)); + &mt('[_1]: Unable to add role: [_2]',''.$username.':'.$userdomain.'',$error)); } } else { $counts->{'role'} ++; @@ -4284,7 +4289,7 @@ sub update_user_list { $r->print('

'.&mt("$result_text{'ok'}{$choice} role(s) for [quant,_1,user,users,no users].",$count).'

'); if ($count > 0) { if ($choice eq 'revoke' || $choice eq 'drop') { - $r->print('

'.&mt('Re-enabling will re-activate data for the role.

')); + $r->print('

'.&mt('Re-enabling will re-activate data for the role.').'

'); } # Flush the course logs so reverse user roles immediately updated &Apache::lonnet::flushcourselogs();