[system] / trunk / webwork / system / scripts / export_permission-database.pl Repository:
ViewVC logotype

View of /trunk/webwork/system/scripts/export_permission-database.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11 - (download) (as text) (annotate)
Mon Jun 18 15:21:51 2001 UTC (18 years, 7 months ago) by sam
File size: 982 byte(s)
another setup script test (changed #! lines)

    1 #!/usr/local/bin/webwork-perl
    2 
    3 
    4 use lib '.'; use webworkInit; # WeBWorKInitLine
    5 
    6 use Global;
    7 use Auth;
    8 use strict;
    9 
   10 if (@ARGV != 2)
   11   {
   12    print "\nSyntax is export_permission-database.pl courseID outputTextFile\n";
   13    print "      (e.g. export_permission-database.pl  demoCourse textDatabase)\n\n";
   14    exit(0);
   15   }
   16 
   17 my $course = $ARGV[0];
   18 my $outFileName = $ARGV[1];
   19 
   20 # establish environment for this script
   21 
   22 &Global::getCourseEnvironment($course);
   23 
   24 # File names
   25 
   26 my $perm_file = &Global::getCoursePermissionsFile($course);
   27 
   28 my %perm_hash;
   29 my $perm_obj;
   30 
   31 &Global::tie_hash('PERM_FILE',\$perm_obj,\%perm_hash, $perm_file,'R',$Global::standard_tie_permission);
   32 
   33 my ($key,$item);
   34 my @keys = sort keys %perm_hash;
   35 
   36 open(OUTFILE,">$outFileName") or wwerror("$0","can't open $outFileName for writing");
   37 
   38 foreach $key (@keys) {
   39     print OUTFILE "[$key]\n";
   40     print OUTFILE "\t$perm_hash{$key}\n";
   41 }
   42 
   43 close(OUTFILE);
   44 &Global::untie_hash('PERM_FILE',\$perm_obj,\%perm_hash, $perm_file);

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9