#!/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;
