--- loncom/debugging_tools/make_user_ca.pl 2004/09/12 21:27:05 1.1 +++ loncom/debugging_tools/make_user_ca.pl 2006/06/19 09:36:22 1.2 @@ -2,7 +2,8 @@ # use strict; use GDBM_File; -my %roles; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; my $user = shift; my $userdom = shift; @@ -28,16 +29,11 @@ my $dbfile = "/home/httpd/lonUsers/$user print "dbfile = $dbfile\n"; -tie (%roles,'GDBM_File',$dbfile, - &GDBM_WRCREAT(),0640); -$roles{'/'.$targetdom.'/'.$target.'_ca'}='ca_'.$endtime.'_'.time; -open OUT, ">/home/httpd/lonUsers/$userdom/$a/$b/$c/$user/roles.hist"; -foreach (keys(%roles)) { - print OUT $_.' : '.$roles{$_}."\n"; -} -close OUT; +my $rolesref=&LONCAPA::locking_hash_tie($dbfile,&GDBM_WRCREAT()); + +$$rolesref{'/'.$targetdom.'/'.$target.'_ca'}='ca_'.$endtime.'_'.time; -untie %roles; +&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`;