2013-10-11 18:58:46 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2015-07-09 00:07:06 +03:00
|
|
|
<meta charset="utf-8" />
|
|
|
|
<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">
|
2013-12-20 19:44:44 +02:00
|
|
|
<title><?php echo $this->lang->line('forgot_your_password') . ' - ' . $company_name; ?></title>
|
2015-07-09 00:07:06 +03:00
|
|
|
|
2013-10-11 18:58:46 +03:00
|
|
|
<?php // INCLUDE JS FILES ?>
|
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-07-08 01:17:39 +03:00
|
|
|
src="<?php echo $this->config->item('base_url'); ?>/assets/ext/jquery/jquery.min.js"></script>
|
2013-10-11 18:58:46 +03:00
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-07-08 01:17:39 +03:00
|
|
|
src="<?php echo $this->config->item('base_url'); ?>/assets/ext/bootstrap/js/bootstrap.min.js"></script>
|
2013-10-11 18:58:46 +03:00
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-07-08 01:17:39 +03:00
|
|
|
src="<?php echo $this->config->item('base_url'); ?>/assets/ext/datejs/date.js"></script>
|
2013-12-19 18:28:19 +02:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var EALang = <?php echo json_encode($this->lang->language); ?>;
|
|
|
|
</script>
|
2013-10-11 18:58:46 +03:00
|
|
|
|
|
|
|
<?php // INCLUDE CSS FILES ?>
|
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
|
|
|
type="text/css"
|
2015-07-08 01:17:39 +03:00
|
|
|
href="<?php echo $this->config->item('base_url'); ?>/assets/ext/bootstrap/css/bootstrap.min.css">
|
2013-10-11 18:58:46 +03:00
|
|
|
|
|
|
|
<?php // SET FAVICON FOR PAGE ?>
|
|
|
|
<link
|
|
|
|
rel="icon"
|
|
|
|
type="image/x-icon"
|
2015-05-28 00:15:43 +03:00
|
|
|
href="<?php echo $this->config->item('base_url'); ?>/assets/img/favicon.ico">
|
2013-10-11 18:58:46 +03:00
|
|
|
|
|
|
|
<style>
|
|
|
|
body {
|
2015-07-09 00:07:06 +03:00
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
|
|
|
display: table-cell;
|
|
|
|
vertical-align: middle;
|
2013-10-11 18:58:46 +03:00
|
|
|
background-color: #CAEDF3;
|
|
|
|
}
|
|
|
|
|
|
|
|
#forgot-password-frame {
|
|
|
|
width: 630px;
|
2015-07-09 00:07:06 +03:00
|
|
|
margin: auto;
|
2013-10-11 18:58:46 +03:00
|
|
|
background: #FFF;
|
|
|
|
border: 1px solid #DDDADA;
|
|
|
|
padding: 70px;
|
|
|
|
}
|
|
|
|
|
2015-07-08 23:44:52 +03:00
|
|
|
.user-login {
|
2013-10-11 18:58:46 +03:00
|
|
|
margin-left: 20px;
|
|
|
|
}
|
2015-07-09 00:07:06 +03:00
|
|
|
|
|
|
|
@media(max-width: 640px) {
|
|
|
|
#forgot-password-frame {
|
|
|
|
width: 100%;
|
2015-07-09 00:14:42 +03:00
|
|
|
padding: 20px;
|
2015-07-09 00:07:06 +03:00
|
|
|
}
|
|
|
|
}
|
2013-10-11 18:58:46 +03:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
var GlobalVariables = {
|
2015-05-28 00:47:19 +03:00
|
|
|
'csrfToken': <?php echo json_encode($this->security->get_csrf_hash()); ?>,
|
2013-10-11 18:58:46 +03:00
|
|
|
'baseUrl': <?php echo '"' . $base_url . '"'; ?>,
|
|
|
|
'AJAX_SUCCESS': 'SUCCESS',
|
|
|
|
'AJAX_FAILURE': 'FAILURE'
|
|
|
|
};
|
|
|
|
|
2013-12-19 18:28:19 +02:00
|
|
|
var EALang = <?php echo json_encode($this->lang->language); ?>;
|
2013-12-19 12:28:10 +02:00
|
|
|
|
2013-10-11 18:58:46 +03: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.
|
|
|
|
*/
|
2014-01-04 00:26:10 +02:00
|
|
|
$('form').submit(function(event) {
|
2013-10-11 18:58:46 +03:00
|
|
|
event.preventDefault();
|
|
|
|
|
2015-05-20 23:41:03 +03:00
|
|
|
var postUrl = GlobalVariables.baseUrl + '/index.php/user/ajax_forgot_password';
|
2013-10-11 18:58:46 +03:00
|
|
|
var postData = {
|
2015-05-28 00:47:19 +03:00
|
|
|
'csrfToken': GlobalVariables.csrfToken,
|
2013-10-11 18:58:46 +03:00
|
|
|
'username': $('#username').val(),
|
|
|
|
'email': $('#email').val()
|
|
|
|
};
|
|
|
|
|
|
|
|
$('.alert').addClass('hidden');
|
2013-12-18 19:05:39 +02:00
|
|
|
$('#get-new-password').prop('disabled', true);
|
2013-10-11 18:58:46 +03:00
|
|
|
|
|
|
|
$.post(postUrl, postData, function(response) {
|
|
|
|
//////////////////////////////////////////////////////////
|
|
|
|
console.log('Regenerate Password Response: ', response);
|
|
|
|
//////////////////////////////////////////////////////////
|
|
|
|
|
2013-12-18 19:05:39 +02:00
|
|
|
$('#get-new-password').prop('disabled', false);
|
2013-10-11 18:58:46 +03:00
|
|
|
if (!GeneralFunctions.handleAjaxExceptions(response)) return;
|
|
|
|
|
|
|
|
if (response == GlobalVariables.AJAX_SUCCESS) {
|
|
|
|
$('.alert').addClass('alert-success');
|
2013-12-20 19:44:44 +02:00
|
|
|
$('.alert').text(EALang['new_password_sent_with_email']);
|
2013-10-11 18:58:46 +03:00
|
|
|
} else {
|
|
|
|
$('.alert').text('The operation failed! Please enter a valid username '
|
|
|
|
+ 'and email address in order to get a new password.');
|
|
|
|
}
|
2015-07-09 00:16:13 +03:00
|
|
|
$('.alert')
|
|
|
|
.removeClass('hidden alert-danger alert-success')
|
|
|
|
.addClass('alert-danger');
|
2013-10-11 18:58:46 +03:00
|
|
|
}, 'json');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="forgot-password-frame" class="frame-container">
|
2013-12-20 19:44:44 +02:00
|
|
|
<h2><?php echo $this->lang->line('forgot_your_password'); ?></h2>
|
|
|
|
<p><?php echo $this->lang->line('type_username_and_email_for_new_password'); ?></p>
|
2013-10-11 18:58:46 +03:00
|
|
|
<hr>
|
|
|
|
<div class="alert hidden"></div>
|
|
|
|
<form>
|
2015-07-08 23:44:52 +03:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="username"><?php echo $this->lang->line('username'); ?></label>
|
|
|
|
<input type="text" id="username" placeholder="<?php echo $this->lang->line('enter_username_here'); ?>" class="form-control" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="email"><?php echo $this->lang->line('email'); ?></label>
|
|
|
|
<input type="text" id="email" placeholder="<?php echo $this->lang->line('enter_email_here'); ?>" class="form-control" />
|
|
|
|
</div>
|
2013-10-11 18:58:46 +03:00
|
|
|
|
2015-07-08 23:44:52 +03:00
|
|
|
<br>
|
2013-10-11 18:58:46 +03:00
|
|
|
|
2013-12-19 12:28:10 +02:00
|
|
|
<button type="submit" id="get-new-password" class="btn btn-primary btn-large">
|
2013-12-20 19:44:44 +02:00
|
|
|
<?php echo $this->lang->line('regenerate_password'); ?>
|
2013-12-19 12:28:10 +02:00
|
|
|
</button>
|
2013-10-11 18:58:46 +03:00
|
|
|
|
2015-05-20 23:41:03 +03:00
|
|
|
<a href="<?php echo $base_url; ?>/index.php/user/login" class="user-login">
|
2015-04-09 22:47:38 +03:00
|
|
|
<?php echo $this->lang->line('go_to_login'); ?></a>
|
2013-10-11 18:58:46 +03:00
|
|
|
</form>
|
|
|
|
</div>
|
2013-12-19 18:28:19 +02:00
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-05-28 00:15:43 +03:00
|
|
|
src="<?php echo $this->config->item('base_url'); ?>/assets/js/general_functions.js"></script>
|
2013-10-11 18:58:46 +03:00
|
|
|
</body>
|
|
|
|
</html>
|