~ubuntu-branches/ubuntu/trusty/ejabberd/trusty-proposed

« back to all changes in this revision

Viewing changes to src/ejabberd_auth.erl

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs, Konstantin Khomoutov, Gerfried Fuchs
  • Date: 2009-12-04 18:22:49 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20091204182249-6jfmdz8878h7oaos
Tags: 2.1.0-1
[ Konstantin Khomoutov ]
* New upstream release (Closes: #519858).
  This also adds support for LDAPS upstream (Closes: #526145).
* Do not depend on cdbs anymore, port debian/rules to dh+quilt,
  remove build dependency on patchutils, use erlang-depends.
* Bump debhelper version to 7, standards base to 3.8.3
* Depend on erlang R13B.
* Recommend imagemagick (for captcha support).
* Remove deprecated patches (ssl.patch patch, dynamic_compile_loglevel.patch,
  ldaps.patch, update.patch, proxy.patch, caps.patch, convert.patch,
  s2s.patch).
* Replace mod_ctlextra with mod_admin_extra.
* Use upstream inetrc file.
* Bring debian/ejabberd.cfg and ejabberdctl in sync with upstream.
* Update ejabberdctl manual page.
* Provide NEWS file.
* Rework README.Debian:
  * Group all information into sections.
  * Describe issues with epam binary (Closes: #502791).
  * Discuss how to use DBMS backends (Closes: #540915, #507144).
  * Discuss upgrading from 2.0.x series.
* Implement PID file management (Closes: #519858).
* Make logrotate process all files matching "*.log".
* Improve init script:
  * Make init script LSB-compliant.
  * Implement "live" target which allows to run ejabberd in foreground.
* Make captcha.sh use bash explicitly.
* Rework node-generation for ejabberdctl to fix ejabberd's atom table
  overflows while preserving the possibility to run several versions
  of ejabberdctl concurrently as before.
* Add webadmin patch restoring compatibility with Erlang/OTP <= R12B-4.
* Integrate upstream patch for EJAB-1106.
* Add upstream patch for EJAB-1098.
* Add upstream patch for EJAB-1045.
* Add Konstantin Khomoutov to uploaders.
* Add Japanese debconf translation (thanks to Hideki Yamane)
  (Closes: #558071).

[ Gerfried Fuchs ]
* Build-Depend on po-debconf so po2debconf can be called.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
         is_user_exists_in_other_modules/3,
50
50
         remove_user/2,
51
51
         remove_user/3,
52
 
         plain_password_required/1,
53
 
         ctl_process_get_registered/3
 
52
         plain_password_required/1
54
53
        ]).
55
54
 
56
55
-export([auth_modules/1]).
57
56
 
58
57
-include("ejabberd.hrl").
59
 
-include("ejabberd_ctl.hrl").
60
58
 
61
59
%%%----------------------------------------------------------------------
62
60
%%% API
87
85
 
88
86
%% @doc Check if the user and password can login in server.
89
87
%% @spec (User::string(), Server::string(), Password::string(),
90
 
%%        StreamID::string(), Digest::string()) ->
 
88
%%        Digest::string(), DigestGen::function()) ->
91
89
%%     true | false
92
 
check_password(User, Server, Password, StreamID, Digest) ->
 
90
check_password(User, Server, Password, Digest, DigestGen) ->
93
91
    case check_password_with_authmodule(User, Server, Password,
94
 
                                        StreamID, Digest) of
 
92
                                        Digest, DigestGen) of
95
93
        {true, _AuthModule} -> true;
96
94
        false -> false
97
95
    end.
109
107
check_password_with_authmodule(User, Server, Password) ->
110
108
    check_password_loop(auth_modules(Server), [User, Server, Password]).
111
109
 
112
 
check_password_with_authmodule(User, Server, Password, StreamID, Digest) ->
 
110
check_password_with_authmodule(User, Server, Password, Digest, DigestGen) ->
113
111
    check_password_loop(auth_modules(Server), [User, Server, Password,
114
 
                                               StreamID, Digest]).
 
112
                                               Digest, DigestGen]).
115
113
 
116
114
check_password_loop([], _Args) ->
117
115
    false;
311
309
    end,
312
310
    R.
313
311
 
314
 
ctl_process_get_registered(_Val, Host, ["registered-users"]) ->
315
 
    Users = ejabberd_auth:get_vh_registered_users(Host),
316
 
    NewLine = io_lib:format("~n", []),
317
 
    SUsers = lists:sort(Users),
318
 
    FUsers = lists:map(fun({U, _S}) -> [U, NewLine] end, SUsers),
319
 
    ?PRINT("~s", [FUsers]),
320
 
    {stop, ?STATUS_SUCCESS};
321
 
ctl_process_get_registered(Val, _Host, _Args) ->
322
 
    Val.
323
312
 
324
313
%%%----------------------------------------------------------------------
325
314
%%% Internal functions