/modules/mod_base/actions/action_base_logoff.erl

http://github.com/zotonic/zotonic · Erlang · 28 lines · 8 code · 4 blank · 16 comment · 0 complexity · 24356d23a63aff09a82f6808a2067ce1 MD5 · raw file

  1. %% @author Marc Worrell <marc@worrell.nl>
  2. %% @copyright 2009 Marc Worrell
  3. %% @doc Logoff the current user
  4. %% Copyright 2009 Marc Worrell
  5. %%
  6. %% Licensed under the Apache License, Version 2.0 (the "License");
  7. %% you may not use this file except in compliance with the License.
  8. %% You may obtain a copy of the License at
  9. %%
  10. %% http://www.apache.org/licenses/LICENSE-2.0
  11. %%
  12. %% Unless required by applicable law or agreed to in writing, software
  13. %% distributed under the License is distributed on an "AS IS" BASIS,
  14. %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. %% See the License for the specific language governing permissions and
  16. %% limitations under the License.
  17. -module(action_base_logoff).
  18. -include("zotonic.hrl").
  19. -export([render_action/4, event/2]).
  20. render_action(TriggerId, TargetId, _Args, Context) ->
  21. {PostbackMsgJS, _PickledPostback} = z_render:make_postback(logoff, undefined, TriggerId, TargetId, ?MODULE, Context),
  22. {[PostbackMsgJS], Context}.
  23. event(#postback{message=logoff}, Context) ->
  24. z_render:wire({redirect, [{dispatch, logoff}]}, Context).