Tadashi Okoshi
slash****@users*****
2005年 11月 22日 (火) 21:10:45 JST
Index: affelio_farm/kiosk/.htaccess
diff -u /dev/null affelio_farm/kiosk/.htaccess:1.1
--- /dev/null Tue Nov 22 21:10:44 2005
+++ affelio_farm/kiosk/.htaccess Tue Nov 22 21:10:44 2005
@@ -0,0 +1,5 @@
+AuthUserFile /etc/httpd/.htpasswd
+AuthGroupFile /dev/null
+AuthName "Please enter your ID and password"
+AuthType Basic
+require valid-user
Index: affelio_farm/kiosk/index.cgi
diff -u /dev/null affelio_farm/kiosk/index.cgi:1.1
--- /dev/null Tue Nov 22 21:10:44 2005
+++ affelio_farm/kiosk/index.cgi Tue Nov 22 21:10:44 2005
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+
+use lib("../admin/skelton/affelio/extlib");
+use CGI qw(-unique_headers);
+$CGI::DISABLE_UPLOADS = 0;
+$CGI::POST_MAX = 1024_000;
+use Error qw(:try);
+use CGI::Session qw(-ip_match);
+use HTML::Template;
+use Fcntl;
+
+use lib("../lib");
+use lib("../admin/skelton/affelio/lib/");
+#use Affelio;
+use AffelioFarm;
+use Affelio::misc::CGIError;
+use Affelio::misc::Debug qw( debug_print);
+use Affelio::misc::Time;
+use Affelio::misc::NetMisc;
+use Affelio::misc::WebInput;
+use Affelio::exception::Exception;
+
+my %handlers = ("stage1", "AffelioFarm::App::Stage1",
+ "stage2", "AffelioFarm::App::Stage2",
+ "stage3", "AffelioFarm::App::Stage3",
+ "stage4", "AffelioFarm::App::Stage4",
+ "stage5", "AffelioFarm::App::Stage5");
+
+############################################################################
+#load AffelioFarm, CGI, etc.
+############################################################################
+my $q = new CGI;
+my $farm = new AffelioFarm(ConfigDir => "../admin/config/");
+my $wi = new Affelio::misc::WebInput();
+
+my $tmpl_fs_root = $farm->{config}->{site}->{script_fs_root} . "/templates/" . $farm->{config}->{site}->{template};
+my $tmpl_web_root = $farm->{config}->{site}->{script_web_root} . "/templates/" . $farm->{config}->{site}->{template};
+my $HTTP_forward_flag = 0;
+my $forward_URL = "";
+my $ret_msg="";
+my $err_msg="";
+
+
+############################################################################
+#Preparing output_data
+############################################################################
+my %output_data
+ = ("script_web_root", $farm->{config}->{site}->{script_web_root},
+ "farm_web_root", $farm->{config}->{site}->{farm_web_root},
+ "tmpl_web_root", $tmpl_web_root,
+ "farm_support_url", $farm->{config}->{farming}->{farm_support_url},
+ "farm_name", $farm->{config}->{farming}->{farm_name},
+ "farm_owner", $farm->{config}->{farming}->{farm_owner},
+ "farm_owner_url", $farm->{config}->{farming}->{farm_owner_url},
+ "kiosk_flag", "true");
+
+############################################################################
+#Model invocation
+############################################################################
+my $mode1 = $wi->PTN_mode($q->url_param("mode1"));
+if ($mode1 eq "") {$mode1="stage1";}
+
+eval "use $handlers{$mode1}";
+if($@){
+ error($q, "Could not load handler [$mode1]");
+}
+
+my $ret="";
+try{
+ $ret = handler_function($q, $farm, \%output_data, 1);
+}catch Error with{
+ my $e = shift;
+ $output_data{"system_message"} = $e;
+
+ debug_print("XXXsystem_message: $output_data{system_message}");
+};
+
+
+############################################################################
+#Output View
+############################################################################
+if( $output_data{forwardto_URL} ne ""){
+ print "Location: $output_data{forwardto_URL}", "\n\n";
+}else{
+ print "Content-type: text/html; charset=UTF-8\n";
+ print "Pragma: no-cache", "\n\n";
+
+ my $TMPL_FILE = "$tmpl_fs_root" . $output_data{tmpl_file};
+
+ my $tmpl = new HTML::Template( filename => $TMPL_FILE,
+ die_on_bad_params => 0);
+ foreach my $data_key (keys(%output_data)) {
+ $tmpl->param($data_key => $output_data{$data_key});
+ }
+ print $farm->translate_templateL10N($tmpl->output);
+}
+