2016-07-31 19:36:13 +00:00
|
|
|
{% extends 'master.twig' %}
|
2016-07-29 19:31:36 +00:00
|
|
|
|
2016-12-09 21:31:15 +00:00
|
|
|
{% set title = 'Reset password' %}
|
|
|
|
{% set verified = get.u is defined and get.k is defined %}
|
|
|
|
|
|
|
|
{% block js %}
|
|
|
|
<script>
|
|
|
|
function yuunoAttemptPasswordReset(form) {
|
|
|
|
var client = new Sakura.AJAX;
|
|
|
|
|
|
|
|
{% if not verified %}
|
|
|
|
var sndBtn = Sakura.DOM.ID('snd-btn');
|
|
|
|
sndBtn.disabled = true;
|
|
|
|
sndBtn.innerHTML = '<i class="fa fa-spinner fa-spin"></i>';
|
|
|
|
Sakura.DOM.AddClass(sndBtn, ['input__button--disabled']);
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
client.SetUrl("{{ route('auth.resetpassword') }}");
|
|
|
|
client.SetFormData(new FormData(form));
|
|
|
|
client.AddCallback(200, function () {
|
|
|
|
{% if not verified %}
|
|
|
|
sndBtn.disabled = false;
|
|
|
|
sndBtn.innerHTML = '<i class="fa fa-envelope"></i> Send e-mail';
|
|
|
|
Sakura.DOM.RemoveClass(sndBtn, ['input__button--disabled']);
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
var result = client.JSON();
|
|
|
|
|
|
|
|
if (result.error || result.text) {
|
|
|
|
var dialogue = new Sakura.Dialogue;
|
|
|
|
dialogue.Title = "Reset password";
|
|
|
|
dialogue.Text = result.error || result.text;
|
|
|
|
dialogue.AddCallback(Sakura.DialogueButton.Ok, function () {
|
|
|
|
this.Close();
|
|
|
|
|
|
|
|
if (result.go) {
|
|
|
|
window.location.assign(result.go);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
dialogue.Display();
|
|
|
|
} else if (result.go) {
|
|
|
|
window.location.assign(result.go);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
client.Start(Sakura.HTTPMethod.POST);
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|
2016-07-29 19:31:36 +00:00
|
|
|
|
|
|
|
{% block content %}
|
2016-11-09 18:32:23 +00:00
|
|
|
<div class="auth content content--auth">
|
|
|
|
<div class="content__header">
|
2016-12-09 21:31:15 +00:00
|
|
|
Reset password
|
2016-07-29 19:31:36 +00:00
|
|
|
</div>
|
2016-12-09 21:31:15 +00:00
|
|
|
<form method="post" action="javascript:void(0)" onsubmit="yuunoAttemptPasswordReset(this)">
|
2016-11-09 18:32:23 +00:00
|
|
|
<input type="hidden" name="session" value="{{ session_id() }}">
|
2016-12-09 21:31:15 +00:00
|
|
|
{% if verified %}
|
2016-11-09 18:32:23 +00:00
|
|
|
<input type="hidden" name="user" value="{{ get.u }}">
|
|
|
|
<input type="hidden" name="key" value="{{ get.k }}">
|
|
|
|
<label>
|
|
|
|
<div class="auth__label">Password</div>
|
|
|
|
<input class="input__text" type="password" name="password" autofocus>
|
|
|
|
</label>
|
|
|
|
<button class="input__button auth__button">
|
2016-12-07 23:34:59 +00:00
|
|
|
<i class="fa fa-save"></i> Save Password
|
2016-11-09 18:32:23 +00:00
|
|
|
</button>
|
|
|
|
{% else %}
|
|
|
|
<label>
|
|
|
|
<div class="auth__label">Username</div>
|
|
|
|
<input class="input__text" type="text" name="username" autofocus>
|
|
|
|
</label>
|
|
|
|
<label>
|
|
|
|
<div class="auth__label">E-mail</div>
|
|
|
|
<input class="input__text" type="text" name="email">
|
|
|
|
</label>
|
2016-12-09 21:31:15 +00:00
|
|
|
<button class="input__button auth__button" id="snd-btn">
|
|
|
|
<i class="fa fa-envelope"></i> Send e-mail
|
2016-11-09 18:32:23 +00:00
|
|
|
</button>
|
|
|
|
<div class="auth__subtext">
|
|
|
|
<a href="{{ route('info.contact') }}">Contact us</a> if you lost access to your e-mail address!
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</form>
|
2016-07-29 19:31:36 +00:00
|
|
|
</div>
|
|
|
|
{% endblock %}
|