/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: Gustav Hatvigsson
  • Date: 2013-05-16 11:36:39 UTC
  • mfrom: (69.1.3 lenasys)
  • Revision ID: gustav.hartvigsson@gmail.com-20130516113639-1kr2ab9naio8k4e6
Merged some changes to the AJAX controller.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
                        //Output JSON data
25
25
                        echo json_encode($data);
26
26
                }
 
27
 
 
28
                /*
 
29
                 *      This function outputs data: user password hint.
 
30
                 */
 
31
                public function ladok() {
 
32
                        $string = $this->input->post('data');
 
33
                        
 
34
                        $parsedArray = $this->user->parseLadok($string);
 
35
                        
 
36
                        if ($parsedArray === FALSE) {
 
37
                                $data = array('status' => FALSE);                               
 
38
                        } else {
 
39
                                //Add users to database
 
40
                                foreach ($parsedArray as $key => $value) {
 
41
                                        $this->user->addUser($parsedArray[$key]['username'], $parsedArray[$key]['firstname'] . ' ' . $parsedArray[$key]['lastname'], $parsedArray[$key]['ssn'], $parsedArray[$key]['ssn'], 'Student', 'Default', $parsedArray[$key]['email']);
 
42
                                }
 
43
                        
 
44
                                $data = array('status' => TRUE);                        
 
45
                        }
 
46
                        
 
47
                        //Output JSON data
 
48
                        echo json_encode($data);
 
49
                }
27
50
                
28
51
                /*
29
52
                 *      This function outputs data: user password hint.