summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMickael Remond <mremond@process-one.net>2016-03-29 13:05:12 +0200
committerMickael Remond <mremond@process-one.net>2016-03-29 13:05:12 +0200
commitaa151488987f68c8608673379487f614e644a09a (patch)
tree203b6c726432bcb84b7b710ee5a91c80856a0641
parentMerge branch 'master' of github.com:processone/ejabberd (diff)
Fix commands access check.
-rw-r--r--src/ejabberd_commands.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ejabberd_commands.erl b/src/ejabberd_commands.erl
index 3c98316d..e919d26a 100644
--- a/src/ejabberd_commands.erl
+++ b/src/ejabberd_commands.erl
@@ -352,7 +352,7 @@ get_command_definition(Name) ->
execute_command(Name, Arguments) ->
execute_command([], noauth, Name, Arguments).
--spec execute_command([{atom(), [atom()], [any()]}],
+-spec execute_command([{atom(), [atom()], [any()]}] | undefined,
{binary(), binary(), binary(), boolean()} |
noauth | admin,
atom(),
@@ -361,7 +361,7 @@ execute_command(Name, Arguments) ->
%% @spec (AccessCommands, Auth, Name::atom(), Arguments) -> ResultTerm | {error, Error}
%% where
-%% AccessCommands = [{Access, CommandNames, Arguments}]
+%% AccessCommands = [{Access, CommandNames, Arguments}] | undefined
%% Auth = {User::string(), Server::string(), Password::string(), Admin::boolean()}
%% | noauth
%% | admin
@@ -465,7 +465,7 @@ check_access_commands([], _Auth, _Method, _Command, _Arguments) ->
check_access_commands(AccessCommands, Auth, Method, Command1, Arguments) ->
Command =
case {Command1#ejabberd_commands.policy, Auth} of
- {user, {_, _, _}} ->
+ {user, {_, _, _, _}} ->
Command1;
{user, _} ->
Command1#ejabberd_commands{