From 6d2ca92566549ff5329e7ecd2c9256ff529b93ae Mon Sep 17 00:00:00 2001 From: fukachan Date: Tue, 9 Sep 2008 09:49:29 +0000 Subject: $commands_for_ml_admin_cgi -> $ml_admin_cgi_allowed_commands ensure the return value for CGI action to be not "undef". menu is enhanced to handle both *admin.cgi and anonymous cgi case. --- fml/lib/FML/Process/CGI/Utils.pm | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/fml/lib/FML/Process/CGI/Utils.pm b/fml/lib/FML/Process/CGI/Utils.pm index 7f4c86fe..28dcaaee 100644 --- a/fml/lib/FML/Process/CGI/Utils.pm +++ b/fml/lib/FML/Process/CGI/Utils.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2003,2004,2005 Ken'ichi Fukamachi +# Copyright (C) 2003,2004,2005,2008 Ken'ichi Fukamachi # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Utils.pm,v 1.15 2005/06/04 08:21:28 fukachan Exp $ +# $FML: Utils.pm,v 1.16 2005/06/04 08:51:29 fukachan Exp $ # package FML::Process::CGI::Utils; @@ -143,8 +143,7 @@ sub cgi_var_available_command_list return $config->get_as_array_ref('admin_cgi_allowed_commands'); } else { - # XXX-TODO: commands_for_ml_admin_cgi -> ml_admin_cgi_allowed_commands - return $config->get_as_array_ref('commands_for_ml_admin_cgi'); + return $config->get_as_array_ref('ml_admin_cgi_allowed_commands'); } } @@ -156,7 +155,12 @@ sub cgi_var_available_command_list sub cgi_var_action { my ($curproc) = @_; - return $curproc->safe_cgi_action_name(); + + my ($action) = $curproc->safe_cgi_action_name() || ''; + unless ($action) { + $curproc->logdebug("no action name"); + } + return $action; } @@ -215,9 +219,15 @@ sub cgi_var_navigator_title if ($mode eq 'admin') { return "$fml_url admin menu\n
"; } - else { + elsif ($mode eq 'ml-admin') { return "$fml_url ml-admin menu\n
"; } + elsif ($mode eq 'anonymous') { + return "$fml_url anonymous menu\n
"; + } + else { + return "$fml_url menu\n
"; + } } @@ -297,7 +307,7 @@ Ken'ichi Fukamachi =head1 COPYRIGHT -Copyright (C) 2003,2004,2005 Ken'ichi Fukamachi +Copyright (C) 2003,2004,2005,2008 Ken'ichi Fukamachi All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -- cgit v1.2.1