summaryrefslogtreecommitdiff
path: root/src/web/_views
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/_views')
-rw-r--r--src/web/_views/apps/settings/main.php48
-rw-r--r--src/web/_views/modal/about.php7
2 files changed, 50 insertions, 5 deletions
diff --git a/src/web/_views/apps/settings/main.php b/src/web/_views/apps/settings/main.php
index 0cdc4f2..00c1601 100644
--- a/src/web/_views/apps/settings/main.php
+++ b/src/web/_views/apps/settings/main.php
@@ -54,6 +54,23 @@ function handleSubmit(e) {
}
+function handlePassword(e) {
+ e.preventDefault();
+ let el = e.target.elements;
+ let curr = el.curr_password.value;
+ let newp = el.new_password.value;
+
+ $.ajax({
+ url: '/api/rpc/update_password',
+ method: 'POST',
+ data: JSON.stringify({
+ new_password: newp,
+ current_password: curr
+ }),
+ success: onSuccess
+ })
+}
+
const toBase64 = file => new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
@@ -111,6 +128,37 @@ function resetMedia(media_type) {
<?=__create_form($user, 'last_name')?>
<?=__create_form($user, 'gender')?>
<hr class="mt">
+ <h2><?=ucfirst(lang('security_title'))?></h2>
+ <strong><?=ucfirst(lang('security_desc'))?></strong>
+ <form action="" class="col mt settings-form" onsubmit="handlePassword(event)">
+ <div class="rel mb" style="flex: 1">
+ <input
+ type="password"
+ name="curr_password"
+ id="curr_password"
+ placeholder=" "
+ >
+ <label for="curr_password">
+ <?=ucwords(lang('ph_current_pass'))?>
+ </label>
+ </div>
+ <div class="rel mb" style="flex: 1">
+ <input
+ type="password"
+ name="new_password"
+ id="new_password"
+ placeholder=" "
+ >
+ <label for="new_password">
+ <?=ucwords(lang('ph_new_pass'))?>
+ </label>
+ </div>
+ <button
+ class="btn btn-wide btn-submit"
+ style="flex: 0; height: fit-content;"
+ ><?=lang('update')?></button>
+ </form>
+ <hr class="mt">
<h2><?=ucfirst(lang('media_title'))?></h2>
<strong><?=ucfirst(lang('media_desc'))?></strong>
<h3><?=ucfirst(lang('ph_avatar'))?></h3>
diff --git a/src/web/_views/modal/about.php b/src/web/_views/modal/about.php
index 746607e..d434908 100644
--- a/src/web/_views/modal/about.php
+++ b/src/web/_views/modal/about.php
@@ -2,11 +2,10 @@
<?php /* vi: syntax=php */ ?>
<div id="about-modal-body">
<span class="logo">xssbook</span>
- <hr>
<span class="mb"><?=ucfirst(lang('version'))?></span>
<span><?=ucfirst(lang('copyright'))?></span>
- <hr>
- <a class="btn btn-blue" href="https://g.freya.cat/freya/xssbook2">Source Code</a>
+ <a class="btn btn-blue mt" href="https://g.freya.cat/freya/xssbook2">Source Code</a>
+ <p>For reports of abuse, please email <a class="btn-blue" href="mailto:contact@freyacat.org">contact@freyacat.org</a></p>
</div>
<style>
#about-modal-body {
@@ -15,8 +14,6 @@
flex-direction: column;
justify-content: center;
align-items: center;
- font-weight: bold;
- font-size: 1.1rem;
padding: 1rem;
}
#about-modal-body .logo {