summaryrefslogtreecommitdiff
path: root/src/web/_views/apps
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-05-21 21:11:19 -0400
committerFreya Murphy <freya@freyacat.org>2024-05-21 21:11:19 -0400
commit8d544d58af232e82c740cfcb271d20965020c133 (patch)
treeb258dacda826fe8ca7d9c703588262a153b9f6d5 /src/web/_views/apps
parentfix modals (diff)
downloadxssbook2-8d544d58af232e82c740cfcb271d20965020c133.tar.gz
xssbook2-8d544d58af232e82c740cfcb271d20965020c133.tar.bz2
xssbook2-8d544d58af232e82c740cfcb271d20965020c133.zip
things
Diffstat (limited to 'src/web/_views/apps')
-rw-r--r--src/web/_views/apps/settings/main.php48
1 files changed, 48 insertions, 0 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>