liquid_feedback_frontend
view app/main/member/_action/update_api_key.lua @ 1186:f01239f154a8
Added tag v3.0.6 for changeset fef745f9e22f
author | jbe |
---|---|
date | Thu Mar 26 21:31:10 2015 +0100 (2015-03-26) |
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