liquid_feedback_frontend

diff app/main/member/_action/update_agent.lua @ 1309:32cc544d5a5b

Cumulative patch for upcoming frontend version 4
author bsw/jbe
date Sun Jul 15 14:07:29 2018 +0200 (2018-07-15)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/member/_action/update_agent.lua	Sun Jul 15 14:07:29 2018 +0200
     1.3 @@ -0,0 +1,29 @@
     1.4 +if not config.role_registration then
     1.5 +  return
     1.6 +end
     1.7 +if not app.session.member.role then
     1.8 +  return
     1.9 +end
    1.10 +
    1.11 +local controller_id = param.get("controller_id")
    1.12 +
    1.13 +local member = Member:by_id(controller_id)
    1.14 +
    1.15 +if member.role then
    1.16 +  return
    1.17 +end
    1.18 +
    1.19 +local agent = Agent:by_pk(app.session.member_id, controller_id)
    1.20 +
    1.21 +if param.get("delete") then
    1.22 +  agent:destroy()
    1.23 +  return
    1.24 +end
    1.25 +
    1.26 +if not agent then
    1.27 +  agent = Agent:new()
    1.28 +  agent.controlled_id = app.session.member_id
    1.29 +  agent.controller_id = controller_id
    1.30 +  agent:save()
    1.31 +end
    1.32 +

Impressum / About Us