1
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
3
class Ajax extends CI_Controller {
7
function __construct() {
10
//Load required library
11
$this->load->model('user', '', TRUE);
15
* This function loads a popupview to be displayed, the argument is the name of the popupview
17
public function popup($popupName) {
18
$popup = $this->load->view('popup/'.$popupName, '', TRUE);
24
* This function outputs data: user password hint.
26
public function pwdhint() {
27
$user = $this->input->post('hintPwd');
29
'hint' => $this->user->getPasswordHint($user)
33
echo json_encode($data);
37
* This function outputs data: user password hint.
39
public function ladok() {
40
$string = $this->input->post('data');
42
$parsedArray = $this->user->parseLadok($string);
44
if ($parsedArray === FALSE) {
45
$data = array('status' => FALSE);
47
//Add users to database
48
foreach ($parsedArray as $key => $value) {
49
$this->user->addUser($parsedArray[$key]['username'], $parsedArray[$key]['firstname'] . ' ' . $parsedArray[$key]['lastname'], $parsedArray[$key]['ssn'], $parsedArray[$key]['ssn'], 'Student', 'Default', $parsedArray[$key]['email']);
52
$data = array('status' => TRUE);
56
echo json_encode($data);
60
* This function outputs data: user password hint.
62
public function pwdchange() {
63
$pwdOld = $this->input->post('currentPwd');
64
$pwdNew = $this->input->post('newPwd');
65
$pwdHint = $this->input->post('hintPwd');
68
'status' => $this->user->changePassword($pwdOld, $pwdNew, $pwdHint)
72
echo json_encode($data);
75
public function categoryOrderDecrease(){
76
$pwdOld = $this->input->post('currentPwd');
77
$pwdNew = $this->input->post('newPwd');
b'\\ No newline at end of file'