#!/usr/local/bin/perl
#
# Set user entry to "now"
#
# (c) Otmar Lendl (lendl@cosy.sbg.ac.at)
#

#
# Location of the database
#
$offenders = $ENV{"HOME"} . "/News/complaindb";

require("newgetopt.pl");

&NGetOpt("user=s") || die "Illegal Option.\n";
die "Specify user with -user !\n" if ($opt_user eq "");

dbmopen(%OFF, $offenders, 0644) || die "Can't open database.";

if (defined($OFF{$opt_user}))
	{
	$days = int( (time() - $OFF{$opt_user}) / (3600*24));
	print "Entry for $opt_user was set to $days days ago.\n";
	}
 else
	{
	print "There was no entry for $opt_user\n";
	}
$OFF{$opt_user} = time();

dbmclose(OFF);
