MarseyWorld/files/templates/settings/security.html

270 lines
13 KiB
HTML
Raw Normal View History

2022-05-04 23:09:46 +00:00
{% extends "settings.html" %}
[DO NOT MERGE] titlesssssssssss (#468) * titles * testing * self * Revert "self" This reverts commit d6c12d5a5ba125feb44673f55e1fdac75f151cb5. * Revert "testing" This reverts commit 86d800f9fd552196b31f0e0b3891d4fc072a9bc0. * testing on devrama * rewrite the html head * reference error or smth idk * tempalte debug * template debug redux * default2 * rename default2 -> root, page title * fix settings2 * include the set_variables block * root scope variables 2 * test 3 * remove unnecessary set * add pagetitles to all settings2 pages * add pagetitle to casino * remove bloat * remove duplicate site name thingy * page titles 2 * page titles 3 * remove duplicate imports and add page titles everywhere iirc * ok but actually this time * remove unnecessary newlines * fix title lol * > * fsdfsfsfsfsfs * fsfs * template configurations * fix 500 * reduce login template bloat * move files and add status codes where needful * move authfroms to login * remove 2fa bloat * verification code * sign up fixes * readability * fssfsfsfs * move forgot password to login/ * readability * don't emit comments * add page titles where needful * gsgsgs * modals: move to respective pages * testing on devrama * get home garbage out of title * remove insane amount of icon duplication * sign up text * add votes pagetitle * fix blank lines * Revert "fix blank lines" This reverts commit b2c54339970725d00b6fc82bb458c1757909952c. * Fix blank lines on sign_up.html. * title: votes.html more meaningful identifier. * titles: Lottery, Directory, Notifications * head final in submission.html * fix missing comma * > * test * title: /comments * fsfsfsfsf * titles: user_cards * head: only load video and audio meta attributes if they actually exist * titlessssss: /admin/lottery/participants * titlessssssss: extra quote in search.html * titlessssss: userpage voters. * titties: /h/<sub>/{followers,blockers,exilees[sic]} * test banner * Revert "test banner" This reverts commit c3d875d03f3e60d72a60dab7d28bf108554a5826. * make submit.html inherit from default.html Co-authored-by: TLSM <duolsm@outlook.com>
2022-11-21 08:52:22 +00:00
{% block pagetitle %}Security Settings{% endblock %}
2022-05-04 23:09:46 +00:00
{% block content %}
<script defer src="{{'js/settings_security.js' | asset}}"></script>
2022-11-06 06:35:49 +00:00
<div class="row settings-page" id="settings-page-security">
2022-05-04 23:09:46 +00:00
<div class="col col-lg-8">
<div class="settings">
2022-11-06 06:35:49 +00:00
<section id="site-settings-email-section" class="settings-section-section">
<h5>Email</h5>
<div class="settings-section rounded">
<form action="/settings/security" method="post">
[DO NOT MERGE] import detanglation (#442) * move Base definition to files.classes.__init__.py * fix ImportError * move userpage listing to users.py * don't import the app from classes * consts: set default values to avoid crashes consts: warn if the secret key is the default config value * card view: sneed (user db schema) * cloudflare: use DEFAULT_CONFIG_VALUE * const: set default values * decouple media.py from __main__ * pass database to avoid imports * import cleanup and import request not in const, but in the requests mega import * move asset_submissions site check to __init__ * asset submissions feature flag * flag * g.is_tor * don't import request where it's not needed * i think this is fine * mail: move to own routes and helper * wrappers * required wrappers move * unfuck wrappers a bit * move snappy quotes and marseys to stateful consts * marsify * :pepodrool: * fix missing import * import cache * ...and settings.py * and static.py * static needs cache * route * lmao all of the jinja shit was in feeds.py amazing * classes should only import what they need from flask * import Response * hdjbjdhbhjf * ... * dfdfdfdf * make get a non-required import * isort imports (mostly) * but actually * configs * reload config on import * fgfgfgfg * config * config * initialize snappy and test * cookie of doom debug * edfjnkf * xikscdfd * debug config * set session cookie domain, i think this fixes the can't login bug * sdfbgnhvfdsghbnjfbdvvfghnn * hrsfxgf * dump the entire config on a request * kyskyskyskyskyskyskyskyskys * duifhdskfjdfd * dfdfdfdfdfdfdfdfdfdfdfdf * dfdfdfdf * imoprt all of the consts beacuse fuck it * 😭 * dfdfdfdfdfdfsdasdf * print the entire session * rffdfdfjkfksj * fgbhffh * not the secret keys * minor bug fixes * be helpful in the warning * gfgfgfg * move warning lower * isort main imports (i hope this doesn't fuck something up) * test * session cookie domain redux * dfdfdfd * try only importing Flask * formkeys fix * y * :pepodrool: * route helper * remove before flight * dfdfdfdfdf * isort classes * isort helpers * move check_for_alts to routehelpers and also sort imports and get rid of unused ones * that previous commit but actkally * readd the cache in a dozen places they were implicitly imported * use g.is_tor instead of request.headers. bla bla bla * upgrade streamers to their own route file * get rid of unused imports in __main__ * fgfgf * don't pull in the entire ORM where we don't need it * features * explicit imports for the get helper * explicit imports for the get helper redux * testing allroutes * remove unused import * decouple flask from classes * syntax fix also remember these have side fx for some reason (why?) * move side effects out of the class * posts * testing on devrama * settings * reloading * settingssdsdsds * streamer features * site settings * testing settings on devrama * import * fix modlog * remove debug stuff * revert commit 67275b21ab6e2f2520819e84d10bfc1c746a15b6 * archiveorg to _archiveorg * skhudkfkjfd * fix cron for PCM * fix bugs that snekky wants me to * Fix call to realbody passing db, standardize kwarg * test * import check_for_alts from the right place * cloudflare * testing on devrama * fix cron i think * shadow properly * tasks * Remove print which will surely be annoying in prod. * v and create new session * use files.classes * make errors import little and fix rare 500 in /allow_nsfw * Revert "use files.classes" This reverts commit 98c10b876cf86ce058b7fb955cf1ec0bfb9996c6. * pass v to media functions rather than using g * fix * dfdfdfdfd * cleanup, py type checking is dumb so don't use it where it causes issues * Fix some merge bugs, add DEFAULT_RATELIMIT to main. * Fix imports on sqlalchemy expressions. * `from random import random` is an error. * Fix replies db param. * errors: fix missing import * fix rare 500: only send to GIFT_NOTIF_ID if it exists, and send them the right text * Fix signup formkey. * fix 2 500s * propagate db to submissions * fix replies * dfdfdfdf * Fix verifiedcolor. * is_manual * can't use getters outside of an app context * don't attempt to do gumroad on sites where it's not enabled * don't attempt to do gumraod on sites's where it's unnecessary * Revert "don't attempt to do gumroad on sites where it's not enabled" This reverts commit 6f8a6331878655492dfaf1907b27f8be513c14d3. * fix 500 * validate media type Co-authored-by: TLSM <duolsm@outlook.com>
2022-11-15 09:19:08 +00:00
<input type="hidden" name="formkey" value="{{v|formkey}}">
2022-11-06 06:35:49 +00:00
<input type="hidden" name="now" value="{{now}}">
<div class="body">
<div class="d-lg-flex">
<label for="new-email" class="w-lg-25">Email</label>
<div class="w-lg-100">
<input autocomplete="off" class="form-control" id="new_email" {% if v.email %}placeholder="{{v.email}}"{% else %}placeholder="Your email"{% endif %}
aria-describedby="new_email" type="email" pattern='{{EMAIL_REGEX_PATTERN}}' name="new_email" required>
{% if v.email and not v.is_activated %}
2022-12-30 12:14:18 +00:00
<div class="text-danger text-small mt-1" id="email-verify-text">Email not verified. You will not be able to recover your account with this email until you verify it. <u><button type="button" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/verify_email');emailVerifyText()"class="text-primary font-weight-bold ml-1">Verify now.</button></u></div>
2022-11-06 06:35:49 +00:00
{% elif not v.email %}
<div class="text-danger text-small mt-1" id="email-verify-text">Add an email to secure your account in case you forget your password.</div>
{% endif %}
</div>
</div>
<div class="d-lg-flex mt-3">
<label for="email-password" class="w-lg-25 d-none" id="email-password-label">Password</label>
<div class="w-lg-100">
<input autocomplete="off" type="password" class="form-control mb-2 d-none" id="email-password" name="password" required>
<small id="emailpasswordRequired" class="form-text font-weight-bold text-danger d-none mt-1">Password required to update your email.</small>
</div>
2022-05-04 23:09:46 +00:00
</div>
<small id="emailpasswordRequired" class="form-text font-weight-bold text-danger d-none mt-1">Password required to update your email.</small>
</div>
2022-11-06 06:35:49 +00:00
<div class="footer">
<div class="d-flex">
{% if FEATURES['MARSEYBUX'] %}
2022-11-06 06:35:49 +00:00
{% if KOFI_TOKEN %}
2022-12-30 12:14:18 +00:00
<button type="button" class="btn btn-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/settings/kofi')">Claim {{patron}} rewards</button>
2022-11-06 06:35:49 +00:00
{% else %}
2022-12-30 12:14:18 +00:00
<button type="button" class="btn btn-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/settings/gumroad')">Claim {{patron}} rewards</button>
2022-11-06 06:35:49 +00:00
{% endif %}
{% endif %}
{% if v.email %}
2022-12-30 12:14:18 +00:00
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" data-nonce="{{g.nonce}}" data-onclick="disable(this)" value="Update email">
2022-10-30 18:43:06 +00:00
{% else %}
2022-12-30 12:14:18 +00:00
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" data-nonce="{{g.nonce}}" data-onclick="disable(this)" value="Add email">
2022-10-30 18:43:06 +00:00
{% endif %}
2022-11-06 06:35:49 +00:00
</div>
{% if FEATURES['MARSEYBUX'] %}
2022-11-06 06:35:49 +00:00
<span class="text-small text-muted pl-1">Must be same email as the one you used to donate
{% if v.truescore >= TRUESCORE_DONATE_MINIMUM %}
2022-11-06 06:35:49 +00:00
on
{% if KOFI_TOKEN %}
<a rel="nofollow noopener" class="text-primary" href="{{KOFI_LINK}}">Kofi</a>
{% else %}
<a rel="nofollow noopener" class="text-primary" href="{{GUMROAD_LINK}}">Gumroad</a>
{% endif %}
{% endif %}
</span>
2022-09-13 16:53:19 +00:00
{% endif %}
2022-11-06 06:35:49 +00:00
</div>
</form>
2022-05-04 23:09:46 +00:00
</div>
2022-11-06 06:35:49 +00:00
</section>
<section id="site-settings-password-section" class="settings-section-section">
<h5>Password</h5>
<div class="settings-section rounded">
<form action="/settings/security" method="post">
<div class="body">
<div class="d-lg-flex">
<label for="old_password" class="mb-0 w-lg-25">Old Password</label>
2022-12-25 02:10:56 +00:00
<input autocomplete="off" class="form-control mb-2 w-lg-100" id="old_password" type="password" name="old_password" required>
2022-11-06 06:35:49 +00:00
</div>
<div class="d-lg-flex mt-5">
<label for="new_password" class="mb-0 w-lg-25">New Password</label>
2022-12-25 02:10:56 +00:00
<input autocomplete="off" class="form-control w-lg-100" id="new_password" type="password" name="new_password" required>
2022-11-06 06:35:49 +00:00
<small id="passwordHelpChange" class="form-text font-weight-bold text-muted d-none mt-1 w-lg-100">Minimum of 8 characters required.</small>
<small id="passwordHelpChangeSuccess" class="form-text font-weight-bold text-success d-none mt-1 w-lg-100">Your password meets the requirements.</small>
</div>
<div class="d-lg-flex mt-4">
<label for="cnf_password" class="mb-0 w-lg-25">Confirm New Password</label>
2022-12-25 02:10:56 +00:00
<input autocomplete="off" class="form-control w-lg-100" id="cnf_password" type="password" name="cnf_password" required>
2022-11-06 06:35:49 +00:00
<small id="passwordHelpCnf" class="form-text font-weight-bold text-muted d-none mt-1 w-lg-100">Passwords do not match.</small>
<small id="passwordHelpCnfSuccess" class="form-text font-weight-bold text-success d-none mt-1 w-lg-100">Passwords match.</small>
</div>
</div>
<div class="footer">
[DO NOT MERGE] import detanglation (#442) * move Base definition to files.classes.__init__.py * fix ImportError * move userpage listing to users.py * don't import the app from classes * consts: set default values to avoid crashes consts: warn if the secret key is the default config value * card view: sneed (user db schema) * cloudflare: use DEFAULT_CONFIG_VALUE * const: set default values * decouple media.py from __main__ * pass database to avoid imports * import cleanup and import request not in const, but in the requests mega import * move asset_submissions site check to __init__ * asset submissions feature flag * flag * g.is_tor * don't import request where it's not needed * i think this is fine * mail: move to own routes and helper * wrappers * required wrappers move * unfuck wrappers a bit * move snappy quotes and marseys to stateful consts * marsify * :pepodrool: * fix missing import * import cache * ...and settings.py * and static.py * static needs cache * route * lmao all of the jinja shit was in feeds.py amazing * classes should only import what they need from flask * import Response * hdjbjdhbhjf * ... * dfdfdfdf * make get a non-required import * isort imports (mostly) * but actually * configs * reload config on import * fgfgfgfg * config * config * initialize snappy and test * cookie of doom debug * edfjnkf * xikscdfd * debug config * set session cookie domain, i think this fixes the can't login bug * sdfbgnhvfdsghbnjfbdvvfghnn * hrsfxgf * dump the entire config on a request * kyskyskyskyskyskyskyskyskys * duifhdskfjdfd * dfdfdfdfdfdfdfdfdfdfdfdf * dfdfdfdf * imoprt all of the consts beacuse fuck it * 😭 * dfdfdfdfdfdfsdasdf * print the entire session * rffdfdfjkfksj * fgbhffh * not the secret keys * minor bug fixes * be helpful in the warning * gfgfgfg * move warning lower * isort main imports (i hope this doesn't fuck something up) * test * session cookie domain redux * dfdfdfd * try only importing Flask * formkeys fix * y * :pepodrool: * route helper * remove before flight * dfdfdfdfdf * isort classes * isort helpers * move check_for_alts to routehelpers and also sort imports and get rid of unused ones * that previous commit but actkally * readd the cache in a dozen places they were implicitly imported * use g.is_tor instead of request.headers. bla bla bla * upgrade streamers to their own route file * get rid of unused imports in __main__ * fgfgf * don't pull in the entire ORM where we don't need it * features * explicit imports for the get helper * explicit imports for the get helper redux * testing allroutes * remove unused import * decouple flask from classes * syntax fix also remember these have side fx for some reason (why?) * move side effects out of the class * posts * testing on devrama * settings * reloading * settingssdsdsds * streamer features * site settings * testing settings on devrama * import * fix modlog * remove debug stuff * revert commit 67275b21ab6e2f2520819e84d10bfc1c746a15b6 * archiveorg to _archiveorg * skhudkfkjfd * fix cron for PCM * fix bugs that snekky wants me to * Fix call to realbody passing db, standardize kwarg * test * import check_for_alts from the right place * cloudflare * testing on devrama * fix cron i think * shadow properly * tasks * Remove print which will surely be annoying in prod. * v and create new session * use files.classes * make errors import little and fix rare 500 in /allow_nsfw * Revert "use files.classes" This reverts commit 98c10b876cf86ce058b7fb955cf1ec0bfb9996c6. * pass v to media functions rather than using g * fix * dfdfdfdfd * cleanup, py type checking is dumb so don't use it where it causes issues * Fix some merge bugs, add DEFAULT_RATELIMIT to main. * Fix imports on sqlalchemy expressions. * `from random import random` is an error. * Fix replies db param. * errors: fix missing import * fix rare 500: only send to GIFT_NOTIF_ID if it exists, and send them the right text * Fix signup formkey. * fix 2 500s * propagate db to submissions * fix replies * dfdfdfdf * Fix verifiedcolor. * is_manual * can't use getters outside of an app context * don't attempt to do gumroad on sites where it's not enabled * don't attempt to do gumraod on sites's where it's unnecessary * Revert "don't attempt to do gumroad on sites where it's not enabled" This reverts commit 6f8a6331878655492dfaf1907b27f8be513c14d3. * fix 500 * validate media type Co-authored-by: TLSM <duolsm@outlook.com>
2022-11-15 09:19:08 +00:00
<input type="hidden" name="formkey" value="{{v|formkey}}">
2022-11-06 06:35:49 +00:00
<input type="hidden" name="now" value="{{now}}">
<div class="d-flex">
2022-12-30 12:14:18 +00:00
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" data-nonce="{{g.nonce}}" data-onclick="disable(this)" value="Change Password">
2022-11-06 06:35:49 +00:00
</div>
</div>
</form>
</div>
</section>
<section id="site-settings-2fa-section" class="settings-section-section">
<h5>Two-Factor Authentication</h5>
<div class="settings-section rounded">
<div class="d-lg-flex">
<div class="title w-lg-25">
<label for="2faToggle">Use 2-step login</label>
</div>
<div class="body w-lg-100">
<div class="custom-control custom-switch">
2022-12-30 12:14:18 +00:00
<input autocomplete="off" type="checkbox" class="custom-control-input" id="2faToggle" name="2faToggle" data-nonce="{{g.nonce}}" {% if v.mfa_secret %}checked{% endif %}>
2022-11-06 06:35:49 +00:00
<label class="custom-control-label" for="2faToggle"></label>
</div>
<span class="text-small text-muted">This requires entering a randomly-generated, 6-digit code and your password to login.</span>
</div>
</div>
</div>
</section>
<section id="site-settings-logout-everywhere-section" class="settings-section-section">
<h5>Log Out Everywhere</h5>
<form action="/settings/log_out_all_others" method="post">
[DO NOT MERGE] import detanglation (#442) * move Base definition to files.classes.__init__.py * fix ImportError * move userpage listing to users.py * don't import the app from classes * consts: set default values to avoid crashes consts: warn if the secret key is the default config value * card view: sneed (user db schema) * cloudflare: use DEFAULT_CONFIG_VALUE * const: set default values * decouple media.py from __main__ * pass database to avoid imports * import cleanup and import request not in const, but in the requests mega import * move asset_submissions site check to __init__ * asset submissions feature flag * flag * g.is_tor * don't import request where it's not needed * i think this is fine * mail: move to own routes and helper * wrappers * required wrappers move * unfuck wrappers a bit * move snappy quotes and marseys to stateful consts * marsify * :pepodrool: * fix missing import * import cache * ...and settings.py * and static.py * static needs cache * route * lmao all of the jinja shit was in feeds.py amazing * classes should only import what they need from flask * import Response * hdjbjdhbhjf * ... * dfdfdfdf * make get a non-required import * isort imports (mostly) * but actually * configs * reload config on import * fgfgfgfg * config * config * initialize snappy and test * cookie of doom debug * edfjnkf * xikscdfd * debug config * set session cookie domain, i think this fixes the can't login bug * sdfbgnhvfdsghbnjfbdvvfghnn * hrsfxgf * dump the entire config on a request * kyskyskyskyskyskyskyskyskys * duifhdskfjdfd * dfdfdfdfdfdfdfdfdfdfdfdf * dfdfdfdf * imoprt all of the consts beacuse fuck it * 😭 * dfdfdfdfdfdfsdasdf * print the entire session * rffdfdfjkfksj * fgbhffh * not the secret keys * minor bug fixes * be helpful in the warning * gfgfgfg * move warning lower * isort main imports (i hope this doesn't fuck something up) * test * session cookie domain redux * dfdfdfd * try only importing Flask * formkeys fix * y * :pepodrool: * route helper * remove before flight * dfdfdfdfdf * isort classes * isort helpers * move check_for_alts to routehelpers and also sort imports and get rid of unused ones * that previous commit but actkally * readd the cache in a dozen places they were implicitly imported * use g.is_tor instead of request.headers. bla bla bla * upgrade streamers to their own route file * get rid of unused imports in __main__ * fgfgf * don't pull in the entire ORM where we don't need it * features * explicit imports for the get helper * explicit imports for the get helper redux * testing allroutes * remove unused import * decouple flask from classes * syntax fix also remember these have side fx for some reason (why?) * move side effects out of the class * posts * testing on devrama * settings * reloading * settingssdsdsds * streamer features * site settings * testing settings on devrama * import * fix modlog * remove debug stuff * revert commit 67275b21ab6e2f2520819e84d10bfc1c746a15b6 * archiveorg to _archiveorg * skhudkfkjfd * fix cron for PCM * fix bugs that snekky wants me to * Fix call to realbody passing db, standardize kwarg * test * import check_for_alts from the right place * cloudflare * testing on devrama * fix cron i think * shadow properly * tasks * Remove print which will surely be annoying in prod. * v and create new session * use files.classes * make errors import little and fix rare 500 in /allow_nsfw * Revert "use files.classes" This reverts commit 98c10b876cf86ce058b7fb955cf1ec0bfb9996c6. * pass v to media functions rather than using g * fix * dfdfdfdfd * cleanup, py type checking is dumb so don't use it where it causes issues * Fix some merge bugs, add DEFAULT_RATELIMIT to main. * Fix imports on sqlalchemy expressions. * `from random import random` is an error. * Fix replies db param. * errors: fix missing import * fix rare 500: only send to GIFT_NOTIF_ID if it exists, and send them the right text * Fix signup formkey. * fix 2 500s * propagate db to submissions * fix replies * dfdfdfdf * Fix verifiedcolor. * is_manual * can't use getters outside of an app context * don't attempt to do gumroad on sites where it's not enabled * don't attempt to do gumraod on sites's where it's unnecessary * Revert "don't attempt to do gumroad on sites where it's not enabled" This reverts commit 6f8a6331878655492dfaf1907b27f8be513c14d3. * fix 500 * validate media type Co-authored-by: TLSM <duolsm@outlook.com>
2022-11-15 09:19:08 +00:00
<input type="hidden" name="formkey" value="{{v|formkey}}">
2022-05-04 23:09:46 +00:00
<div class="body">
<div class="d-lg-flex">
2022-11-06 06:35:49 +00:00
<label for="forcelog-password" class="w-lg-25" id="email-password-label">Password</label>
<div class="w-lg-100">
<input autocomplete="off" type="password" class="form-control mb-2" id="forcelog-password" name="password" required>
</div>
2022-05-04 23:09:46 +00:00
</div>
2022-11-06 06:35:49 +00:00
<small id="emailpasswordRequired" class="form-text mt-1">This will also invalidate any existing recovery links associated with this account.</small>
</div>
<div class="footer">
<div class="d-flex">
2022-12-30 12:14:18 +00:00
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" data-nonce="{{g.nonce}}" data-onclick="disable(this)" value="Log out everywhere">
2022-11-06 06:35:49 +00:00
</div>
</div>
</form>
</section>
<section id="site-settings-blocks-section" class="settings-section-section">
<div class="row">
<div class="col">
<div class="d-md-flex justify-content-between mb-3">
<div>
<h5>Users you block</h5>
<p class="text-small text-muted mb-md-0">You have blocked the following users. They cannot reply to your content or notify you with a username mention.</p>
</div>
<div class="mt-auto">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#blockmodal">Block user</button>
</div>
</div>
{% if v.blocking.first() %}
<div class="card mb-5">
<div class="overflow-x-auto"><table class="table table-hover rounded mb-0">
<thead class="thead-dark">
<tr>
<th>User</th>
<th>Unblock</th>
2022-11-06 06:35:49 +00:00
</tr>
</thead>
<tbody class="text-muted">
{% for block in v.blocking %}
{% set user=block.target %}
<tr>
<td>
{% include "user_in_table.html" %}
</td>
<td>
2022-12-30 12:14:18 +00:00
<button type="button" class="btn btn-primary" data-nonce="{{g.nonce}}" data-onclick="unblock_user(this, '/settings/unblock?username={{user.username}}&formkey={{v|formkey}}')">Unblock</button>
2022-11-06 06:35:49 +00:00
</td>
</tr>
{% else %}
<td>There are no blocked users</td>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
{{macros.ghost_box('No blocked users', '', 2)}}
2022-11-06 06:35:49 +00:00
{% endif %}
</div>
2022-05-04 23:09:46 +00:00
</div>
2022-11-06 06:35:49 +00:00
</section>
2022-05-04 23:09:46 +00:00
</div>
</div>
</div>
2022-12-04 15:40:32 +00:00
2022-12-25 02:10:56 +00:00
<div class="modal fade" id="2faModal" tabindex="-1" role="dialog">
2022-12-04 15:40:32 +00:00
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
{% if mfa_secret %}
Setup two-step login
{% elif mfa_secret and not v.email %}
Email required for two-step login
{% else %}
Disable two-step login
{% endif %}
</h5>
2022-12-25 02:10:56 +00:00
<button type="button" class="close" data-bs-dismiss="modal">
<span><i class="far fa-times"></i></span>
2022-12-04 15:40:32 +00:00
</button>
</div>
<form action="/settings/security" method="post">
<input type="hidden" name="formkey" value="{{v|formkey}}">
<input type="hidden" name="2fa_secret" value="{{mfa_secret}}">
<div class="modal-body">
{% if mfa_secret %}
2022-12-20 21:16:49 +00:00
<p><span class="font-weight-bold">Step 1:</span> Scan this QR code (or enter the code) using a two-factor authentication app such as Google Authenticator or Authy.</p>
2022-12-04 15:40:32 +00:00
<div class="text-center mb-3">
<img alt="two-factor QR code" loading="lazy" class="img-fluid" width=175 src="/2faqr/{{mfa_secret}}">
<div class="text-small text-muted mt-1">Or enter this code: {{mfa_secret}}</div>
</div>
<p><span class="font-weight-bold">Step 2:</span> Enter the six-digit code generated in the authenticator app and your {{SITE_NAME}} account password.</p>
<label for="2fa_input">6-digit code</label>
<input autocomplete="off" type="text" class="form-control mb-2" id="2fa_input" name="2fa_token" placeholder="# # # # # #" required>
<label for="2fa_input_password">Password</label>
2022-12-30 12:14:18 +00:00
<input autocomplete="off" type="password" class="form-control mb-2" id="2fa_input_password" name="password" data-nonce="{{g.nonce}}" data-undisablelement="toggle2faButton" required>
2022-12-20 21:22:37 +00:00
{% set action = "Enable" %}
2022-12-04 15:40:32 +00:00
{% else %}
<div class="alert alert-warning" role="alert">
<i class="fas fa-info-circle"></i>
To disable two-step login, please enter your {{SITE_NAME}} account password and the 6-digit code generated in your authentication app. If you no longer have your two-step device, <a href="/lost_2fa">click here</a>.
</div>
<label for="2fa_input_password">Password</label>
<input autocomplete="off" type="password" class="form-control mb-2" id="2fa_input_password" name="password" required>
<label for="2fa_input">6-digit code</label>
2022-12-30 12:14:18 +00:00
<input autocomplete="off" type="text" class="form-control mb-2" id="2fa_input" name="2fa_remove" placeholder="# # # # # #" data-nonce="{{g.nonce}}" data-undisablelement="toggle2faButton" required>
2022-12-20 21:22:37 +00:00
{% set action = "Disable" %}
2022-12-04 15:40:32 +00:00
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-link text-muted" data-bs-dismiss="modal">Cancel</button>
2022-12-30 12:14:18 +00:00
<input autocomplete="off" id="toggle2faButton" class="btn btn-primary" type="submit" data-nonce="{{g.nonce}}" data-onclick="disable(this)" value="{{action}} 2-step login" disabled>
2022-12-04 15:40:32 +00:00
</div>
</form>
</div>
</div>
</div>
2022-12-25 02:10:56 +00:00
<div class="modal fade" id="blockmodal" tabindex="-1" role="dialog">
2022-12-04 15:40:32 +00:00
<div class="modal-dialog modal-dialog-centered" role="document">
2022-12-30 12:14:18 +00:00
<form class="m-auto" action="/settings/block" id="block-form" method="post" data-nonce="{{g.nonce}}" data-onsubmit="return false;">
2022-12-04 15:40:32 +00:00
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Block user</h5>
2022-12-25 02:10:56 +00:00
<button type="button" class="close" data-bs-dismiss="modal">
<span><i class="far fa-times"></i></span>
2022-12-04 15:40:32 +00:00
</button>
</div>
<div class="modal-body">
<input type="hidden" name="formkey" value="{{v|formkey}}">
<input autocomplete="off" type="text" name="username" placeholder="Enter username..." id="block-username" class="form-control" maxlength=25 required>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-link text-muted" data-bs-dismiss="modal">Cancel</button>
2022-12-30 12:14:18 +00:00
<button type="button" class="btn btn-primary" id="blockUserButton" data-nonce="{{g.nonce}}" data-onclick="block_user()">Block user</button>
2022-12-04 15:40:32 +00:00
</div>
</div>
</form>
</div>
</div>
2022-05-04 23:09:46 +00:00
2022-12-25 02:10:56 +00:00
<div class="toast error" id="toast-exile-error" role="alert" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
2022-11-06 06:35:49 +00:00
<div class="toast-body text-center">
<i class="fas fa-exclamation-circle text-danger mr-2"></i><span id="toast-error-message">Error. Please try again.</span>
</div>
</div>
{% endblock %}