2004-12-12 22:00:34 +01:00
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
%%% File : ejabberd_auth_external.erl
|
|
|
|
%%% Author : Alexey Shchepin <alexey@sevcom.net>
|
|
|
|
%%% Purpose : Authentification via LDAP external script
|
|
|
|
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@sevcom.net>
|
|
|
|
%%% Id : $Id$
|
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
|
|
|
|
-module(ejabberd_auth_external).
|
|
|
|
-author('alexey@sevcom.net').
|
|
|
|
|
|
|
|
%% External exports
|
2005-07-13 05:24:13 +02:00
|
|
|
-export([start/1,
|
2005-04-17 20:08:34 +02:00
|
|
|
set_password/3,
|
|
|
|
check_password/3,
|
|
|
|
check_password/5,
|
|
|
|
try_register/3,
|
2004-12-12 22:00:34 +01:00
|
|
|
dirty_get_registered_users/0,
|
2005-04-17 20:08:34 +02:00
|
|
|
get_vh_registered_users/1,
|
|
|
|
get_password/2,
|
|
|
|
get_password_s/2,
|
|
|
|
is_user_exists/2,
|
2004-12-12 22:00:34 +01:00
|
|
|
remove_user/2,
|
2005-04-17 20:08:34 +02:00
|
|
|
remove_user/3,
|
2004-12-12 22:00:34 +01:00
|
|
|
plain_password_required/0
|
|
|
|
]).
|
|
|
|
|
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
%%% API
|
|
|
|
%%%----------------------------------------------------------------------
|
2005-07-13 05:24:13 +02:00
|
|
|
start(Host) ->
|
|
|
|
extauth:start(
|
|
|
|
Host, ejabberd_config:get_local_option({extauth_program, Host})),
|
2004-12-12 22:00:34 +01:00
|
|
|
ok.
|
|
|
|
|
|
|
|
plain_password_required() ->
|
|
|
|
true.
|
|
|
|
|
2005-07-13 05:24:13 +02:00
|
|
|
check_password(User, Server, Password) ->
|
|
|
|
extauth:check_password(User, Server, Password).
|
2004-12-12 22:00:34 +01:00
|
|
|
|
2005-04-17 20:08:34 +02:00
|
|
|
check_password(User, Server, Password, _StreamID, _Digest) ->
|
|
|
|
check_password(User, Server, Password).
|
2004-12-12 22:00:34 +01:00
|
|
|
|
2005-07-13 05:24:13 +02:00
|
|
|
set_password(User, Server, Password) ->
|
|
|
|
extauth:set_password(User, Server, Password).
|
2004-12-12 22:00:34 +01:00
|
|
|
|
2005-04-17 20:08:34 +02:00
|
|
|
try_register(_User, _Server, _Password) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
{error, not_allowed}.
|
|
|
|
|
|
|
|
dirty_get_registered_users() ->
|
|
|
|
[].
|
|
|
|
|
2005-04-17 20:08:34 +02:00
|
|
|
get_vh_registered_users(_Server) ->
|
|
|
|
[].
|
|
|
|
|
|
|
|
get_password(_User, _Server) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
false.
|
|
|
|
|
2005-04-17 20:08:34 +02:00
|
|
|
get_password_s(_User, _Server) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
"".
|
|
|
|
|
2005-07-13 05:24:13 +02:00
|
|
|
is_user_exists(User, Server) ->
|
|
|
|
extauth:is_user_exists(User, Server).
|
2004-12-12 22:00:34 +01:00
|
|
|
|
2005-04-17 20:08:34 +02:00
|
|
|
remove_user(_User, _Server) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
{error, not_allowed}.
|
|
|
|
|
2005-04-17 20:08:34 +02:00
|
|
|
remove_user(_User, _Server, _Password) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
not_allowed.
|
|
|
|
|