#!/usr/bin/perl
#use Mooix::Thing;
use Mooix::CallStack;
use Mooix::Conf;
run sub {
	my $this=shift;
	%_=@_;
	
	# Make sure that the method is only called by this session or its
	# avatar, or the moo admin, all back along the stack; others cannot
	# confuse users into entering passwords.
	my $stack = Mooix::CallStack::get();
	my $avatar=$this->avatar;
	my $admin=Mooix::Thing->get($Mooix::Conf::field{mooadminobj});
	while ($stack) {
		if ($stack->index ne $this->index &&
		    $stack->index ne $avatar->index &&
		    $stack->index ne $admin->index) {
		    	return 0;   
		}
		$stack=$stack->next;
	}

	return 1
}
