/priv/sites/zotonic_status/zotonic_status.erl
https://code.google.com/p/zotonic/ · Erlang · 26 lines · 17 code · 6 blank · 3 comment · 1 complexity · c0f690e5539fc18b377a77b2ff73ae5f MD5 · raw file
- -module(zotonic_status).
- -author("Marc Worrell <marc@worrell.nl>").
- -mod_title("Zotonic Status").
- -mod_descr("Default Zotonic site, used when no other site can handle the supplied Host.").
- -mod_prio(10).
- -export([
- observe_user_is_enabled/2,
- observe_acl_logon/2,
- observe_acl_logoff/2
- ]).
- -include_lib("zotonic.hrl").
- %% @doc Check if an user is enabled.
- observe_user_is_enabled({user_is_enabled, UserId}, _Context) ->
- UserId == 1.
- %% @doc Let the user log on, this is the moment to start caching information.
- observe_acl_logon({acl_logon, UserId}, Context) ->
- Context#context{user_id=UserId}.
- %% @doc Let the user log off, clean up any cached information.
- observe_acl_logoff({acl_logoff}, Context) ->
- Context#context{acl=undefined, user_id=undefined}.