This commit is contained in:
87 files changed
+7008
No files matched your search
@@ -0,0 +1,36 @@
|
||||
@js(js/account/account.js)
|
||||
|
||||
@extends(templates/layout_normal)
|
||||
|
||||
@section(main)
|
||||
<h2>Account</h2>
|
||||
<div class="box">
|
||||
<form id="accountForm" action="/account" method="post" data-observe-inputs="password_new,password_new_confirm">
|
||||
<?php if ($user['password'] !== null && $user['google_sub'] !== null): ?>
|
||||
<p class="justify small">Please confirm your identity with your password or with Google to modify your account.</p>
|
||||
<div class="inputWithButton">
|
||||
<input type="password" class="text name="password" placeholder="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 modify your account.</p>
|
||||
<input type="password" class="text big fullWidth" name="password" placeholder="Current password" required minlength="6" autofocus>
|
||||
<?php elseif ($user['google_sub'] !== null): ?>
|
||||
<p class="justify small">Please confirm your identity with Google to modify 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; ?>
|
||||
<hr>
|
||||
<?php /* TODO: disabled for the time being, email modification should be implemented */ ?>
|
||||
<input type="email" class="text big fullWidth" name="email" placeholder="Email address" value="<?= $user['email'] ?>" disabled>
|
||||
<input type="password" class="text big fullWidth marginTop" name="password_new" placeholder="New password" minlength="6">
|
||||
<input type="password" class="text big fullWidth marginTop" name="password_new_confirm" placeholder="New password confirmation" minlength="6">
|
||||
<p id="accountFormError" class="formError justify marginTop"></p>
|
||||
<div class="right marginTop">
|
||||
<button type="submit" name="submit" disabled>Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,28 @@
|
||||
@js(js/account/google_authenticate.js)
|
||||
|
||||
@extends(templates/layout_minimal)
|
||||
|
||||
@section(main)
|
||||
<h2>Authenticate with Google</h2>
|
||||
<?php if (!$success): ?>
|
||||
<div class="box">
|
||||
<p class="error justify">
|
||||
<?php if (isset($errorText)): ?>
|
||||
<?= $errorText ?>
|
||||
<?php else: ?>
|
||||
Authentication with Google failed.
|
||||
<?php endif; ?>
|
||||
Please <a id="closeWindowButton" href="javascript:;" title="Close">close this window/tab</a> and try again!
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@endsection
|
||||
|
||||
@section(pageScript)
|
||||
<script>
|
||||
var success = <?= $success ? 'true' : 'false' ?>;
|
||||
<?php if (isset($authenticatedWithGoogleUntil)): ?>
|
||||
var authenticatedWithGoogleUntil = new Date('<?= $authenticatedWithGoogleUntil->format('c') ?>');
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
@endsection
|
||||
Reference in new issue
Block a user