2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

fhem.pl: add attribute keyFileName, remove uniqueID (Forum #87741)

git-svn-id: https://svn.fhem.de/fhem/trunk@16744 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-05-15 20:06:23 +00:00
parent deb3789bee
commit ed00a9be1a
3 changed files with 23 additions and 7 deletions

View File

@ -1494,6 +1494,14 @@ The following local attributes are used by a wider range of devices:
compression by default. Set httpcompress to 0 to disable this feature.
</li><br>
<a name="keyFileName"></a>
<li>keyFileName<br>
FHEM modules store passwords and unique IDs in the file
FHEM/FhemUtils/uniqueID. In order to start multiple FHEM instances from
the same directory, you may set this attribute, whose value will
appended to FHEM/FhemUtils/
</li><br>
<a name="logdir"></a>
<li>logdir<br>
If set, the %L attribute in the logfile attribute (or in the FileLog
@ -1595,8 +1603,6 @@ The following local attributes are used by a wider range of devices:
<li><a href="#title">title</a><br>
<li><a href="#fheminfo">uniqueID</a><br>
<a name="useInet6"></a>
<li>useInet6<br>
try to use IPv6 in HttpUtils for communication. If the server does not

View File

@ -1596,6 +1596,14 @@ Die folgenden lokalen Attribute werden von mehreren Ger&auml;ten verwendet:
httpcompress auf 0 setzt, wird die Komprimierung deaktiviert.
</li><br>
<a name="keyFileName"></a>
<li>keyFileName<br>
FHEM Module speichern Passw&ouml;rter und IDs in der Datei
FHEM/FhemUtils/uniqueID. Um mehrere FHEM-Instanzen im gleichen
Verzeichnis starten zu k&ouml;nnen, kann man dieses Attribut setzen,
dessen Wert an FHEM/FhemUtils/ angeh&auml;ngt wird.
</li><br>
<a name="logdir"></a>
<li>logdir<br>
Falls gesetzt, wird %L in dem logfile Attribut (oder in der Dateinamen
@ -1710,8 +1718,6 @@ Die folgenden lokalen Attribute werden von mehreren Ger&auml;ten verwendet:
<li><a href="#title">title</a><br>
<li><a href="#fheminfo">uniqueID</a>
<a name="useInet6"></a>
<li>useInet6<br>
Die HttpUtils Routinen verwenden IPv6 f&uuml;r die Kommunikation, falls

View File

@ -316,6 +316,7 @@ my @globalAttrList = qw(
genericDisplayType:switch,outlet,light,blind,speaker,thermostat
holiday2we
httpcompress:0,1
keyFileName
language:EN,DE
lastinclude
latitude
@ -340,7 +341,6 @@ my @globalAttrList = qw(
stacktrace:1,0
statefile
title
uniqueID
updateInBackground:1,0
updateNoFileCheck:1,0
useInet6:1,0
@ -5044,7 +5044,9 @@ sub
getKeyValue($)
{
my ($key) = @_;
my $fName = $attr{global}{modpath}."/FHEM/FhemUtils/uniqueID";
my $fName = AttrVal("global", "keyFileName", "uniqueID");
$fName =~ s/\.\.//g;
$fName = $attr{global}{modpath}."/FHEM/FhemUtils/$fName";
my ($err, @l) = FileRead($fName);
return ($err, undef) if($err);
for my $l (@l) {
@ -5058,7 +5060,9 @@ sub
setKeyValue($$)
{
my ($key,$value) = @_;
my $fName = $attr{global}{modpath}."/FHEM/FhemUtils/uniqueID";
my $fName = AttrVal("global", "keyFileName", "uniqueID");
$fName =~ s/\.\.//g;
$fName = $attr{global}{modpath}."/FHEM/FhemUtils/$fName";
my ($err, @old) = FileRead($fName);
my @new;
if($err) {