mapguesser/views/account/delete.php

35 lines
2.2 KiB
PHP
Raw Normal View History

2020-06-28 19:32:30 +02:00
@js(js/account/account.js)
2020-06-28 19:32:30 +02:00
@extends(templates/layout_normal)
2020-06-28 19:32:30 +02:00
@section(main)
2020-06-25 20:26:33 +02:00
<h2>Delete account</h2>
<div class="box">
<form id="deleteAccountForm" action="/account/delete" method="post" data-redirect-on-success="/">
<p class="justify marginBottom">Are you sure you want to delete your account? This cannot be undone!</p>
<input type="hidden" name="email" autocomplete="username" value="<?= $user['email'] ?>">
<?php if ($user['password'] !== null && $user['google_sub'] !== null): ?>
<p class="justify small">Please confirm your identity with your password or with Google to delete your account.</p>
<div class="inputWithButton">
<input type="password" class="text" name="password" placeholder="Current password" autocomplete="current-password" required minlength="6" autofocus><!--
--><button id="authenticateWithGoogleButton" class="yellow" type="button">Google</button>
</div>
<?php elseif ($user['password'] !== null): ?>
<p class="justify small">Please confirm your identity with your password to delete your account.</p>
<input type="password" class="text big fullWidth" name="password" placeholder="Current password" autocomplete="current-password" required minlength="6" autofocus>
<?php elseif ($user['google_sub'] !== null): ?>
<p class="justify small">Please confirm your identity with Google to delete your account.</p>
<div class="inputWithButton">
<input type="text" class="text" name="password" placeholder="Authenticate with Google..." disabled><!--
--><button id="authenticateWithGoogleButton" class="yellow" type="button">Google</button>
</div>
<?php endif; ?>
2020-06-25 20:26:33 +02:00
<p id="deleteAccountFormError" class="formError justify marginTop"></p>
<div class="right marginTop">
<button class="red marginRight" type="submit" name="submit">Delete account</button><!--
--><a class="button gray marginTop" href="/account" title="Back to account">Cancel</a>
2020-06-25 20:26:33 +02:00
</div>
</form>
</div>
@endsection