From e79338dad4cd4374eddadab765a098e00a8b26ef Mon Sep 17 00:00:00 2001 From: fukachan Date: Thu, 25 Jul 2002 00:10:11 +0000 Subject: improve error messages --- fml/lib/FML/Process/Command.pm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'fml/lib/FML/Process/Command.pm') diff --git a/fml/lib/FML/Process/Command.pm b/fml/lib/FML/Process/Command.pm index 458e0fdb..4b8fdd5d 100644 --- a/fml/lib/FML/Process/Command.pm +++ b/fml/lib/FML/Process/Command.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Command.pm,v 1.66 2002/07/18 23:51:03 fukachan Exp $ +# $FML: Command.pm,v 1.67 2002/07/19 03:11:01 fukachan Exp $ # package FML::Process::Command; @@ -475,8 +475,23 @@ sub _get_command_mode } } else { - $status->{ _stop_reason_key } = 'command.auth_fail'; - $status->{ _stop_reason_str } = "not authenticated."; + # Exapmle: incorrect password + if ($is_admin && (! $is_auth)) { + $status->{ _stop_reason_key } = 'command.auth_fail'; + $status->{ _stop_reason_str } = "not authenticated."; + } + # Example: not admin member (not in members-admin) + elsif ((! $is_admin) && $is_auth) { + $status->{ _stop_reason_key } = 'error.not_admin_member'; + $status->{ _stop_reason_str } = "not admin member."; + LogError("not admin member"); + } + # other reasons + else { + $status->{ _stop_reason_key } = 'command.auth_fail'; + $status->{ _stop_reason_str } = "not authenticated."; + } + LogError("admin command not authenticated"); return '__LAST__'; } -- cgit v1.2.1