ikibooru/login.html.l

45 lines
1.6 KiB
Plaintext
Raw Normal View History

2024-06-01 17:40:11 +03:00
{%
local em = request.querystring.z and Escapes.urlspunescape(request.querystring.z)
local u
local worked = false
local zzz
if em and not verified then
worked = true
u = DB.getuserbyemail(em)
if u and u.privs ~= DB.USER_PRIVS_BANNED then
-- Signing in
zzz = SMTPAuth.sendauthinfo(u)
elseif not u and (BigGlobe.cfg.membexcl == BigGlobe.MEMBEXCL_PUBLIC_WITHAPPROVAL or BigGlobe.cfg.membexcl == BigGlobe.MEMBEXCL_PUBLIC_NOAPPROVAL) then
-- Public registration
zzz = SMTPAuth.sendregisterinfo(em)
else
worked = false
end
if worked and BigGlobe.cfg.anarchy == "ANARCHY" then
response:addHeader("Refresh", "3;url=" .. zzz)
response:statusCode(303)
end
end
title = BigGlobe.cfg.sitename .. " - Sign-in sent"
%}
{% function content() %}
{% if BigGlobe.cfg.anarchy == "ANARCHY" then %}
<p>In anarchy mode, anyone can be anything. Please wait..</p>
<p>If that doesn't work, <a href="{{ Escapes.htmlescape(zzz) }}">click here</a>.</p>
{% else %}
{% if worked then %}
<p>Link has been sent to {{ em and Escapes.htmlescape(em) }}. This page may be closed.</p>
{% else %}
<p>You are not authorized to register this account. {% if u and u.privs == DB.USER_PRIVS_BANNED then %}You have been banned.{% elseif BigGlobe.cfg.membexcl == BigGlobe.MEMBEXCL_MEMBERS_INVITE then %}This website is invite-only.{% elseif BigGlobe.cfg.membexcl == BigGlobe.MEMBEXCL_MODS_INVITE then %}Only moderators may invite.{% elseif BigGlobe.cfg.membexcl == BigGlobe.MEMBEXCL_ADMIN_INVITES then %}Only administrators may invite.{% end %}</p>
{% end %}
{% end %}
{% end %}
{# base.inc