/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: elof.bigestans at gmail
  • Date: 2013-05-27 12:01:10 UTC
  • mfrom: (105 lenasys_b)
  • mto: This revision was merged to the branch mainline in revision 107.
  • Revision ID: elof.bigestans@gmail.com-20130527120110-05decmi92i3qjupg
* Merged trunk
* Added new files relating to login functionality 
* Added login and logout functions to start controller

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
                function showPopup($popupName) {
22
22
                        $headTagData = array(
23
 
                                'cssFiles' => array('bannermenu', 'popup')
 
23
                                'cssFiles' => array('popup'),
 
24
                                'jsFiles' => array('login')
24
25
                        );
25
26
 
26
27
                        $userInfo = array(
30
31
 
31
32
                        // Loads head views, supplying CSS and JS data
32
33
                        $this->load->view('headTag', array('headTagData' => $headTagData));
33
 
                        $this->load->view('bannermenu', $userInfo);
34
34
 
35
35
                        $this->load->view('popup/'.$popupName);
36
36
                }
37
37
                
38
38
                /*
 
39
                 *      This function return TRUE if the user is logged in and FALSE otherwise.
 
40
                 */
 
41
                public function isLoggedIn() {
 
42
                        if ($this->user->isLoggedIn()) {
 
43
                                echo 'yes';
 
44
                        }
 
45
                        else {
 
46
                                echo 'no';
 
47
                        }
 
48
                }
 
49
                
 
50
                /*
39
51
                 *      This function outputs data: user password hint.
40
52
                 */
41
53
                public function pwdhint() {
42
 
                $user = $this->input->post('hintPwd');
43
 
                        $data = array(
44
 
                                'hint' => $this->user->getPasswordHint($user)
45
 
                        );
 
54
                        $this->load->model('user');
 
55
                        if($this->input->post('username')) {
 
56
                                $username = $this->input->post('username');
 
57
                                $data = array(
 
58
                                        'hint' => $this->user->getPasswordHint($username)
 
59
                                );
46
60
                        
47
 
                        //Output JSON data
48
 
                        echo json_encode($data);
 
61
                                //Output JSON data
 
62
                                echo json_encode($data);
 
63
                        }
49
64
                }
50
65
 
51
66
                /*