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

« back to all changes in this revision

Viewing changes to src/ejabberd_auth_odbc.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:
51
51
%%%----------------------------------------------------------------------
52
52
%%% API
53
53
%%%----------------------------------------------------------------------
54
 
start(Host) ->
55
 
    ejabberd_ctl:register_commands(
56
 
      Host,
57
 
      [{"registered-users", "list all registered users"}],
58
 
      ejabberd_auth, ctl_process_get_registered),
 
54
start(_Host) ->
59
55
    ok.
60
56
 
61
57
plain_password_required() ->
71
67
            LServer = jlib:nameprep(Server),
72
68
            try odbc_queries:get_password(LServer, Username) of
73
69
                {selected, ["password"], [{Password}]} ->
74
 
                    true; %% Password is correct
 
70
                    Password /= ""; %% Password is correct, and not empty
75
71
                {selected, ["password"], [{_Password2}]} ->
76
72
                    false; %% Password is not correct
77
73
                {selected, ["password"], []} ->
84
80
            end
85
81
    end.
86
82
 
87
 
%% @spec (User, Server, Password, StreamID, Digest) -> true | false | {error, Error}
88
 
check_password(User, Server, Password, StreamID, Digest) ->
 
83
%% @spec (User, Server, Password, Digest, DigestGen) -> true | false | {error, Error}
 
84
check_password(User, Server, Password, Digest, DigestGen) ->
89
85
    case jlib:nodeprep(User) of
90
86
        error ->
91
87
            false;
97
93
                {selected, ["password"], [{Passwd}]} ->
98
94
                    DigRes = if
99
95
                                 Digest /= "" ->
100
 
                                     Digest == sha:sha(StreamID ++ Passwd);
 
96
                                     Digest == DigestGen(Passwd);
101
97
                                 true ->
102
98
                                     false
103
99
                             end,