Parent Directory
|
Revision Log
nothing should change
1 #!/usr/local/bin/perl 2 3 ## $Id$ 4 5 # ################################################################## 6 # Copyright @ 1995-1998 University of Rochester 7 # All Rights Reserved 8 # ################################################################## 9 10 use lib '.'; use webworkInit; # WeBWorKInitLine 11 12 ## removeProfPermissions.pl takes as arguments the coursename and instructors login_name 13 ## e.g. removeProfPermissions.pl demoCourse jsmith 14 15 ## NOTE: this should only be run by the professor 16 17 use Global; 18 use Auth; 19 use strict; 20 21 22 if(@ARGV != 2) { 23 print "\nSyntax is removeProfPermissions.pl coursename instructorLoginName\n"; 24 print " (e.g. removeProfPermissions.pl demoCourse jsmith)\n\n"; 25 exit(0); 26 } 27 28 my $course = $ARGV[0]; 29 my $user = $ARGV[1]; 30 31 32 &Global::getCourseEnvironment($course); 33 34 my $permissionsFile = &Global::getCoursePermissionsFile($course); 35 my $scriptDirectory = &Global::getWebworkScriptDirectory($course); 36 37 require "${scriptDirectory}$Global::FILE_pl"; 38 39 if ( defined( &get_permissions($user,$permissionsFile) ) ) { 40 if ( &put_permissions(0,$user,$permissionsFile) ) { 41 print "Instructor permissions removed for $user\n\n"; 42 } 43 else { 44 print "removeProfPermissions.pl: Unable to remove permissions for $user\n\n"; 45 } 46 } 47 else { 48 print "User $user is not listed in the permissions file\n"; 49 print "Cannot remove instructor permissions for $user\n\n"; 50 } 51 52 print "Printout of permissions file\n"; 53 my %perm_hash =get_hash_from_db($permissionsFile); 54 my(@permKeys) = sort keys %perm_hash; 55 my $key; 56 foreach $key (@permKeys) { 57 print "login = $key permissions = $perm_hash{$key}\n"; 58 } 59
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |