From 389435eaaad47348fcca8b8257c04092878052e6 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Tue, 5 May 2009 06:22:38 +0000 Subject: [PATCH] Bugfixing: FHEMWEB wont start without 99_priv_cgi git-svn-id: https://svn.fhem.de/fhem/trunk@369 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/99_priv_cgi.pm | 22 ++++++++++++++++++++++ fhem/webfrontend/pgm2/01_FHEMWEB.pm | 9 +++++---- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 fhem/contrib/99_priv_cgi.pm diff --git a/fhem/contrib/99_priv_cgi.pm b/fhem/contrib/99_priv_cgi.pm new file mode 100644 index 000000000..ed3e69f71 --- /dev/null +++ b/fhem/contrib/99_priv_cgi.pm @@ -0,0 +1,22 @@ +############################################## +package main; + +# call it whith http://localhost:8083/fhem/privcgi + +use strict; +use warnings; + +sub priv_cgi_Initialize($) +{ + $data{FWEXT}{"/privcgi"} = "priv_cgi_callback"; +} + +sub +priv_cgi_callback($$) +{ + my ($htmlarg) = @_; + Log 1, "Got $htmlarg"; + return ("text/html; charset=ISO-8859-1", "Hello World"); +} + +1; diff --git a/fhem/webfrontend/pgm2/01_FHEMWEB.pm b/fhem/webfrontend/pgm2/01_FHEMWEB.pm index eb0df8148..3ee9baed6 100755 --- a/fhem/webfrontend/pgm2/01_FHEMWEB.pm +++ b/fhem/webfrontend/pgm2/01_FHEMWEB.pm @@ -32,6 +32,7 @@ sub FW_calcWeblink($$); use vars qw($__ME); # webname (fhem), needed by SVG + ######################### # As we are _not_ multithreaded, it is safe to use global variables. my %__icons; # List of icons @@ -244,13 +245,13 @@ FW_AnswerCall($) } ############################## - # Axels FHEMWEB Module... + # Axels FHEMWEB modules... $arg = $1; - if(defined(%FWEXT)) { - foreach my $k (sort keys %FWEXT) { + if(defined($data{FWEXT})) { + foreach my $k (sort keys %{$data{FWEXT}}) { if($arg =~ m/^$k/) { no strict "refs"; - ($__RETTYPE, $__RET) = &{$FWEXT{$k}}($arg); + ($__RETTYPE, $__RET) = &{$data{FWEXT}{$k}}($arg); use strict "refs"; return 0; }