2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-06 06:08:44 +00:00

SMUtils.pm: new version 1.27.3

git-svn-id: https://svn.fhem.de/fhem/trunk@29299 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2024-10-26 18:29:25 +00:00
parent 6f1d69bc05
commit 10f7630c79

View File

@ -26,6 +26,7 @@
#########################################################################################################################
# Version History
# 1.27.3 26.10.2024 compatibility to SSCam V 9.12.0
# 1.27.2 16.03.2024 change checkModVer text output
# 1.27.1 04.12.2023 change checkModVer
# 1.27.0 03.12.2023 new function checkModVer
@ -59,7 +60,7 @@ use FHEM::SynoModules::ErrCodes qw(:all); # Erro
use GPUtils qw( GP_Import GP_Export );
use Carp qw(croak carp);
use version 0.77; our $VERSION = version->declare('1.27.2');
use version 0.77; our $VERSION = version->declare('1.27.3');
use Exporter ('import');
our @EXPORT_OK = qw(
@ -1295,6 +1296,8 @@ sub login {
delete $hash->{HELPER}{SID};
$apiauthpath = 'webapi/entry.cgi' if($apiauthpath eq 'entry.cgi'); # compatibility SSCam >= V 9.12.0
Log3 ($name, 4, "$name - --- Begin Function login ---");
my ($success, $username, $password) = getCredentials($hash,0,"credentials",$sep); # Credentials abrufen
@ -1322,12 +1325,12 @@ sub login {
my $sid = AttrVal($name, "noQuotesForSID", 0) ? "sid" : qq{"sid"}; # sid in Quotes einschliessen oder nicht -> bei Problemen mit 402 - Permission denied
if (AttrVal($name,"session","DSM") eq "DSM") {
$url = "$proto://$serveraddr:$serverport/webapi/$apiauthpath?api=$apiauth&version=$apiauthver&method=Login&account=$username&passwd=$password&format=$sid";
$urlwopw = "$proto://$serveraddr:$serverport/webapi/$apiauthpath?api=$apiauth&version=$apiauthver&method=Login&account=$username&passwd=*****&format=$sid";
$url = "$proto://$serveraddr:$serverport/$apiauthpath?api=$apiauth&version=$apiauthver&method=Login&account=$username&passwd=$password&format=$sid";
$urlwopw = "$proto://$serveraddr:$serverport/$apiauthpath?api=$apiauth&version=$apiauthver&method=Login&account=$username&passwd=*****&format=$sid";
}
else {
$url = "$proto://$serveraddr:$serverport/webapi/$apiauthpath?api=$apiauth&version=$apiauthver&method=Login&account=$username&passwd=$password&session=SurveillanceStation&format=$sid";
$urlwopw = "$proto://$serveraddr:$serverport/webapi/$apiauthpath?api=$apiauth&version=$apiauthver&method=Login&account=$username&passwd=*****&session=SurveillanceStation&format=$sid";
$url = "$proto://$serveraddr:$serverport/$apiauthpath?api=$apiauth&version=$apiauthver&method=Login&account=$username&passwd=$password&session=SurveillanceStation&format=$sid";
$urlwopw = "$proto://$serveraddr:$serverport/$apiauthpath?api=$apiauth&version=$apiauthver&method=Login&account=$username&passwd=*****&session=SurveillanceStation&format=$sid";
}
my $printurl = AttrVal($name, "showPassInLog", 0) ? $url : $urlwopw;
@ -1449,6 +1452,8 @@ sub logout {
my $url;
$apiauthpath = 'webapi/entry.cgi' if($apiauthpath eq 'entry.cgi'); # compatibility SSCam >= V 9.12.0
Log3 ($name, 4, "$name - --- Start Synology logout ---");
my ($success, $username) = getCredentials($hash,0,"credentials",$sep);
@ -1474,10 +1479,10 @@ sub logout {
Log3 ($name, 5, "$name - Call logout will be done with timeout value: $timeout s");
if (AttrVal($name,"session","DSM") eq "DSM") {
$url = "$proto://$serveraddr:$serverport/webapi/$apiauthpath?api=$apiauth&version=$apiauthver&method=Logout&_sid=$sid";
$url = "$proto://$serveraddr:$serverport/$apiauthpath?api=$apiauth&version=$apiauthver&method=Logout&_sid=$sid";
}
else {
$url = "$proto://$serveraddr:$serverport/webapi/$apiauthpath?api=$apiauth&version=$apiauthver&method=Logout&session=SurveillanceStation&_sid=$sid";
$url = "$proto://$serveraddr:$serverport/$apiauthpath?api=$apiauth&version=$apiauthver&method=Logout&session=SurveillanceStation&_sid=$sid";
}
my $param = {