Commit 73303982 authored by Leigh Stoller's avatar Leigh Stoller

Add a little utility function for remapping WikiNames to new uids.

No big deal ...
parent 670800ea
......@@ -103,6 +103,9 @@ elsif ($action eq "setgroups") {
elsif ($action eq "xlogin") {
exit(WikixLogin(@ARGV));
}
elsif ($action eq "remap") {
exit(WikiRemap(@ARGV));
}
else {
die("*** $0:\n".
" Do not know what to do with '$action'!\n");
......@@ -754,6 +757,32 @@ sub WikixLogin(@)
return 0;
}
#
# Remap user.
#
sub WikiRemap(@)
{
usage()
if (@_ != 2);
my ($user, $wikiname) = @_;
#
# Remap user in the user map.
#
dbmopen(%MAPDB, $USERMAPDB, 0644) or
fatal("Cannot open $USERMAPDB: $!");
print "Current mapping is ". $MAPDB{$user} . "\n";
$MAPDB{$user} = $wikiname;
# Write the DB back out.
dbmclose(%MAPDB);
return 0;
}
sub fatal($)
{
my($mesg) = $_[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment