--- loncom/interface/loncreateuser.pm	2001/03/17 15:42:24	1.8
+++ loncom/interface/loncreateuser.pm	2001/04/24 15:01:25	1.14
@@ -16,7 +16,7 @@
 #
 # 2/14 Gerd Kortemeyer)
 #
-# 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2,3/17 Gerd Kortemeyer
+# 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2,3/17,3/24,04/12 Gerd Kortemeyer
 #
 package Apache::loncreateuser;
 
@@ -108,7 +108,9 @@ ENDENHEAD
     my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain);
     my %incdomains; 
     my %inccourses;
-    $incdomains{$ENV{'user.domain'}}=1;
+    map {
+       $incdomains{$_}=1;
+    } %Apache::lonnet::hostdom;
     map {
 	if ($_=~/^user\.priv\.cm\.\/(\w+)\/(\w+)/) {
 	    $inccourses{$1.'_'.$2}=1;
@@ -194,7 +196,6 @@ ENDNUSER
                  $area=$carea;
 	      } else {
                  if ($area=~/^\/(\w+)\//) {
-		     $incdomains{$1}=1;
                      if (&Apache::lonnet::allowed('c'.$trole,$1)) {
 			 $allows=1;
                      }
@@ -228,7 +229,7 @@ ENDNUSER
 	   $r->print('</table>');
          }   
     }
-    $r->print('<hr><h3>Add Roles</h3><h4>System Level</h4>');
+    $r->print('<hr><h3>Add Roles</h3>');
 #
 # Domain level
 #
@@ -254,7 +255,7 @@ ENDNUSER
 </tr>
 ENDDROW
             }
-        } ('dc','cc','li','dg','au');
+        } ('dc','li','dg','au');
     } sort keys %incdomains;
     $r->print('</table>');
 #
@@ -265,6 +266,7 @@ ENDDROW
     '<th>Group/Section</th><th>Start</th><th>End</th></tr>');
     map {
 	my $thiscourse=$_;
+        $thiscourse=~s:/:_:g;
         my %coursedata=&Apache::lonnet::coursedescription($thiscourse);
         my $area=$coursedata{'description'};
         my $bgcol=$thiscourse;
@@ -289,7 +291,7 @@ ENDDROW
 ENDROW
 
             }
-        } ('st','ta','ep','ad','in');
+        } ('st','ta','ep','ad','in','cc');
     } sort keys %inccourses;
     $r->print('</table>');
     $r->print('<input type=submit value="Modify User">');
@@ -346,6 +348,17 @@ ENDTHREEHEAD
            $r->print('Revoking '.$2.' in '.$1.': '.
           &Apache::lonnet::assignrole($ENV{'form.cdomain'},$ENV{'form.cuname'},
                                       $1,$2,$now).'<br>');
+           if ($2 eq 'st') {
+               $1=~/^\/(\w+)\/(\w+)/;
+               my $cid=$1.'_'.$2;
+	       $r->print('Drop from classlist: '.
+          &Apache::lonnet::critical('put:'.$ENV{'course.'.$cid.'.domain'}.':'.
+	              $ENV{'course.'.$cid.'.num'}.':classlist:'.
+                      &Apache::lonnet::escape($ENV{'form.cuname'}.':'.
+                                              $ENV{'form.cdomain'}).'='.
+                      &Apache::lonnet::escape($now.':'),
+	              $ENV{'course.'.$cid.'.home'}).'<br>');
+           }
 	}
     } keys %ENV;
     map {
@@ -365,6 +378,17 @@ ENDTHREEHEAD
             $r->print('Assigning: '.$3.' in '.$url.': '.
           &Apache::lonnet::assignrole($ENV{'form.cdomain'},$ENV{'form.cuname'},
                                       $url,$3,$end,$start).'<br>');
+            if ($3 eq 'st') {
+		$url=~/^\/(\w+)\/(\w+)/;
+                my $cid=$1.'_'.$2;
+               $r->print('Add to classlist: '.
+          &Apache::lonnet::critical('put:'.$ENV{'course.'.$cid.'.domain'}.':'.
+	              $ENV{'course.'.$cid.'.num'}.':classlist:'.
+                      &Apache::lonnet::escape($ENV{'form.cuname'}.':'.
+                                              $ENV{'form.cdomain'}).'='.
+                      &Apache::lonnet::escape($end.':'.$start),
+	              $ENV{'course.'.$cid.'.home'}).'<br>');
+	    }
 	} elsif (($_=~/^form\.act\_([^\_]+)\_([^\_]+)$/) && ($ENV{$_})) {
             my $url='/'.$1.'/';
             my $start=$now;
@@ -410,7 +434,7 @@ sub handler {
        }
    } else {
       $ENV{'user.error.msg'}=
-        "/adm/createcourse:mau:0:0:Cannot modify user data";
+        "/adm/createuser:mau:0:0:Cannot modify user data";
       return HTTP_NOT_ACCEPTABLE; 
    }
    return OK;