1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Ajax extends CI_Controller {
/*
* Constructor
*/
function __construct() {
parent::__construct();
//Load required library
$this->load->model('user', '', TRUE);
}
/*
* This function outputs data: user password hint.
*/
public function pwdhint($user) {
$data = array(
'hint' => $this->user->getPasswordHint($user)
);
//Output JSON data
echo json_encode($data);
}
/*
* This function outputs data: user password hint.
*/
public function pwdchange() {
$pwdOld = $this->input->post('currentPwd');
$pwdNew = $this->input->post('newPwd');
$pwdHint = $this->input->post('hintPwd');
$data = array(
'status' => $this->user->changePassword($pwdOld, $pwdNew, $pwdHint)
);
//Output JSON data
echo json_encode($data);
}
}
?>
|