diff --git a/TODO b/TODO index 6b39dca41..1e1b7f263 100644 --- a/TODO +++ b/TODO @@ -6,6 +6,10 @@ v0.9.0-alpha (2015-05-30) v0.8.0-alpha (2015-05-10) ------------------------- +Presence Management.... + +Force Subscriptions... + Documents... MySQL Auth diff --git a/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap.app.src b/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap.app.src index 61aca3ac0..970a0003c 100644 --- a/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap.app.src +++ b/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap.app.src @@ -1,12 +1,23 @@ {application, emqttd_auth_ldap, [ +<<<<<<< HEAD {description, "emqttd LDA Authentication Plugin"}, {vsn, "1.0"}, +======= + {description, ""}, + {vsn, "1"}, +>>>>>>> c6e92388798302ae3b44286f444505d1c385aba7 {registered, []}, {applications, [ kernel, stdlib ]}, +<<<<<<< HEAD {mod, {emqttd_auth_ldap_app, []}}, {env, []} ]}. +======= + {mod, { emqttd_auth_ldap_app, []}}, + {env, []} + ]}. +>>>>>>> c6e92388798302ae3b44286f444505d1c385aba7 diff --git a/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap.erl b/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap.erl index 02fb4d121..7ba2baee8 100644 --- a/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap.erl +++ b/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap.erl @@ -20,7 +20,11 @@ %%% SOFTWARE. %%%----------------------------------------------------------------------------- %%% @doc +<<<<<<< HEAD %%% LDAP Authentication Module. +======= +%%% LDAP authentication module. +>>>>>>> c6e92388798302ae3b44286f444505d1c385aba7 %%% %%% @end %%%----------------------------------------------------------------------------- @@ -34,6 +38,7 @@ -export([init/1, check/3, description/0]). +<<<<<<< HEAD -record(state, {servers, user_dn, options}). init(Opts) -> @@ -86,4 +91,11 @@ fill(Username, UserDn) -> fun("$u") -> Username; (S) -> S end, string:tokens(UserDn, ",="))). +======= +init(Opts) -> {ok, Opts}. + +check(_Client, _Password, _Opts) -> ingore. + +description() -> "LDAP authentication module". +>>>>>>> c6e92388798302ae3b44286f444505d1c385aba7 diff --git a/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap_app.erl b/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap_app.erl index c3d09b62f..27adba7c4 100644 --- a/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap_app.erl +++ b/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap_app.erl @@ -1,3 +1,4 @@ +<<<<<<< HEAD %%%----------------------------------------------------------------------------- %%% Copyright (c) 2012-2015 eMQTT.IO, All Rights Reserved. %%% @@ -56,3 +57,25 @@ stop(_State) -> init([]) -> {ok, { {one_for_one, 5, 10}, []} }. +======= +-module(emqttd_auth_ldap_app). + +-behaviour(application). + +%% Application callbacks +-export([start/2, stop/1]). + +%% =================================================================== +%% Application callbacks +%% =================================================================== + +start(_StartType, _StartArgs) -> + {ok, Sup} = emqttd_auth_ldap_sup:start_link(), + Env = application:get_all_env(), + emqttd_access_control:register_mod(auth, emqttd_auth_ldap, Env), + {ok, Sup}. + +stop(_State) -> + emqttd_access_control:unregister_mod(auth, emqttd_auth_ldap), + ok. +>>>>>>> c6e92388798302ae3b44286f444505d1c385aba7 diff --git a/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap_sup.erl b/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap_sup.erl new file mode 100644 index 000000000..e3ce043de --- /dev/null +++ b/plugins/emqttd_auth_ldap/src/emqttd_auth_ldap_sup.erl @@ -0,0 +1,27 @@ +-module(emqttd_auth_ldap_sup). + +-behaviour(supervisor). + +%% API +-export([start_link/0]). + +%% Supervisor callbacks +-export([init/1]). + +%% Helper macro for declaring children of supervisor +-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}). + +%% =================================================================== +%% API functions +%% =================================================================== + +start_link() -> + supervisor:start_link({local, ?MODULE}, ?MODULE, []). + +%% =================================================================== +%% Supervisor callbacks +%% =================================================================== + +init([]) -> + {ok, { {one_for_one, 5, 10}, []} }. + diff --git a/plugins/emqttd_dashboard/src/emqttd_dashboard.erl b/plugins/emqttd_dashboard/src/emqttd_dashboard.erl index 733d4d683..fae297b16 100644 --- a/plugins/emqttd_dashboard/src/emqttd_dashboard.erl +++ b/plugins/emqttd_dashboard/src/emqttd_dashboard.erl @@ -28,6 +28,11 @@ -author("Feng Lee "). +-export([handle_request/1]). + %%TODO... +handle_request(Req) -> + Req:ok("hello!"). + diff --git a/plugins/emqttd_dashboard/src/emqttd_dashboard_app.erl b/plugins/emqttd_dashboard/src/emqttd_dashboard_app.erl index e1f6c9550..8e0898679 100644 --- a/plugins/emqttd_dashboard/src/emqttd_dashboard_app.erl +++ b/plugins/emqttd_dashboard/src/emqttd_dashboard_app.erl @@ -10,7 +10,18 @@ %% =================================================================== start(_StartType, _StartArgs) -> - emqttd_dashboard_sup:start_link(). + {ok, Sup} = emqttd_dashboard_sup:start_link(), + open_listener(application:get_env(listener)), + {ok, Sup}. stop(_State) -> ok. + +%% open http port +open_listener({_Http, Port, Options}) -> + MFArgs = {emqttd_dashboard, handle_request, []}, + mochiweb:start_http(Port, Options, MFArgs). + +close_listener(Port) -> + mochiweb:stop_http(Port). + diff --git a/rel/files/plugins.config b/rel/files/plugins.config index c8e850e57..57dcb8abf 100644 --- a/rel/files/plugins.config +++ b/rel/files/plugins.config @@ -14,7 +14,7 @@ % % {emqttd_dashboard, [ % {listener, -% {http, 8080, [ +% {http, 18083, [ % {acceptors, 4}, % {max_clients, 512}]}} % ]}