2002-11-23 21:55:05 +01:00
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
%%% File : ejabberd_auth.erl
|
|
|
|
%%% Author : Alexey Shchepin <alexey@sevcom.net>
|
2004-12-12 22:00:34 +01:00
|
|
|
%%% Purpose : Authentification
|
2002-11-23 21:55:05 +01:00
|
|
|
%%% Created : 23 Nov 2002 by Alexey Shchepin <alexey@sevcom.net>
|
|
|
|
%%% Id : $Id$
|
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
|
|
|
|
-module(ejabberd_auth).
|
|
|
|
-author('alexey@sevcom.net').
|
|
|
|
-vsn('$Revision$ ').
|
|
|
|
|
|
|
|
%% External exports
|
2004-12-12 22:00:34 +01:00
|
|
|
-export([start/0,
|
2002-12-08 18:23:21 +01:00
|
|
|
set_password/2,
|
|
|
|
check_password/2,
|
2002-12-20 21:42:08 +01:00
|
|
|
check_password/4,
|
2003-01-05 21:24:59 +01:00
|
|
|
try_register/2,
|
|
|
|
dirty_get_registered_users/0,
|
2003-03-12 20:48:05 +01:00
|
|
|
get_password/1,
|
2003-01-21 21:36:55 +01:00
|
|
|
get_password_s/1,
|
2003-01-26 21:16:53 +01:00
|
|
|
is_user_exists/1,
|
2003-02-21 20:52:15 +01:00
|
|
|
remove_user/1,
|
2003-11-23 21:11:21 +01:00
|
|
|
remove_user/2,
|
2004-12-12 22:00:34 +01:00
|
|
|
plain_password_required/0
|
2003-11-23 21:11:21 +01:00
|
|
|
]).
|
2002-11-23 21:55:05 +01:00
|
|
|
|
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
%%% API
|
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
start() ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):start().
|
2003-11-23 21:11:21 +01:00
|
|
|
|
|
|
|
plain_password_required() ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):plain_password_required().
|
2003-11-23 21:11:21 +01:00
|
|
|
|
2002-12-08 18:23:21 +01:00
|
|
|
check_password(User, Password) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):check_password(User, Password).
|
2002-11-23 21:55:05 +01:00
|
|
|
|
2002-12-20 21:42:08 +01:00
|
|
|
check_password(User, Password, StreamID, Digest) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):check_password(User, Password, StreamID, Digest).
|
2002-12-20 21:42:08 +01:00
|
|
|
|
2002-12-08 18:23:21 +01:00
|
|
|
set_password(User, Password) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):set_password(User, Password).
|
2003-11-23 21:11:21 +01:00
|
|
|
|
2002-12-08 18:23:21 +01:00
|
|
|
try_register(User, Password) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):try_register(User, Password).
|
2002-12-14 21:07:26 +01:00
|
|
|
|
2003-01-01 20:54:44 +01:00
|
|
|
dirty_get_registered_users() ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):dirty_get_registered_users().
|
2003-01-01 20:54:44 +01:00
|
|
|
|
2003-03-12 20:48:05 +01:00
|
|
|
get_password(User) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):get_password(User).
|
2003-03-12 20:48:05 +01:00
|
|
|
|
2003-01-21 21:36:55 +01:00
|
|
|
get_password_s(User) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):get_password_s(User).
|
2003-01-21 21:36:55 +01:00
|
|
|
|
2003-01-05 21:24:59 +01:00
|
|
|
is_user_exists(User) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):is_user_exists(User).
|
2003-01-26 21:16:53 +01:00
|
|
|
|
|
|
|
remove_user(User) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):remove_user(User).
|
2003-02-21 20:52:15 +01:00
|
|
|
|
|
|
|
remove_user(User, Password) ->
|
2004-12-12 22:00:34 +01:00
|
|
|
(auth_module()):remove_user(User, Password).
|
2004-07-30 23:09:55 +02:00
|
|
|
|
2004-12-12 22:00:34 +01:00
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
%%% Internal functions
|
|
|
|
%%%----------------------------------------------------------------------
|
2003-11-23 21:11:21 +01:00
|
|
|
|
2004-12-12 22:00:34 +01:00
|
|
|
auth_module() ->
|
|
|
|
case ejabberd_config:get_local_option(auth_method) of
|
|
|
|
external ->
|
|
|
|
ejabberd_auth_external;
|
|
|
|
ldap ->
|
|
|
|
ejabberd_auth_ldap;
|
2004-12-14 00:00:12 +01:00
|
|
|
odbc ->
|
|
|
|
ejabberd_auth_odbc;
|
2003-11-23 21:11:21 +01:00
|
|
|
_ ->
|
2004-12-12 22:00:34 +01:00
|
|
|
ejabberd_auth_internal
|
2003-11-23 21:11:21 +01:00
|
|
|
end.
|
|
|
|
|