liquid_feedback_frontend

view app/main/index/login.lua @ 1858:3d1f0464a3ea

Handle missing ldap.member.allowed function
author bsw
date Tue Sep 20 17:35:29 2022 +0200 (20 months ago)
parents 7d60ede7005e
children
line source
1 ui.tag{
2 tag = "noscript",
3 content = function()
4 slot.put(_"JavaScript is disabled or not available.")
5 end
6 }
8 ui.title(_"Login [headline]")
9 app.html_title.title = _"Login [headline]"
11 ui.container{ attr = { class = "mdl-grid" }, content = function()
12 ui.container{ attr = { class = "mdl-cell mdl-cell--12-col" }, content = function()
13 execute.view{ module = "index", view = "_sidebar_motd_public" }
15 execute.view{ module = "index", view = "_lang_chooser" }
17 ui.heading{ level = 1, content = _"Login [headline]" }
19 local redirect_params = {}
20 local redirect_params_string = param.get("redirect_params")
22 if redirect_params_string then
23 local tmp = json.import(redirect_params_string)
24 if type(tmp) == "table" then
25 for k, v in pairs(tmp) do
26 if type(v) == "string" then
27 redirect_params[k] = v
28 end
29 end
30 end
31 end
33 ui.form{
34 module = 'index',
35 action = 'login',
36 routing = {
37 ok = {
38 mode = 'redirect',
39 module = param.get("redirect_module") or "index",
40 view = param.get("redirect_view") or "index",
41 id = param.get("redirect_id"),
42 params = redirect_params
43 },
44 error = {
45 mode = 'redirect',
46 module = "index",
47 view = "login",
48 params = {
49 redirect_module = param.get("redirect_module"),
50 redirect_view = param.get("redirect_view"),
51 redirect_id = param.get("redirect_id"),
52 redirect_params = param.get("redirect_params")
53 }
54 }
55 },
56 content = function()
57 if slot.get_content("error_code") == "invalid_credentials" then
58 ui.container{ attr = { class = "warning" }, content = _"Invalid login name or password!" }
59 end
60 ui.field.text{
61 container_attr = { class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label" },
62 attr = { id = "lf-login__username", class = "mdl-textfield__input" },
63 label_attr = { class = "mdl-textfield__label", ["for"] = "lf-login__username" },
64 label = _'Login name',
65 name = 'login',
66 value = ''
67 }
68 slot.put("<br />")
69 ui.field.password{
70 container_attr = { class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label" },
71 attr = { id = "lf-login__password", class = "mdl-textfield__input" },
72 label_attr = { class = "mdl-textfield__label", ["for"] = "lf-login__password" },
73 label = _'Password',
74 name = 'password',
75 value = ''
76 }
77 slot.put("<br /><br />")
78 ui.tag{
79 tag = "input",
80 attr = {
81 type = "submit",
82 class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored",
83 value = _"Login [button]"
84 }
85 }
86 slot.put(" &nbsp; ")
87 ui.link{
88 attr = { class = "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect" },
89 module = "index", view = "index", text = _"Cancel"
90 }
91 if not config.disable_registration then
92 slot.put(" &nbsp; ")
93 ui.link{
94 attr = { class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined" },
95 module = "index", view = "register", text = _"No account yet?", params = {
96 redirect_module = param.get("redirect_module"),
97 redirect_view = param.get("redirect_view"),
98 redirect_id = param.get("redirect_id"),
99 redirect_params = param.get("redirect_params")
100 }
101 }
102 end
103 if config.self_registration then
104 slot.put(" &nbsp; ")
105 ui.link{
106 attr = { class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined" },
107 module = "registration", view = "register", text = _"No account yet?", params = {
108 redirect_module = param.get("redirect_module"),
109 redirect_view = param.get("redirect_view"),
110 redirect_id = param.get("redirect_id"),
111 redirect_params = param.get("redirect_params")
112 }
113 }
114 end
115 if not (config.hide_reset_password and config.hide_recover_login) then
116 slot.put("<br /><br />")
117 end
118 if not config.hide_reset_password then
119 ui.link{
120 attr = { class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined" },
121 module = "index", view = "reset_password", text = _"Forgot password?", params = {
122 redirect_module = param.get("redirect_module"),
123 redirect_view = param.get("redirect_view"),
124 redirect_id = param.get("redirect_id"),
125 redirect_params = param.get("redirect_params")
126 }
127 }
128 slot.put(" &nbsp; ")
129 end
130 if not config.hide_recover_login then
131 ui.link{
132 attr = { class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined" },
133 module = "index", view = "send_login", text = _"Forgot login name?", params = {
134 redirect_module = param.get("redirect_module"),
135 redirect_view = param.get("redirect_view"),
136 redirect_id = param.get("redirect_id"),
137 redirect_params = param.get("redirect_params")
138 }
139 }
140 end
141 end
142 }
143 end }
144 end }

Impressum / About Us