# HG changeset patch # User Daniel Poelzleithner # Date 1286510773 -7200 # Node ID ccdf197b3f9b968afa437ea793dcddc80f07d1cd # Parent 1652c4cd3154a69a088845c543ff8781988d7dd6 add support for considering long not used accounts as broken diff -r 1652c4cd3154 -r ccdf197b3f9b app/main/index/_action/login.lua --- a/app/main/index/_action/login.lua Fri Oct 08 05:24:14 2010 +0200 +++ b/app/main/index/_action/login.lua Fri Oct 08 06:06:13 2010 +0200 @@ -2,6 +2,7 @@ if member then app.session.member = member + db:query{ "UPDATE member SET last_login = now() WHERE id = ?", member.id } app.session:save() slot.select("notice", function() ui.tag{ content = _'Login successful!' } diff -r 1652c4cd3154 -r ccdf197b3f9b app/main/member/show_tab.lua --- a/app/main/member/show_tab.lua Fri Oct 08 05:24:14 2010 +0200 +++ b/app/main/member/show_tab.lua Fri Oct 08 06:06:13 2010 +0200 @@ -45,7 +45,12 @@ local broken_delegations = Delegation:new_selector() :join("member", nil, "delegation.trustee_id = member.id") - :add_where{"member.active = 'f' AND delegation.truster_id = ?", member.id} + :add_where{"delegation.truster_id = ?", member.id} + if config.delegation_warning_time 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'"} + end if broken_delegations:count() then tabs[#tabs+1] = { diff -r 1652c4cd3154 -r ccdf197b3f9b config/default.lua --- a/config/default.lua Fri Oct 08 05:24:14 2010 +0200 +++ b/config/default.lua Fri Oct 08 06:06:13 2010 +0200 @@ -34,6 +34,9 @@ config.auto_support = true +-- after how long is a user considered inactive and the trustee will see warning +config.delegation_warning_time = '6 weeks' + config.mail_subject_prefix = "[LiquidFeedback] " config.fastpath_url_func = nil