2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 10:46:03 +00:00

YAF: Simple username/password support for webcam http login

git-svn-id: https://svn.fhem.de/fhem/trunk@3915 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
marcproe 2013-09-16 14:52:34 +00:00
parent 09b87503bd
commit 9b59464e41

View File

@ -177,6 +177,9 @@ sub webcam_get_state() {
my $hover = YAF_getWidgetAttribute($_GET{"view_id"}, $_GET{"widget_id"}, "hover", "0");
my $proto = YAF_getWidgetAttribute($_GET{"view_id"}, $_GET{"widget_id"}, "protocol", "http");
my $width = YAF_getWidgetAttribute($_GET{"view_id"}, $_GET{"widget_id"}, "width", "100");
my $user = YAF_getWidgetAttribute($_GET{"view_id"}, $_GET{"widget_id"}, "user");
my $pass = YAF_getWidgetAttribute($_GET{"view_id"}, $_GET{"widget_id"}, "pass");
my $login = "";
my $address = YAF_getWidgetAttribute($_GET{"view_id"}, $_GET{"widget_id"}, "address", $defs{$fhemname}{ADDRESS});
@ -185,9 +188,12 @@ sub webcam_get_state() {
if(!defined $name) { #if alias is defined, use it as name
$name = $fhemname;
}
if($user && $pass) {
$login = $user . ":" . $pass . "@";
}
if(defined $d) {
if(lc $showm eq "img") {
my $ret = "<img style=\"border:1px solid black;\" src=\"".$proto."://".$address.$spath."\" width=\"".$width."\">";
my $ret = "<img style=\"border:1px solid black;\" src=\"" . $proto . "://" . $login . $address . $spath . "\" width=\"" . $width . "\">";
return $ret;
}
} else {