From 356745853cb890d8c488df6a4f173155919ee288 Mon Sep 17 00:00:00 2001 From: delmar Date: Sat, 20 Mar 2021 13:20:15 +0000 Subject: [PATCH] 70_ZoneMinder: made Crypt dependency for v 1.30 optional git-svn-id: https://svn.fhem.de/fhem/trunk@24022 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/70_ZoneMinder.pm | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index ce310378f..ac1d03541 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - change: 70_ZoneMinder: made Crypt dependency for v 1.30 optional - change: 48_BlinkCamera: Change to new Blink login API / add resetUniqueID - change: 47_OBIS: redesign of parser (major change) - bugfix: 57_Calendar: avoid spurious re-creation of all events diff --git a/fhem/FHEM/70_ZoneMinder.pm b/fhem/FHEM/70_ZoneMinder.pm index 4ea73928d..229b7ab45 100755 --- a/fhem/FHEM/70_ZoneMinder.pm +++ b/fhem/FHEM/70_ZoneMinder.pm @@ -34,7 +34,6 @@ package main; use strict; use warnings; use HttpUtils; -use Crypt::MySQL qw(password41); use DevIo; use Digest::MD5 qw(md5 md5_hex md5_base64); @@ -700,6 +699,12 @@ sub ZoneMinder_calcAuthHash { my ($hash) = @_; my $name = $hash->{NAME}; + eval 'use Crypt::MySQL qw(password41)'; + if($@) { + Log3 $name, 0, "ZoneMinder ($name) - ERROR: Crypt::MySQL required for auth-hash support in ZoneMinder 1.30. Please install Crypt::MySQL (or upgrade to ZoneMinder 1.32+)"; + return $name; + } + Log3 $name, 4, "ZoneMinder ($name) - calling calcAuthHash"; my ($sec,$min,$curHour,$dayOfMonth,$curMonth,$curYear,$wday,$yday,$isdst) = localtime();