2016-01-09 23:29:28 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2017-09-05 15:58:34 +03:00
|
|
|
<meta charset="utf-8">
|
2016-01-09 23:29:28 +02:00
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<meta name="theme-color" content="#35A768">
|
|
|
|
|
2017-09-14 16:18:20 +03:00
|
|
|
<title><?= lang('forgot_your_password') . ' - ' . $company_name ?></title>
|
|
|
|
|
2017-11-14 16:01:49 +03:00
|
|
|
<script src="<?= asset_url('assets/ext/jquery/jquery.min.js') ?>"></script>
|
|
|
|
<script src="<?= asset_url('assets/ext/bootstrap/js/bootstrap.min.js') ?>"></script>
|
|
|
|
<script src="<?= asset_url('assets/ext/jquery-ui/jquery-ui.min.js') ?>"></script>
|
|
|
|
<script src="<?= asset_url('assets/ext/datejs/date.js') ?>"></script>
|
2017-09-05 15:58:34 +03:00
|
|
|
|
|
|
|
<script>
|
2017-09-14 16:18:20 +03:00
|
|
|
var EALang = <?= json_encode($this->lang->language) ?>;
|
2016-01-09 23:29:28 +02:00
|
|
|
</script>
|
|
|
|
|
2017-11-14 16:01:49 +03:00
|
|
|
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/ext/bootstrap/css/bootstrap.min.css') ?>">
|
|
|
|
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/ext/jquery-ui/jquery-ui.min.css') ?>">
|
2017-09-05 15:58:34 +03:00
|
|
|
|
2017-11-14 16:01:49 +03:00
|
|
|
<link rel="icon" type="image/x-icon" href="<?= asset_url('assets/img/favicon.ico') ?>">
|
2016-01-09 23:29:28 +02:00
|
|
|
|
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
|
|
|
display: table-cell;
|
|
|
|
vertical-align: middle;
|
|
|
|
background-color: #CAEDF3;
|
|
|
|
}
|
|
|
|
|
|
|
|
#forgot-password-frame {
|
|
|
|
width: 630px;
|
|
|
|
margin: auto;
|
|
|
|
background: #FFF;
|
|
|
|
border: 1px solid #DDDADA;
|
|
|
|
padding: 70px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.user-login {
|
|
|
|
margin-left: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media(max-width: 640px) {
|
|
|
|
#forgot-password-frame {
|
|
|
|
width: 100%;
|
|
|
|
padding: 20px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2017-09-05 15:58:34 +03:00
|
|
|
<script>
|
2016-01-09 23:29:28 +02:00
|
|
|
$(document).ready(function() {
|
|
|
|
var GlobalVariables = {
|
2017-09-14 16:18:20 +03:00
|
|
|
'csrfToken': <?= json_encode($this->security->get_csrf_hash()) ?>,
|
|
|
|
'baseUrl': <?= json_encode(base_url()) ?>,
|
2016-01-09 23:29:28 +02:00
|
|
|
'AJAX_SUCCESS': 'SUCCESS',
|
|
|
|
'AJAX_FAILURE': 'FAILURE'
|
|
|
|
};
|
|
|
|
|
2017-09-14 16:18:20 +03:00
|
|
|
var EALang = <?= json_encode($this->lang->language) ?>;
|
2016-01-09 23:29:28 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Event: Login Button "Click"
|
|
|
|
*
|
|
|
|
* Make an ajax call to the server and check whether the user's credentials are right.
|
|
|
|
* If yes then redirect him to his desired page, otherwise display a message.
|
|
|
|
*/
|
|
|
|
$('form').submit(function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
var postUrl = GlobalVariables.baseUrl + '/index.php/user/ajax_forgot_password';
|
|
|
|
var postData = {
|
|
|
|
'csrfToken': GlobalVariables.csrfToken,
|
|
|
|
'username': $('#username').val(),
|
|
|
|
'email': $('#email').val()
|
|
|
|
};
|
|
|
|
|
|
|
|
$('.alert').addClass('hidden');
|
|
|
|
$('#get-new-password').prop('disabled', true);
|
|
|
|
|
|
|
|
$.post(postUrl, postData, function(response) {
|
2016-01-24 18:38:02 +02:00
|
|
|
$('.alert').removeClass('hidden alert-danger alert-success');
|
2016-01-09 23:29:28 +02:00
|
|
|
$('#get-new-password').prop('disabled', false);
|
2016-03-07 21:59:04 +02:00
|
|
|
|
2017-09-05 15:58:34 +03:00
|
|
|
if (!GeneralFunctions.handleAjaxExceptions(response)) {
|
|
|
|
return;
|
|
|
|
}
|
2016-01-09 23:29:28 +02:00
|
|
|
|
|
|
|
if (response == GlobalVariables.AJAX_SUCCESS) {
|
|
|
|
$('.alert').addClass('alert-success');
|
|
|
|
$('.alert').text(EALang['new_password_sent_with_email']);
|
|
|
|
} else {
|
2016-01-24 18:38:02 +02:00
|
|
|
$('.alert').addClass('alert-danger');
|
2016-01-09 23:29:28 +02:00
|
|
|
$('.alert').text('The operation failed! Please enter a valid username '
|
|
|
|
+ 'and email address in order to get a new password.');
|
|
|
|
}
|
|
|
|
}, 'json');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="forgot-password-frame" class="frame-container">
|
2017-09-14 16:18:20 +03:00
|
|
|
<h2><?= lang('forgot_your_password') ?></h2>
|
|
|
|
<p><?= lang('type_username_and_email_for_new_password') ?></p>
|
2016-01-09 23:29:28 +02:00
|
|
|
<hr>
|
|
|
|
<div class="alert hidden"></div>
|
|
|
|
<form>
|
|
|
|
<div class="form-group">
|
2017-09-14 16:18:20 +03:00
|
|
|
<label for="username"><?= lang('username') ?></label>
|
|
|
|
<input type="text" id="username" placeholder="<?= lang('enter_username_here') ?>" class="form-control" />
|
2016-01-09 23:29:28 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2017-09-14 16:18:20 +03:00
|
|
|
<label for="email"><?= lang('email') ?></label>
|
|
|
|
<input type="text" id="email" placeholder="<?= lang('enter_email_here') ?>" class="form-control" />
|
2016-01-09 23:29:28 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<button type="submit" id="get-new-password" class="btn btn-primary btn-large">
|
2017-09-14 16:18:20 +03:00
|
|
|
<?= lang('regenerate_password') ?>
|
2016-01-09 23:29:28 +02:00
|
|
|
</button>
|
|
|
|
|
2017-09-14 16:18:20 +03:00
|
|
|
<a href="<?= site_url('user/login') ?>" class="user-login">
|
|
|
|
<?= lang('go_to_login') ?></a>
|
2016-01-09 23:29:28 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
2017-11-14 16:01:49 +03:00
|
|
|
<script src="<?= asset_url('assets/js/general_functions.js') ?>"></script>
|
2016-01-09 23:29:28 +02:00
|
|
|
</body>
|
|
|
|
</html>
|