liquid_feedback_frontend
view app/main/member/_action/update_api_key.lua @ 1051:53b0139ed930
Include "lf_update_issue_order" command in installation instructions
| author | jbe | 
|---|---|
| date | Mon Jul 14 21:01:18 2014 +0200 (2014-07-14) | 
| parents | 67c1695dc94d | 
| children | 
 line source
     2 local api_key
     4 if param.get_id() and param.get("delete", atom.boolean) then
     6   local member_application = MemberApplication:by_id(param.get_id())
     8   if member_application then
     9     member_application:destroy()
    10   end
    12   slot.put_into("notice", _"API key has been deleted")
    13 else
    15   local member_application = MemberApplication:new()
    16   member_application.member_id = app.session.member_id
    17   member_application.key = multirand.string(
    18     20,
    19     '23456789BCDFGHJKLMNPQRSTVWXYZbcdfghjkmnpqrstvwxyz'
    20   )
    21   member_application.name = 'member'
    22   member_application.comment = ''
    23   member_application.access_level = 'member'
    25   member_application:save()
    26   slot.put_into("notice", _"API key has been created")
    27 end
