/lenasys/trunk

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