liquid_feedback_frontend

diff app/main/member/history.lua @ 9:0ee1e0c42d4c

Version beta5

Minor security fix: Added missing security filter for admin section. Reading of member listing including login names was possible for all users. Write access has not been possible though.

Changing of name and login is possible while a history of these changes is written and accessible by all users.

Statistics shown in area list

Trimming of user input also converts multiple whitespaces to single space character.
author bsw
date Mon Jan 04 12:00:00 2010 +0100 (2010-01-04)
parents
children aaba4d28dd53
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/member/history.lua	Mon Jan 04 12:00:00 2010 +0100
     1.3 @@ -0,0 +1,78 @@
     1.4 +local member = Member:by_id(param.get_id())
     1.5 +
     1.6 +slot.put_into("title", _("Member name history for '#{name}'", { name = member.name }))
     1.7 +
     1.8 +slot.select("actions", function()
     1.9 +  ui.link{
    1.10 +    content = function()
    1.11 +        ui.image{ static = "icons/16/cancel.png" }
    1.12 +        slot.put(_"Back")
    1.13 +    end,
    1.14 +    module = "member",
    1.15 +    view = "show",
    1.16 +    id = member.id
    1.17 +  }
    1.18 +end)
    1.19 +
    1.20 +local entries = member:get_reference_selector("history_entries"):add_order_by("id DESC"):exec()
    1.21 +
    1.22 +ui.tag{
    1.23 +  tag = "table",
    1.24 +  content = function()
    1.25 +    ui.tag{
    1.26 +      tag = "tr",
    1.27 +      content = function()
    1.28 +        ui.tag{
    1.29 +          tag = "th",
    1.30 +          content = _("Name")
    1.31 +        }
    1.32 +        ui.tag{
    1.33 +          tag = "th",
    1.34 +          content = _("Used until")
    1.35 +        }
    1.36 +      end
    1.37 +    }
    1.38 +    ui.tag{
    1.39 +      tag = "tr",
    1.40 +      content = function()
    1.41 +        ui.tag{
    1.42 +          tag = "td",
    1.43 +          content = member.name
    1.44 +        }
    1.45 +        ui.tag{
    1.46 +          tag = "td",
    1.47 +          content = _"continuing"
    1.48 +        }
    1.49 +      end
    1.50 +    }
    1.51 +    for i, entry in ipairs(entries) do
    1.52 +      local display = false
    1.53 +      if (i == 1) then
    1.54 +        if entry.name ~= member.name then
    1.55 +          display = true
    1.56 +        end
    1.57 +      elseif entry.name ~= entries[i-1].name then
    1.58 +        display = true
    1.59 +      end
    1.60 +      if display then
    1.61 +        ui.tag{
    1.62 +          tag = "tr",
    1.63 +          content = function()
    1.64 +            ui.tag{
    1.65 +              tag = "td",
    1.66 +              content = entry.name
    1.67 +            }
    1.68 +            ui.tag{
    1.69 +              tag = "td",
    1.70 +              content = format.timestamp(entry["until"])
    1.71 +            }
    1.72 +          end
    1.73 +        }
    1.74 +      end
    1.75 +    end
    1.76 +  end
    1.77 +}
    1.78 +slot.put("<br />")
    1.79 +ui.container{
    1.80 +  content = _("This member account has been created at #{created}", { created = format.timestamp(member.created)})
    1.81 +}

Impressum / About Us