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

« back to all changes in this revision

Viewing changes to src/ejabberd_auth_external.erl

  • Committer: Bazaar Package Importer
  • Author(s): Konstantin Khomoutov
  • Date: 2010-12-14 17:45:08 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20101214174508-6vgu3uw3ki6x8vj2
Tags: 2.1.6-1
* New upstream release.
* Remove obsolete patches.
* Update mod_admin_extra to revision 1106.
* Conflict with ejabberd-mod-shared-roster-ldap which is now included.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
    case get_cache_option(Server) of
67
67
        false -> no_cache;
68
68
        {true, _CacheTime} ->
69
 
            case get_mod_last_enabled(Server) of
 
69
            case get_mod_last_configured(Server) of
70
70
                no_mod_last ->
71
71
                    ?ERROR_MSG("In host ~p extauth is used, extauth_cache is enabled but "
72
72
                               "mod_last is not enabled.", [Server]),
295
295
 
296
296
%% @spec (Server) -> mod_last | mod_last_odbc | no_mod_last
297
297
get_mod_last_enabled(Server) ->
298
 
    ML = lists:member(mod_last, gen_mod:loaded_modules(Server)),
299
 
    MLO = lists:member(mod_last_odbc, gen_mod:loaded_modules(Server)),
300
 
    case {ML, MLO} of
301
 
        {true, _} -> mod_last;
302
 
        {false, true} -> mod_last_odbc;
303
 
        {false, false} -> no_mod_last
304
 
    end.
 
298
    ML = gen_mod:is_loaded(Server, mod_last),
 
299
    MLO = gen_mod:is_loaded(Server, mod_last_odbc),
 
300
    case {ML, MLO} of
 
301
        {true, _} -> mod_last;
 
302
        {false, true} -> mod_last_odbc;
 
303
        {false, false} -> no_mod_last
 
304
    end.
 
305
 
 
306
get_mod_last_configured(Server) ->
 
307
    ML = is_configured(Server, mod_last),
 
308
    MLO = is_configured(Server, mod_last_odbc),
 
309
    case {ML, MLO} of
 
310
        {true, _} -> mod_last;
 
311
        {false, true} -> mod_last_odbc;
 
312
        {false, false} -> no_mod_last
 
313
    end.
 
314
 
 
315
is_configured(Host, Module) ->
 
316
    lists:keymember(Module, 1, ejabberd_config:get_local_option({modules, Host})).