--- loncom/interface/lonuserutils.pm	2013/05/03 16:29:34	1.152
+++ loncom/interface/lonuserutils.pm	2013/12/09 18:47:18	1.158
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Utility functions for managing LON-CAPA user accounts
 #
-# $Id: lonuserutils.pm,v 1.152 2013/05/03 16:29:34 bisitz Exp $
+# $Id: lonuserutils.pm,v 1.158 2013/12/09 18:47:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -642,7 +642,7 @@ sub upload_manager_javascript_forward_as
             $numbuttons ++;
         }
         if (!$can_assign->{'int'}) {
-            my $warning = &mt('You may not specify an initial password for each user, as this is only available when new users use LON-CAPA internal authentication.').'\n'
+            my $warning = &mt('You may not specify an initial password for each user, as this is only available when new users use LON-CAPA internal authentication.').'\n'.
                           &mt('Your current role does not have rights to create users with that authentication type.');
             $auth_update = <<"END";
    // Currently the initial password field is only supported for internal auth
@@ -1988,7 +1988,7 @@ sub get_cols_array {
         }
         if (($context eq 'course') && ($mode ne 'autoenroll') &&
             ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'})) {
-            push(@cols,'photos');
+            push(@cols,'photo');
         }
         if ($context eq 'domain') {
             push (@cols,'extent');
@@ -2119,7 +2119,7 @@ sub get_column_names {
     if ($context eq 'domain' && $env{'form.roletype'} eq 'course') {
         $lt{'extent'} = &mt('course(s): description, section(s), status');
     } elsif ($context eq 'domain' && $env{'form.roletype'} eq 'community') {
-        $lt{'extent'} = &mt('communities: description, section(s), status');
+        $lt{'extent'} = &mt('community(s): description, section(s), status');
     } elsif (($context eq 'author') || 
              ($context eq 'domain' && $env{'form.roletype'} eq 'author')) {
         $lt{'extent'} = &mt('author');
@@ -2468,7 +2468,9 @@ sub show_users_list {
     if ($mode eq 'pickauthor') {
         @sortable = ('username','fullname','email','status');
     }
-    if (!grep(/^\Q$sortby\E$/,@sortable)) {
+    my %is_sortable;
+    map { $is_sortable{$_} = 1; } @sortable;
+    unless ($is_sortable{$sortby}) {
         $sortby = 'username';
     }
     my $setting = $env{'form.roletype'};
@@ -2712,7 +2714,13 @@ END
             }
         }
         foreach my $item (@cols) {
-            $output .= "<th><a href=\"javascript:document.$formname.sortby.value='$item';document.$formname.submit();\">$lt{$item}</a></th>\n";
+            $output .= "<th>";
+            if ($is_sortable{$item}) {
+                $output .= "<a href=\"javascript:document.$formname.sortby.value='$item';document.$formname.submit();\">$lt{$item}</a>";
+            } else {
+                $output .= $lt{$item};
+            }
+            $output .= "</th>\n";
         }
         my %role_types = &role_type_names();
         $output .= &Apache::loncommon::end_data_table_header_row();
@@ -4263,18 +4271,23 @@ sub upfile_drop_add {
                     if ($entries{$fields{'username'}} =~ /\s/) {
                         $nowhitespace = ' - '.&mt('usernames may not contain spaces.');
                     }
-                    $r->print('<br />'.
-      &mt('[_1]: Unacceptable username for user [_2] [_3] [_4] [_5]',
-          '<b>'.$entries{$fields{'username'}}.'</b>',$fname,$mname,$lname,$gen).
-                              $nowhitespace);
+                    $r->print(
+                        '<br />'.
+                        &mt('Unacceptable username [_1] for user [_2] [_3] [_4] [_5]',
+                                '"<b>'.$entries{$fields{'username'}}.'</b>"',
+                                $fname,$mname,$lname,$gen).
+                        $nowhitespace);
                     next;
                 } else {
                     $entries{$fields{'domain'}} =~ s/^\s+|\s+$//g;
                     if ($entries{$fields{'domain'}} 
                         ne &LONCAPA::clean_domain($entries{$fields{'domain'}})) {
-                        $r->print('<br />'. '<b>'.$entries{$fields{'domain'}}.
-                                  '</b>: '.&mt('Unacceptable domain for user [_1] [_2] [_3] [_4]',$fname,$mname,$lname,$gen));
-                        next;
+                        $r->print(
+                            '<br />'.
+                            &mt('Unacceptable domain [_1] for user [_2] [_3] [_4] [_5]',
+                                   '"<b>'.$entries{$fields{'domain'}}.'</b>"',
+                                    $fname,$mname,$lname,$gen));
+                    next;
                     }
                     my $username = $entries{$fields{'username'}};
                     my $userdomain = $entries{$fields{'domain'}};
@@ -4618,7 +4631,7 @@ sub upfile_drop_add {
             #  Get current classlist
             my $classlist = &Apache::loncoursedata::get_classlist();
             if (! defined($classlist)) {
-                $r->print('<form name="studentform" method="post" action="/adm/createuser" />'.
+                $r->print('<form name="studentform" method="post" action="/adm/createuser">'.
                           '<input type="hidden" name="action" value="'.$env{'form.action'}.'" />'.
                           '<p class="LC_info">'.&mt('There are no students with current/future access to the course.').'</p>'.
                           '</form>'."\n");
@@ -4741,7 +4754,7 @@ sub print_drop_menu {
         $heading = &mt("Drop Students");
     }
     $r->print('<h3>'.$heading.'</h3>'."\n".
-              '<form name="studentform" method="post">'."\n");
+              '<form name="studentform" method="post" action="">'."\n");
     my $classlist = &Apache::loncoursedata::get_classlist();
     if (! defined($classlist)) {
         my $msg = '';