2013-10-11 18:58:46 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2013-12-20 19:44:44 +02:00
|
|
|
<title><?php echo $this->lang->line('forgot_your_password') . ' - ' . $company_name; ?></title>
|
2013-10-11 18:58:46 +03:00
|
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
|
|
|
|
|
|
<?php // INCLUDE JS FILES ?>
|
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-01-29 00:53:13 +02:00
|
|
|
src="<?php echo $this->config->base_url(); ?>/assets/js/libs/jquery/jquery.min.js"></script>
|
2013-10-11 18:58:46 +03:00
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-01-29 00:53:13 +02:00
|
|
|
src="<?php echo $this->config->base_url(); ?>/assets/js/libs/bootstrap/bootstrap.min.js"></script>
|
2013-10-11 18:58:46 +03:00
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-01-29 00:53:13 +02:00
|
|
|
src="<?php echo $this->config->base_url(); ?>/assets/js/libs/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-01-29 00:53:13 +02:00
|
|
|
href="<?php echo $this->config->base_url(); ?>/assets/css/libs/bootstrap/bootstrap.css">
|
2013-10-11 18:58:46 +03:00
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
|
|
|
type="text/css"
|
2015-01-29 00:53:13 +02:00
|
|
|
href="<?php echo $this->config->base_url(); ?>/assets/css/libs/bootstrap/bootstrap-responsive.css">
|
2013-10-11 18:58:46 +03:00
|
|
|
|
|
|
|
<?php // SET FAVICON FOR PAGE ?>
|
|
|
|
<link
|
|
|
|
rel="icon"
|
|
|
|
type="image/x-icon"
|
2015-01-29 00:53:13 +02:00
|
|
|
href="<?php echo $this->config->base_url(); ?>/assets/img/favicon.ico">
|
2013-10-11 18:58:46 +03:00
|
|
|
|
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
background-color: #CAEDF3;
|
|
|
|
}
|
|
|
|
|
|
|
|
#forgot-password-frame {
|
|
|
|
width: 630px;
|
|
|
|
margin: 150px auto 0 auto;
|
|
|
|
background: #FFF;
|
|
|
|
border: 1px solid #DDDADA;
|
|
|
|
padding: 70px;
|
|
|
|
}
|
|
|
|
|
|
|
|
label {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.user-login{
|
|
|
|
margin-left: 20px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
var GlobalVariables = {
|
|
|
|
'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-01-29 00:53:13 +02:00
|
|
|
var postUrl = GlobalVariables.baseUrl + '/user/ajax_forgot_password';
|
2013-10-11 18:58:46 +03:00
|
|
|
var postData = {
|
|
|
|
'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.');
|
|
|
|
}
|
|
|
|
$('.alert').removeClass('hidden');
|
|
|
|
}, '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>
|
2013-12-20 19:44:44 +02:00
|
|
|
<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="span3" />
|
2013-10-11 18:58:46 +03:00
|
|
|
|
2013-12-20 19:44:44 +02:00
|
|
|
<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="span3" />
|
2013-10-11 18:58:46 +03:00
|
|
|
|
|
|
|
<br><br>
|
|
|
|
|
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
|
|
|
|
2013-12-19 12:28:10 +02:00
|
|
|
<a href="<?php echo $base_url; ?>user/login" class="user-login">
|
2013-12-20 19:44:44 +02:00
|
|
|
<?php echo $this->lang->line('go_to_login'); ?>
|
2013-12-19 12:28:10 +02:00
|
|
|
</a>
|
2013-10-11 18:58:46 +03:00
|
|
|
</form>
|
|
|
|
</div>
|
2013-12-19 18:28:19 +02:00
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-01-29 00:53:13 +02:00
|
|
|
src="<?php echo $this->config->base_url(); ?>/assets/js/general_functions.js"></script>
|
2013-10-11 18:58:46 +03:00
|
|
|
</body>
|
|
|
|
</html>
|