/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk

« back to all changes in this revision

Viewing changes to codeigniter/application/controllers/ajax.php

  • Committer: b11johgu
  • Date: 2013-05-03 11:39:08 UTC
  • mto: This revision was merged to the branch mainline in revision 53.
  • Revision ID: b11johgu@student.his.se-20130503113908-m8nilvexb8atwtvz
Added controllers for examplepage, templatelayout.
Updated models for login and database interaction.
Added ajax controller.
... A lot of stuff has changed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
?>
 
 
b'\\ No newline at end of file'