projects
/
svn42.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f9d3258
)
button does not need user
author
Bernhard Tittelbach
<xro@realraum.at>
Mon, 19 Jan 2015 18:52:53 +0000
(18:52 +0000)
committer
Bernhard Tittelbach
<xro@realraum.at>
Mon, 19 Jan 2015 18:52:53 +0000
(18:52 +0000)
go/door_daemon_zmq/handle_commands.go
patch
|
blob
|
history
diff --git
a/go/door_daemon_zmq/handle_commands.go
b/go/door_daemon_zmq/handle_commands.go
index
33db54e
..
e8c3334
100644
(file)
--- a/
go/door_daemon_zmq/handle_commands.go
+++ b/
go/door_daemon_zmq/handle_commands.go
@@
-22,7
+22,7
@@
var cmdToDoorCmdHandler = map[string]DoorCmdHandler {
func checkCmdDoorControl(tokens [][]byte) (error) {
doorctrl_usage := "syntax: <open|close|toggle> <method> <nickname>"
func checkCmdDoorControl(tokens [][]byte) (error) {
doorctrl_usage := "syntax: <open|close|toggle> <method> <nickname>"
- if len(tokens) != 3 {
+ if len(tokens) < 2 || len(tokens) > 3 {
return errors.New(doorctrl_usage)
}
cmd := string(tokens[0])
return errors.New(doorctrl_usage)
}
cmd := string(tokens[0])
@@
-33,7
+33,7
@@
func checkCmdDoorControl(tokens [][]byte) (error) {
if ! (method == "Button" || method == "ssh" || method == "SSH" || method == "Phone") {
return errors.New("method must be one either Button, SSH or Phone")
}
if ! (method == "Button" || method == "ssh" || method == "SSH" || method == "Phone") {
return errors.New("method must be one either Button, SSH or Phone")
}
- if len(tokens[2]) == 0 && method != "Button" {
+ if (len(tokens) == 2 || len(tokens[2]) == 0) && method != "Button" {
return errors.New("Operator nickname must be given")
}
return nil
return errors.New("Operator nickname must be given")
}
return nil