# HG changeset patch # User bsw # Date 1288478111 -7200 # Node ID f62c61bd912c3ab4c641f441d5c9c31cef6d8395 # Parent ca006681befcf2a8ba15040fa427b7c3745ded44 Made saving of last_login configurable diff -r ca006681befc -r f62c61bd912c app/main/index/_action/login.lua --- a/app/main/index/_action/login.lua Sun Oct 31 00:22:39 2010 +0200 +++ b/app/main/index/_action/login.lua Sun Oct 31 00:35:11 2010 +0200 @@ -2,7 +2,9 @@ if member then app.session.member = member - db:query{ "UPDATE member SET last_login = now() WHERE id = ?", member.id } + if config.last_login_enabled then + db:query{ "UPDATE member SET last_login = now() WHERE id = ?", member.id } + end app.session:save() slot.select("notice", function() ui.tag{ content = _'Login successful!' } diff -r ca006681befc -r f62c61bd912c app/main/member/show_tab.lua --- a/app/main/member/show_tab.lua Sun Oct 31 00:22:39 2010 +0200 +++ b/app/main/member/show_tab.lua Sun Oct 31 00:35:11 2010 +0200 @@ -46,7 +46,7 @@ local broken_delegations = Delegation:new_selector() :join("member", nil, "delegation.trustee_id = member.id") :add_where{"delegation.truster_id = ?", member.id} - if config.delegation_warning_time then + if config.delegation_warning_time and config.last_login_enabled then broken_delegations:add_where{"member.active = 'f' OR (member.last_login IS NULL OR age(member.last_login) > ?::interval)", config.delegation_warning_time} else broken_delegations:add_where{"member.active = 'f'"} diff -r ca006681befc -r f62c61bd912c config/default.lua --- a/config/default.lua Sun Oct 31 00:22:39 2010 +0200 +++ b/config/default.lua Sun Oct 31 00:35:11 2010 +0200 @@ -36,7 +36,9 @@ config.auto_support = true --- after how long is a user considered inactive and the trustee will see warning +-- after how long is a user considered inactive and the trustee will see warning\ +-- will not work unless config.last_login_enabled is set to true +-- notation is according to postgresql intervals, nil turns off feature config.delegation_warning_time = '6 weeks' config.mail_subject_prefix = "[LiquidFeedback] " @@ -53,6 +55,9 @@ config.feature_rss_enabled = false -- feature is broken +-- Saving last login of user in database +config.last_login_enabled = true + -- OpenID authentication is not fully implemented yet, DO NOT USE BEFORE THIS NOTICE HAS BEEN REMOVED! config.auth_openid_enabled = false config.auth_openid_https_as_default = true