[LON-CAPA-cvs] cvs: loncom /automation Autocreate.pl

raeburn raeburn@source.lon-capa.org
Fri, 13 Aug 2010 16:37:30 -0000


raeburn		Fri Aug 13 16:37:30 2010 EDT

  Modified files:              
    /loncom/automation	Autocreate.pl 
  Log:
  - Set %env and permissions for original calling style (i.e., via args to Autocreate.pl call in /etc/cron.d/loncapa
    (doesn't use domain configuration).  
  
  
Index: loncom/automation/Autocreate.pl
diff -u loncom/automation/Autocreate.pl:1.13 loncom/automation/Autocreate.pl:1.14
--- loncom/automation/Autocreate.pl:1.13	Tue Mar 30 15:24:52 2010
+++ loncom/automation/Autocreate.pl	Fri Aug 13 16:37:30 2010
@@ -2,7 +2,7 @@
 #
 # Automated Course Creation script
 #
-# $Id: Autocreate.pl,v 1.13 2010/03/30 15:24:52 raeburn Exp $
+# $Id: Autocreate.pl,v 1.14 2010/08/13 16:37:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -110,8 +110,15 @@
                 close($fh);
                 exit;
             }
+            $env{'user.name'} = $dcname;
+            $env{'user.domain'} = $dcdom;
+            $env{'request.role.domain'} = $defdom;
+            my @permissions = ('mau','ccc','cin','cta','cep','ccr','cst');
+            my %permissionflags = ();
+            &set_permissions(\%permissionflags,\@permissions);
             my $output = &process_xml($fh,$defdom,$dcname,$dcdom);
             print $output;
+            &unset_permissions(\%permissionflags);
         }
     } else {
         my @permissions = ('mau','ccc','cin','cta','cep','ccr','cst');