mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
RESIDENTS, GUEST, ROOMMATE, ENIGMA2, ONKYO_AVR, PHTV: complete support for set-user strin in FHEMWEB attribute allowedCommands (forum #35338.0)
git-svn-id: https://svn.fhem.de/fhem/trunk@8276 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
918253925e
commit
38a78f4144
@ -271,8 +271,15 @@ sub RESIDENTS_Set($@) {
|
|||||||
# restrict set commands if there is "set-user" in it
|
# restrict set commands if there is "set-user" in it
|
||||||
my $adminMode = 1;
|
my $adminMode = 1;
|
||||||
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
||||||
$adminMode = 0
|
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ ) {
|
||||||
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ );
|
$adminMode = 0;
|
||||||
|
return "Forbidden command: set " . $a[1]
|
||||||
|
if ( lc( $a[1] ) eq "addroommate"
|
||||||
|
|| lc( $a[1] ) eq "addguest"
|
||||||
|
|| lc( $a[1] ) eq "removeroommate"
|
||||||
|
|| lc( $a[1] ) eq "removeguest"
|
||||||
|
|| lc( $a[1] ) eq "create" );
|
||||||
|
}
|
||||||
|
|
||||||
# states
|
# states
|
||||||
my $states = (
|
my $states = (
|
||||||
@ -1065,6 +1072,10 @@ sub RESIDENTS_UpdateReadings (@) {
|
|||||||
<b>create</b> wakeuptimer add several pre-configurations provided by RESIDENTS Toolkit. See separate section for details.
|
<b>create</b> wakeuptimer add several pre-configurations provided by RESIDENTS Toolkit. See separate section for details.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<u>Note:</u> If you would like to retrict access to admin set-commands (-> addGuest, addRoommate, removeGuest, create) you may your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
|
||||||
|
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
|
||||||
|
</ul>
|
||||||
</div><br>
|
</div><br>
|
||||||
<br>
|
<br>
|
||||||
<div style="margin-left: 2em">
|
<div style="margin-left: 2em">
|
||||||
@ -1306,6 +1317,10 @@ sub RESIDENTS_UpdateReadings (@) {
|
|||||||
<b>create</b> wakeuptimer fügt diverse Vorkonfigurationen auf Basis von RESIDENTS Toolkit hinzu. Siehe separate Sektion.
|
<b>create</b> wakeuptimer fügt diverse Vorkonfigurationen auf Basis von RESIDENTS Toolkit hinzu. Siehe separate Sektion.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<u>Hinweis:</u> Sofern der Zugriff auf administrative set-Kommandos (-> addGuest, addRoommate, removeGuest, create) eingeschränkt werden soll, kann in einer FHEMWEB Instanz das Attribut allowedCommands ähnlich wie 'set,set-user' erweitert werden.
|
||||||
|
Die Zeichenfolge 'set-user' stellt dabei sicher, dass beim Zugriff auf FHEM über diese FHEMWEB Instanz nur nicht-administrative set-Kommandos ausgeführt werden können.
|
||||||
|
</ul>
|
||||||
</div><br>
|
</div><br>
|
||||||
<br>
|
<br>
|
||||||
<div style="margin-left: 2em">
|
<div style="margin-left: 2em">
|
||||||
|
@ -289,8 +289,11 @@ sub GUEST_Set($@) {
|
|||||||
# restrict set commands if there is "set-user" in it
|
# restrict set commands if there is "set-user" in it
|
||||||
my $adminMode = 1;
|
my $adminMode = 1;
|
||||||
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
||||||
$adminMode = 0
|
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ ) {
|
||||||
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ );
|
$adminMode = 0;
|
||||||
|
return "Forbidden command: set " . $a[1]
|
||||||
|
if ( lc( $a[1] ) eq "create" );
|
||||||
|
}
|
||||||
|
|
||||||
# states
|
# states
|
||||||
my $states = (
|
my $states = (
|
||||||
@ -1040,6 +1043,10 @@ sub GUEST_StartInternalTimers($$) {
|
|||||||
<b>create</b> wakeuptimer add several pre-configurations provided by RESIDENTS Toolkit. See separate section in <a href="#RESIDENTS">RESIDENTS module commandref</a> for details.
|
<b>create</b> wakeuptimer add several pre-configurations provided by RESIDENTS Toolkit. See separate section in <a href="#RESIDENTS">RESIDENTS module commandref</a> for details.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<u>Note:</u> If you would like to retrict access to admin set-commands (-> create) you may your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
|
||||||
|
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
|
||||||
|
</ul>
|
||||||
</div><br>
|
</div><br>
|
||||||
<br>
|
<br>
|
||||||
<div style="margin-left: 2em">
|
<div style="margin-left: 2em">
|
||||||
@ -1319,6 +1326,10 @@ sub GUEST_StartInternalTimers($$) {
|
|||||||
<b>create</b> wakeuptimer fügt diverse Vorkonfigurationen auf Basis von RESIDENTS Toolkit hinzu. Siehe separate Sektion in der <a href="#RESIDENTS">RESIDENTS Modul Kommandoreferenz</a>.
|
<b>create</b> wakeuptimer fügt diverse Vorkonfigurationen auf Basis von RESIDENTS Toolkit hinzu. Siehe separate Sektion in der <a href="#RESIDENTS">RESIDENTS Modul Kommandoreferenz</a>.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<u>Hinweis:</u> Sofern der Zugriff auf administrative set-Kommandos (-> create) eingeschränkt werden soll, kann in einer FHEMWEB Instanz das Attribut allowedCommands ähnlich wie 'set,set-user' erweitert werden.
|
||||||
|
Die Zeichenfolge 'set-user' stellt dabei sicher, dass beim Zugriff auf FHEM über diese FHEMWEB Instanz nur nicht-administrative set-Kommandos ausgeführt werden können.
|
||||||
|
</ul>
|
||||||
</div><br>
|
</div><br>
|
||||||
<br>
|
<br>
|
||||||
<div style="margin-left: 2em">
|
<div style="margin-left: 2em">
|
||||||
|
@ -294,8 +294,11 @@ sub ROOMMATE_Set($@) {
|
|||||||
# restrict set commands if there is "set-user" in it
|
# restrict set commands if there is "set-user" in it
|
||||||
my $adminMode = 1;
|
my $adminMode = 1;
|
||||||
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
||||||
$adminMode = 0
|
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ ) {
|
||||||
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ );
|
$adminMode = 0;
|
||||||
|
return "Forbidden command: set " . $a[1]
|
||||||
|
if ( lc( $a[1] ) eq "create" );
|
||||||
|
}
|
||||||
|
|
||||||
# states
|
# states
|
||||||
my $states = (
|
my $states = (
|
||||||
@ -1021,6 +1024,10 @@ sub ROOMMATE_StartInternalTimers($$) {
|
|||||||
<b>create</b> wakeuptimer add several pre-configurations provided by RESIDENTS Toolkit. See separate section in <a href="#RESIDENTS">RESIDENTS module commandref</a> for details.
|
<b>create</b> wakeuptimer add several pre-configurations provided by RESIDENTS Toolkit. See separate section in <a href="#RESIDENTS">RESIDENTS module commandref</a> for details.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<u>Note:</u> If you would like to retrict access to admin set-commands (-> create) you may your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
|
||||||
|
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
|
||||||
|
</ul>
|
||||||
</div><br>
|
</div><br>
|
||||||
<br>
|
<br>
|
||||||
<div style="margin-left: 2em">
|
<div style="margin-left: 2em">
|
||||||
@ -1300,6 +1307,10 @@ sub ROOMMATE_StartInternalTimers($$) {
|
|||||||
<b>create</b> wakeuptimer fügt diverse Vorkonfigurationen auf Basis von RESIDENTS Toolkit hinzu. Siehe separate Sektion in der <a href="#RESIDENTS">RESIDENTS Modul Kommandoreferenz</a>.
|
<b>create</b> wakeuptimer fügt diverse Vorkonfigurationen auf Basis von RESIDENTS Toolkit hinzu. Siehe separate Sektion in der <a href="#RESIDENTS">RESIDENTS Modul Kommandoreferenz</a>.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<u>Hinweis:</u> Sofern der Zugriff auf administrative set-Kommandos (-> create) eingeschränkt werden soll, kann in einer FHEMWEB Instanz das Attribut allowedCommands ähnlich wie 'set,set-user' erweitert werden.
|
||||||
|
Die Zeichenfolge 'set-user' stellt dabei sicher, dass beim Zugriff auf FHEM über diese FHEMWEB Instanz nur nicht-administrative set-Kommandos ausgeführt werden können.
|
||||||
|
</ul>
|
||||||
</div><br />
|
</div><br />
|
||||||
<br />
|
<br />
|
||||||
<div style="margin-left: 2em">
|
<div style="margin-left: 2em">
|
||||||
|
@ -214,8 +214,14 @@ sub ENIGMA2_Set($@) {
|
|||||||
# restrict set commands if there is "set-user" in it
|
# restrict set commands if there is "set-user" in it
|
||||||
my $adminMode = 1;
|
my $adminMode = 1;
|
||||||
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
||||||
$adminMode = 0
|
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ ) {
|
||||||
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ );
|
$adminMode = 0;
|
||||||
|
return "Forbidden command: set " . $a[1]
|
||||||
|
if ( lc( $a[1] ) eq "statusrequest"
|
||||||
|
|| lc( $a[1] ) eq "reboot"
|
||||||
|
|| lc( $a[1] ) eq "restartgui"
|
||||||
|
|| lc( $a[1] ) eq "shutdown" );
|
||||||
|
}
|
||||||
|
|
||||||
# load channel list
|
# load channel list
|
||||||
if (
|
if (
|
||||||
@ -3046,6 +3052,10 @@ sub ENIGMA2_GetRemotecontrolCommand($) {
|
|||||||
<b>msg</b> yesno,info... - allows more complex messages as showText, see commands as listed below
|
<b>msg</b> yesno,info... - allows more complex messages as showText, see commands as listed below
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<u>Note:</u> If you would like to retrict access to admin set-commands (-> statusRequest, reboot, restartGui, shutdown) you may your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
|
||||||
|
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
|
||||||
|
</ul>
|
||||||
</div><br>
|
</div><br>
|
||||||
<br>
|
<br>
|
||||||
<div style="margin-left: 2em">
|
<div style="margin-left: 2em">
|
||||||
|
@ -611,8 +611,12 @@ sub ONKYO_AVR_Set($@) {
|
|||||||
# restrict set commands if there is "set-user" in it
|
# restrict set commands if there is "set-user" in it
|
||||||
my $adminMode = 1;
|
my $adminMode = 1;
|
||||||
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
||||||
$adminMode = 0
|
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ ) {
|
||||||
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ );
|
$adminMode = 0;
|
||||||
|
return "Forbidden command: set " . $a[1]
|
||||||
|
if ( lc( $a[1] ) eq "statusrequest"
|
||||||
|
|| lc( $a[1] ) eq "remotecontrol" );
|
||||||
|
}
|
||||||
|
|
||||||
# Input alias handling
|
# Input alias handling
|
||||||
if ( defined( $attr{$name}{inputs} ) && $attr{$name}{inputs} ne "" ) {
|
if ( defined( $attr{$name}{inputs} ) && $attr{$name}{inputs} ne "" ) {
|
||||||
@ -1728,6 +1732,10 @@ sub ONKYO_AVR_RClayout() {
|
|||||||
<b>remoteControl</b> - sends remote control commands; see remoteControl help
|
<b>remoteControl</b> - sends remote control commands; see remoteControl help
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<u>Note:</u> If you would like to retrict access to admin set-commands (-> statusRequest, remoteControl) you may your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
|
||||||
|
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
|
||||||
|
</ul>
|
||||||
</div><br>
|
</div><br>
|
||||||
<br>
|
<br>
|
||||||
<a name="ONKYO_AVRget" id="ONKYO_AVRget"></a> <b>Get</b>
|
<a name="ONKYO_AVRget" id="ONKYO_AVRget"></a> <b>Get</b>
|
||||||
|
@ -285,8 +285,11 @@ sub PHTV_Set($@) {
|
|||||||
# restrict set commands if there is "set-user" in it
|
# restrict set commands if there is "set-user" in it
|
||||||
my $adminMode = 1;
|
my $adminMode = 1;
|
||||||
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
my $FWallowedCommands = AttrVal( $FW_wname, "allowedCommands", 0 );
|
||||||
$adminMode = 0
|
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ ) {
|
||||||
if ( $FWallowedCommands && $FWallowedCommands =~ m/\bset-user\b/ );
|
$adminMode = 0;
|
||||||
|
return "Forbidden command: set " . $a[1]
|
||||||
|
if ( lc( $a[1] ) eq "statusrequest" );
|
||||||
|
}
|
||||||
|
|
||||||
# Input alias handling
|
# Input alias handling
|
||||||
if ( defined( $attr{$name}{inputs} ) && $attr{$name}{inputs} ne "" ) {
|
if ( defined( $attr{$name}{inputs} ) && $attr{$name}{inputs} ne "" ) {
|
||||||
@ -3351,6 +3354,10 @@ sub PHTV_min {
|
|||||||
<li><b>record</b> - starts recording of current channel</li>
|
<li><b>record</b> - starts recording of current channel</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<u>Note:</u> If you would like to retrict access to admin set-commands (-> statusRequest) you may your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
|
||||||
|
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
|
||||||
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user