###
##	Original package IRCCS version 1, Copyright (c) 1995
##	Daniel J. Wightman.  Rewritten from Nov to Dec 2000.
##	Packaged Dec 19 and published as IRCCS (fruitbrick) version 2.
##
##	FruitBrick (IRCCS) - Internet Relay Chat Control System version 2
##	Copyright (C) 1995, 2000  Daniel J. Wightman <dent@abonica.net>
##
##	See the copyright or COPYRIGHT in the main program directory for
##	details.  See the LICENSE in the main program directory as well.
###
# 
# --------------------------------------------------------------------------
# WRITEDATA - starts the database write immediately
# --------------------------------------------------------------------------

{
# do they have auth? only admin gets this command
if($opers{$keynick}{rank} ne "admin")
	{
	$text = qq~
	You don't appear to have access to this setting. 
	You can gain access by authenticating as the admin.
	Only administrators can use this command.~;
	&sendtext($text, "\n", "\t");
	return;
	}
# is there a write in progress?
if(defined($flags{database}))
	{
	$text = qq~
	Database write flag is set which means that 
	a database write has already been spawned. 
	There's no need to do it again.~;
	&sendtext($text, "\n", "\t");
	return;
	}

# passed
&send(":$servnick NOTICE $nick :Writing databases.\n");
&writelog("Manual database write started by $nick");
&writedatabase;
}



