liquid_feedback_frontend

changeset 174:f62c61bd912c

Made saving of last_login configurable
author bsw
date Sun Oct 31 00:35:11 2010 +0200 (2010-10-31)
parents ca006681befc
children 46b42e3eb290
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	Sun Oct 31 00:22:39 2010 +0200
     1.2 +++ b/app/main/index/_action/login.lua	Sun Oct 31 00:35:11 2010 +0200
     1.3 @@ -2,7 +2,9 @@
     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 +  if config.last_login_enabled then
     1.9 +    db:query{ "UPDATE member SET last_login = now() WHERE id = ?", member.id }
    1.10 +  end
    1.11    app.session:save()
    1.12    slot.select("notice", function()
    1.13      ui.tag{ content = _'Login successful!' }
     2.1 --- a/app/main/member/show_tab.lua	Sun Oct 31 00:22:39 2010 +0200
     2.2 +++ b/app/main/member/show_tab.lua	Sun Oct 31 00:35:11 2010 +0200
     2.3 @@ -46,7 +46,7 @@
     2.4    local broken_delegations = Delegation:new_selector()
     2.5      :join("member", nil, "delegation.trustee_id = member.id")
     2.6      :add_where{"delegation.truster_id = ?", member.id}
     2.7 -    if config.delegation_warning_time then
     2.8 +    if config.delegation_warning_time and config.last_login_enabled then
     2.9        broken_delegations:add_where{"member.active = 'f' OR (member.last_login IS NULL OR age(member.last_login) > ?::interval)", config.delegation_warning_time}
    2.10      else
    2.11        broken_delegations:add_where{"member.active = 'f'"}
     3.1 --- a/config/default.lua	Sun Oct 31 00:22:39 2010 +0200
     3.2 +++ b/config/default.lua	Sun Oct 31 00:35:11 2010 +0200
     3.3 @@ -36,7 +36,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 +-- after how long is a user considered inactive and the trustee will see warning\
     3.9 +-- will not work unless config.last_login_enabled is set to true
    3.10 +-- notation is according to postgresql intervals, nil turns off feature
    3.11  config.delegation_warning_time = '6 weeks'
    3.12  
    3.13  config.mail_subject_prefix = "[LiquidFeedback] "
    3.14 @@ -53,6 +55,9 @@
    3.15  
    3.16  config.feature_rss_enabled = false -- feature is broken
    3.17  
    3.18 +-- Saving last login of user in database
    3.19 +config.last_login_enabled = true
    3.20 +
    3.21  -- OpenID authentication is not fully implemented yet, DO NOT USE BEFORE THIS NOTICE HAS BEEN REMOVED!
    3.22  config.auth_openid_enabled = false
    3.23  config.auth_openid_https_as_default = true

Impressum / About Us