###
##	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.
###
# 
# --------------------------------------------------------------------------
# SET SECURE ON - nick usage control
# --------------------------------------------------------------------------
#

# Let's rely on keynick this time huh? I put it in the main parser
# $keynick = &dcase($nick);

if(!$rnicks{$keynick})
	{
	$text =qq~
	The nickname $nick doesn't appear to be registered.
	To use this SET command you must register the nick
	first. It's painless, really..
	/msg $nicknick REGISTER <password>~;
	&sendtext($text, "\t"); # no tabs in send
	return;
	}
# it was apparently registered
# let's see if they identified.
if(!$nicks{$keynick}{ident}{nicks}{$keynick})
	{
	$text =qq~
	You must identify to $nicknick before
	using this command. Try this:
	/msg $nicknick IDENTIFY <password>
	or for more information try:
	/msg $nicknick HELP SET SECURE~;
	&sendtext($text, "\t"); # no tabs in send
	return;
	}

# all checks passed, set the flag
$rnicks{$keynick}{secure} = "on";
&send(":$servnick NOTICE $nick :You're SECURE flag is now ON\n");


