Software /
code /
prosody-modules
Comparison
mod_invites_webgen/mod_invites_webgen.lua @ 5944:d073ada49a86
mod_invites_webgen: fix variable name for http path
author | Trần H. Trung <xmpp:trần.h.trung@trung.fun> |
---|---|
date | Wed, 26 Feb 2025 18:47:07 +0700 |
parent | 5943:05125c29fd67 |
comparison
equal
deleted
inserted
replaced
5943:05125c29fd67 | 5944:d073ada49a86 |
---|---|
45 local username, password = form_data["username"], form_data["password"]; | 45 local username, password = form_data["username"], form_data["password"]; |
46 | 46 |
47 event.response.headers["Content-Type"] = "text/html; charset=utf-8"; | 47 event.response.headers["Content-Type"] = "text/html; charset=utf-8"; |
48 | 48 |
49 local webgen_template = template_get("webgen", lang); | 49 local webgen_template = template_get("webgen", lang); |
50 local htmlPath = module:http_url("webgen", "/webgen"); | 50 local http_path = module:http_url("webgen", "/webgen"); |
51 | 51 |
52 if not username or #username == 0 or not password or #password == 0 then | 52 if not username or #username == 0 or not password or #password == 0 then |
53 return render_html_template(webgen_template, { | 53 return render_html_template(webgen_template, { |
54 site_name = site_name; | 54 site_name = site_name; |
55 path = htmlPath; | 55 path = http_path; |
56 msg_class = "alert-warning"; | 56 msg_class = "alert-warning"; |
57 message = "Please fill in all fields."; | 57 message = "Please fill in all fields."; |
58 }); | 58 }); |
59 end | 59 end |
60 | 60 |
68 if exists and pass and allow_user and allow_contact then | 68 if exists and pass and allow_user and allow_contact then |
69 invite = invites.create_contact(username, true, { source = "webgen" }); | 69 invite = invites.create_contact(username, true, { source = "webgen" }); |
70 else | 70 else |
71 return render_html_template(webgen_template, { | 71 return render_html_template(webgen_template, { |
72 site_name = site_name; | 72 site_name = site_name; |
73 path = htmlPath; | 73 path = http_path; |
74 username = username; | 74 username = username; |
75 msg_class = "alert-warning"; | 75 msg_class = "alert-warning"; |
76 message = "Invalid input!"; | 76 message = "Invalid input!"; |
77 }); | 77 }); |
78 end | 78 end |