--- loncom/interface/loncreateuser.pm	2010/10/11 14:36:04	1.352
+++ loncom/interface/loncreateuser.pm	2011/09/01 02:47:51	1.357
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.352 2010/10/11 14:36:04 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.357 2011/09/01 02:47:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -638,7 +638,6 @@ END
 
 sub entry_form {
     my ($dom,$srch,$forcenewuser,$context,$responsemsg,$crstype) = @_;
-    my %domconf = &Apache::lonnet::get_dom('configuration',['usercreation'],$dom);
     my ($usertype,$inexact);
     if (ref($srch) eq 'HASH') {
         if (($srch->{'srchin'} eq 'dom') &&
@@ -646,9 +645,10 @@ sub entry_form {
             ($srch->{'srchtype'} eq 'exact') &&
             ($srch->{'srchdomain'} ne '') &&
             ($srch->{'srchterm'} ne '')) {
+            my (%curr_rules,%got_rules);
             my ($rules,$ruleorder) =
                 &Apache::lonnet::inst_userrules($srch->{'srchdomain'},'username');
-            $usertype = &Apache::lonuserutils::check_usertype($srch->{'srchdomain'},$srch->{'srchterm'},$rules);
+            $usertype = &Apache::lonuserutils::check_usertype($srch->{'srchdomain'},$srch->{'srchterm'},$rules,\%curr_rules,\%got_rules);
         } else {
             $inexact = 1;
         }
@@ -942,7 +942,8 @@ sub print_user_modification_page {
         my ($rules,$ruleorder) =
             &Apache::lonnet::inst_userrules($ccdomain,'username');
             $usertype =
-                &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules);
+                &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules,
+                                                       \%curr_rules,\%got_rules);
         my $cancreate =
             &Apache::lonuserutils::can_create_user($ccdomain,$context,
                                                    $usertype);
@@ -1321,7 +1322,7 @@ ENDNOTOOLSPRIV
             $addrolesdisplay = &new_coauthor_roles($r,$ccuname,$ccdomain);
         }
         if ($context eq 'domain') {
-            my $add_domainroles = &new_domain_roles($r);
+            my $add_domainroles = &new_domain_roles($r,$ccdomain);
             if (!$addrolesdisplay) {
                 $addrolesdisplay = $add_domainroles;
             }
@@ -1764,7 +1765,7 @@ sub new_coauthor_roles {
 }
 
 sub new_domain_roles {
-    my ($r) = @_;
+    my ($r,$ccdomain) = @_;
     my $addrolesdisplay = 0;
     #
     # Domain level
@@ -1782,6 +1783,7 @@ sub new_domain_roles {
     foreach my $thisdomain (sort(&Apache::lonnet::all_domains())) {
         foreach my $role (@allroles) {
             next if ($role eq 'ad');
+            next if (($role eq 'au') && ($ccdomain ne $thisdomain));
             if (&Apache::lonnet::allowed('c'.$role,$thisdomain)) {
                my $plrole=&Apache::lonnet::plaintext($role);
                my %lt=&Apache::lonlocal::texthash(
@@ -4384,12 +4386,12 @@ sub print_main_menu {
                 course => {
                             upload     => 'Upload a File of Course Users',
                             singleuser => 'Add/Modify a Course User',
-                            listusers  => 'Manage Course Users',
+                            listusers  => 'List and Modify Multiple Course Users',
                             },
                 community => {
                             upload     => 'Upload a File of Community Users',
                             singleuser => 'Add/Modify a Community User',
-                            listusers  => 'Manage Community Users',
+                            listusers  => 'List and Modify Multiple Community Users',
                            },
                 );
      my %linktitles = (
@@ -6206,8 +6208,8 @@ sub course_level_dc {
     my $hiddenitems = '<input type="hidden" name="dcdomain" value="'.$dcdom.'" />'.
                       '<input type="hidden" name="origdom" value="'.$dcdom.'" />'.
                       '<input type="hidden" name="dccourse" value="" />';
-    my $courseform='<b>'.&Apache::loncommon::selectcourse_link
-            ('cu','dccourse','dcdomain','coursedesc',undef,undef,'Course/Community','crstype').'</b>';
+    my $courseform=&Apache::loncommon::selectcourse_link
+            ('cu','dccourse','dcdomain','coursedesc',undef,undef,'Select','crstype');
     my $cb_jscript = &Apache::loncommon::coursebrowser_javascript($dcdom,'currsec','cu','role','Course/Community Browser');
     my %lt=&Apache::lonlocal::texthash(
                     'rol'  => "Role",
@@ -6217,15 +6219,17 @@ sub course_level_dc {
                     'sta'  => "Start",
                     'end'  => "End",
                     'ssd'  => "Set Start Date",
-                    'sed'  => "Set End Date"
+                    'sed'  => "Set End Date",
+                    'scc'  => "Course/Community"
                   );
     my $header = '<h4>'.&mt('Course/Community Level').'</h4>'.
                  &Apache::loncommon::start_data_table().
                  &Apache::loncommon::start_data_table_header_row().
-                 '<th>'.$courseform.'</th><th>'.$lt{'rol'}.'</th><th>'.$lt{'grs'}.'</th><th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'.
+                 '<th>'.$lt{'scc'}.'</th><th>'.$lt{'rol'}.'</th><th>'.$lt{'grs'}.'</th><th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'.
                  &Apache::loncommon::end_data_table_header_row();
     my $otheritems = &Apache::loncommon::start_data_table_row()."\n".
-                     '<td><br /><input type="text" name="coursedesc" value="" onfocus="this.blur();opencrsbrowser('."'cu','dccourse','dcdomain','coursedesc','','','','crstype'".')" /></td>'."\n".
+                     '<td><br /><span class="LC_nobreak"><input type="text" name="coursedesc" value="" onfocus="this.blur();opencrsbrowser('."'cu','dccourse','dcdomain','coursedesc','','','','crstype'".')" />'.
+                     $courseform.('&nbsp;' x4).'</span></td>'."\n".
                      '<td valign><br /><select name="role">'."\n";
     foreach my $role (@roles) {
         my $plrole=&Apache::lonnet::plaintext($role);