Module z_auth

Handle authentication of zotonic users.

Copyright 2009 Marc Worrell Date: 2009-04-24

Authors: Marc Worrell (marc@worrell.nl).

Description

Handle authentication of zotonic users. Also shows the logon screen when authentication is required.

Function Index

confirm/2
is_auth/1Check if the visitor has been authenticated.
is_auth_recent/1
is_enabled/2Check if the user is enabled, an user is enabled when the rsc is published and within its publication date range.
logoff/1Forget about the user being logged on.
logon/2Logon an user whose id we know.
logon_from_session/1Called after z_context:ensure_session.
logon_pw/3Logon a username/password combination, checks passwords with m_identity.
switch_user/2Continue the current session as a different user.
user_from_page/1Return the user_id from a page.
user_from_session/1Return the user_id from the session.

Function Details

confirm/2

confirm(UserId, Context) -> any()

is_auth/1

is_auth(Context::#context{}) -> bool()

Check if the visitor has been authenticated. Assumes a completely initalized context.

is_auth_recent/1

is_auth_recent(Context) -> any()

is_enabled/2

is_enabled(UserId, Context) -> any()

Check if the user is enabled, an user is enabled when the rsc is published and within its publication date range.

logoff/1

logoff(Context) -> NewContext

Forget about the user being logged on.

logon/2

logon(UserId, Context) -> any()

Logon an user whose id we know

logon_from_session/1

logon_from_session(Context::#context{}) -> #context{}

Called after z_context:ensure_session. Check if the session contains an authenticated user id. When found then the user_id of the context is set. Also checks any automatic logon methods like "remember me" cookies.

logon_pw/3

logon_pw(Username, Password, Context) -> {bool(), NewContext}

Logon a username/password combination, checks passwords with m_identity.

switch_user/2

switch_user(UserId, Context) -> any()

Continue the current session as a different user.

user_from_page/1

user_from_page(PagePid) -> any()

Return the user_id from a page

user_from_session/1

user_from_session(SessionPid) -> any()

Return the user_id from the session


Generated by EDoc, Jul 29 2014, 17:16:27.