annotate model/system_application.lua @ 1521:0d74a25bd399
Use correct cookie name from config
author |
bsw |
date |
Thu Aug 20 15:46:08 2020 +0200 (2020-08-20) |
parents |
32cc544d5a5b |
children |
|
rev |
line source |
bsw/jbe@1309
|
1 SystemApplication = mondelefant.new_class()
|
bsw/jbe@1309
|
2 SystemApplication.table = 'system_application'
|
bsw/jbe@1309
|
3
|
bsw/jbe@1309
|
4
|
bsw/jbe@1309
|
5 function SystemApplication:by_client_id(client_id)
|
bsw/jbe@1309
|
6 local system_application = self:new_selector()
|
bsw/jbe@1309
|
7 :add_where{ "client_id = ?", client_id }
|
bsw/jbe@1309
|
8 :optional_object_mode()
|
bsw/jbe@1309
|
9 :exec()
|
bsw/jbe@1309
|
10 return system_application
|
bsw/jbe@1309
|
11 end
|
bsw/jbe@1309
|
12
|
bsw/jbe@1309
|
13 function SystemApplication:by_origin(origin)
|
bsw/jbe@1309
|
14 local system_applications = self:new_selector()
|
bsw/jbe@1309
|
15 :set_distinct()
|
bsw/jbe@1309
|
16 :left_join("system_application_redirect_uri", nil, "system_application_redirect_uri.system_application_id = system_application.id")
|
bsw/jbe@1309
|
17 :add_where{ "lower(regexp_replace(system_application.default_redirect_uri, '^([^:]+://[^/]+)/.*', E'\\\\1', 'i')) = lower(?) OR lower(regexp_replace(system_application_redirect_uri.redirect_uri, '^([^:]+://[^/]+)/.*', E'\\\\1', 'i')) = lower(?)", origin, origin }
|
bsw/jbe@1309
|
18 :exec()
|
bsw/jbe@1309
|
19 return system_applications
|
bsw/jbe@1309
|
20 end
|
bsw/jbe@1309
|
21
|
bsw/jbe@1309
|
22 function SystemApplication:get_all()
|
bsw/jbe@1309
|
23 local system_application = self:new_selector()
|
bsw/jbe@1309
|
24 :exec()
|
bsw/jbe@1309
|
25 return system_application
|
bsw/jbe@1309
|
26 end
|
bsw/jbe@1309
|
27
|
bsw/jbe@1309
|
28
|