#!/usr/bin/perl

# quick temporary script
# brought up-to-date by Scott Harrison, 03/01/2001


print "Usage: rolesmanip.pl DOMAIN USERNAME\n" unless @ARGV;

my $domain=shift @ARGV;
my $name=shift @ARGV;

my ($l1,$l2,$l3)=split(//,substr($name,0,3));

use GDBM_File;
my %hash;
        tie(%hash,'GDBM_File',
"/home/httpd/lonUsers/$domain/$l1/$l2/$l3/$name/roles.db",
	    &GDBM_WRCREAT,0640);

$hash{'/'.$domain.'/_dc'}='dc';
open OUT, ">/home/httpd/lonUsers/$domain/$l1/$l2/$l3/$name/roles.hist";
map {
    print OUT $_.' : '.$hash{$_}."\n";
} keys %hash;
close OUT;

untie %hash;
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>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.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>
