liquid_feedback_frontend

diff app/main/draft/_action/add.lua @ 904:a176129ce282

Add support for poll mode; Forbid postings unless contingents are configured
author bsw
date Sun Aug 26 22:37:49 2012 +0200 (2012-08-26)
parents cda574707b1c
children 1997cf1da04b
line diff
     1.1 --- a/app/main/draft/_action/add.lua	Tue Aug 21 01:29:28 2012 +0200
     1.2 +++ b/app/main/draft/_action/add.lua	Sun Aug 26 22:37:49 2012 +0200
     1.3 @@ -1,9 +1,3 @@
     1.4 -local tmp = db:query({ "SELECT text_entries_left FROM member_contingent_left WHERE member_id = ?", app.session.member.id }, "opt_object")
     1.5 -if tmp and tmp.text_entries_left and tmp.text_entries_left < 1 then
     1.6 -  slot.put_into("error", _"Sorry, you have reached your personal flood limit. Please be slower...")
     1.7 -  return false
     1.8 -end
     1.9 -
    1.10  local initiative = Initiative:by_id(param.get("initiative_id", atom.integer))
    1.11  
    1.12  -- TODO important m1 selectors returning result _SET_!
    1.13 @@ -22,6 +16,12 @@
    1.14    error("access denied")
    1.15  end
    1.16  
    1.17 +local tmp = db:query({ "SELECT text_entries_left FROM member_contingent_left WHERE member_id = ? AND polling = ?", app.session.member.id, initiative.polling }, "opt_object")
    1.18 +if not tmp or tmp.text_entries_left < 1 then
    1.19 +  slot.put_into("error", _"Sorry, you have reached your personal flood limit. Please be slower...")
    1.20 +  return false
    1.21 +end
    1.22 +
    1.23  local formatting_engine = param.get("formatting_engine")
    1.24  
    1.25  local formatting_engine_valid = false

Impressum / About Us