#!/usr/bin/perl -w # use strict; use GDBM_File; use lib '/home/httpd/lib/perl/'; use LONCAPA; my $user = shift; my $userdom = shift; my $target = shift; # The account to make $user a co-author on my $targetdom = shift; my $days = shift; # The number of days to have the role last if (! defined($user)) { die "usage: make_user_ca.pl user userdom course coursedom daysuntilexpire"; } my $endtime = time + 24*60*60*$days; print "user = $user\n"; print "userdom = $userdom\n"; print "target = $target\n"; print "targetdom = $targetdom\n"; print "days = $days\n"; print "endtime = $endtime\n"; my ($a,$b,$c,undef) = split(//,$user,4); my $dbfile = "/home/httpd/lonUsers/$userdom/$a/$b/$c/$user/roles.db"; print "dbfile = $dbfile\n"; my $rolesref=&LONCAPA::locking_hash_tie($dbfile,&GDBM_WRCREAT()); $$rolesref{'/'.$targetdom.'/'.$target.'_ca'}='ca_'.$endtime.'_'.time; &LONCAPA::locking_hash_untie($rolesref); `chown www:www /home/httpd/lonUsers/$userdom/$a/$b/$c/$user/roles.hist`; `chown www:www /home/httpd/lonUsers/$userdom/$a/$b/$c/$user/roles.db`; 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.