56 lines
2.0 KiB
PHP
56 lines
2.0 KiB
PHP
<?php
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class Password_recovery extends CI_Controller {
|
|
|
|
public function index() {
|
|
//echo "ameye kvkgkg";
|
|
$data['action_message'] = "";
|
|
|
|
|
|
if ($_POST) {
|
|
|
|
$data['email'] = $this->input->post('email');
|
|
if ($data['email'] == '') {
|
|
$out['error'] = 'Please specify valid emal to continue';
|
|
$data['action_message'] = "<div class=\"text-left\"><div class=\"alert alert-danger no-border\">" . $out['error'] . "</div></div>";
|
|
} else {
|
|
//WRENCHBOARD_ACCOUNT_RESETPASS
|
|
|
|
$this->resetMemberPass($data['email']);
|
|
|
|
$out['error'] = "If we find your email, you will receive a link to reset your password. Please use or <a href='/contact'>contact form</a> if you did not get our message after few minutes. ";
|
|
$data['action_message'] = "<div class=\"text-left\"><div class=\"alert alert-info no-border\">" . $out['error'] . "</div></div>";
|
|
}
|
|
}
|
|
$data["message"] = "Enter your account username, Email.<br> We will send you an email to reset your password";
|
|
$this->load->view('users/view_external_header');
|
|
$this->load->view('users/view_password_recovery', $data);
|
|
$this->load->view('users/view_external_footer');
|
|
}
|
|
|
|
var $actionMessage = '';
|
|
|
|
private function resetMemberPass($email) {
|
|
$this->actionMessage = '';
|
|
//$group_id = $group_id + 0; // just making sure it is number
|
|
|
|
|
|
$x['email'] = $email;
|
|
|
|
|
|
$x['action'] = WRENCHBOARD_ACCOUNT_RESETPASS;
|
|
$this->load->model('backend_model');
|
|
$out = array();
|
|
$res = $this->backend_model->wrenchboard_api($x, $out);
|
|
if ($res == PHP_CREATED_OK) {
|
|
$this->actionMessage = 'Group Created';
|
|
} else {
|
|
$this->actionMessage = 'Unable to create job group...';
|
|
}
|
|
return $this->actionMessage;
|
|
}
|
|
|
|
}
|