--- loncom/xml/lonxml.pm	2001/08/17 19:50:28	1.117
+++ loncom/xml/lonxml.pm	2001/08/18 15:49:28	1.118
@@ -13,7 +13,7 @@
 # 6/12,6/13 H. K. Ng
 # 6/16 Gerd Kortemeyer
 # 7/27 H. K. Ng
-# 8/7,8/9,8/10,8/11,8/15,8/16,8/17 Gerd Kortemeyer
+# 8/7,8/9,8/10,8/11,8/15,8/16,8/17,8/18 Gerd Kortemeyer
 
 package Apache::lonxml; 
 use vars 
@@ -153,7 +153,7 @@ sub xmlend {
 }
 
 sub maketoken {
-    my ($target,$symb,$tuname,$tudom,$tcrsid)=@_;
+    my ($symb,$tuname,$tudom,$tcrsid)=@_;
     unless ($symb) {
 	$symb=&Apache::lonnet::symbread();
     }
@@ -163,10 +163,22 @@ sub maketoken {
         $tcrsid=$ENV{'request.course.id'};
     }
 
-    my $token=&Apache::lonnet::checkout($symb,$tuname,$tudom,$tcrsid);
- 
+    return &Apache::lonnet::checkout($symb,$tuname,$tudom,$tcrsid);
+}
+
+sub printtokenheader {
+    my ($target,$token,$symb,$tuname,$tudom,$tcrsid)=@_;
     unless ($token) { return ''; }
 
+    unless ($symb) {
+	$symb=&Apache::lonnet::symbread();
+    }
+    unless ($tuname) {
+	$tuname=$ENV{'user.name'};
+        $tudom=$ENV{'user.domain'};
+        $tcrsid=$ENV{'request.course.id'};
+    }
+
     my %reply=&Apache::lonnet::get('environment',
               ['firstname','middlename','lastname','generation'],
               $tudom,$tuname);