liquid_feedback_frontend

changeset 152:ccdf197b3f9b

add support for considering long not used accounts as broken
author Daniel Poelzleithner <poelzi@poelzi.org>
date Fri Oct 08 06:06:13 2010 +0200 (2010-10-08)
parents 1652c4cd3154
children 17c3a3e36356
files app/main/index/_action/login.lua app/main/member/show_tab.lua config/default.lua
line diff
     1.1 --- a/app/main/index/_action/login.lua	Fri Oct 08 05:24:14 2010 +0200
     1.2 +++ b/app/main/index/_action/login.lua	Fri Oct 08 06:06:13 2010 +0200
     1.3 @@ -2,6 +2,7 @@
     1.4  
     1.5  if member then
     1.6    app.session.member = member
     1.7 +  db:query{ "UPDATE member SET last_login = now() WHERE id = ?", member.id }
     1.8    app.session:save()
     1.9    slot.select("notice", function()
    1.10      ui.tag{ content = _'Login successful!' }
     2.1 --- a/app/main/member/show_tab.lua	Fri Oct 08 05:24:14 2010 +0200
     2.2 +++ b/app/main/member/show_tab.lua	Fri Oct 08 06:06:13 2010 +0200
     2.3 @@ -45,7 +45,12 @@
     2.4  
     2.5    local broken_delegations = Delegation:new_selector()
     2.6      :join("member", nil, "delegation.trustee_id = member.id")
     2.7 -    :add_where{"member.active = 'f' AND delegation.truster_id = ?", member.id}
     2.8 +    :add_where{"delegation.truster_id = ?", member.id}
     2.9 +    if config.delegation_warning_time then
    2.10 +      broken_delegations:add_where{"member.active = 'f' OR (member.last_login IS NULL OR age(member.last_login) > ?::interval)", config.delegation_warning_time}
    2.11 +    else
    2.12 +      broken_delegations:add_where{"member.active = 'f'"}
    2.13 +    end
    2.14  
    2.15    if broken_delegations:count() then
    2.16      tabs[#tabs+1] = {
     3.1 --- a/config/default.lua	Fri Oct 08 05:24:14 2010 +0200
     3.2 +++ b/config/default.lua	Fri Oct 08 06:06:13 2010 +0200
     3.3 @@ -34,6 +34,9 @@
     3.4  
     3.5  config.auto_support = true
     3.6  
     3.7 +-- after how long is a user considered inactive and the trustee will see warning
     3.8 +config.delegation_warning_time = '6 weeks'
     3.9 +
    3.10  config.mail_subject_prefix = "[LiquidFeedback] "
    3.11  
    3.12  config.fastpath_url_func = nil

Impressum / About Us