webmcp

view demo-app/app/main/_filter/21_auth.lua @ 226:17baf126ea88

Fixed typo in execute._create_sorted_execution_list(...)
author jbe
date Fri Feb 27 22:31:07 2015 +0100 (2015-02-27)
parents 9fdfb27f8e67
children
line source
1 local auth_needed = not (
2 request.get_module() == 'index'
3 and (
4 request.get_view() == 'login'
5 or request.get_action() == 'login'
6 )
7 )
9 -- if not app.session.user_id then
10 -- trace.debug("DEBUG: AUTHENTICATION BYPASS ENABLED")
11 -- app.session.user_id = 1
12 -- end
14 if app.session.user == nil and auth_needed then
15 trace.debug("Not authenticated yet.")
16 request.redirect{ module = 'index', view = 'login' }
17 else
18 if auth_needed then
19 trace.debug("Authentication accepted.")
20 else
21 trace.debug("No authentication needed.")
22 end
23 execute.inner()
24 trace.debug("End of authentication filter.")
25 end

Impressum / About Us