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);
16
* This function outputs data: user password hint.
18
public function pwdhint() {
19
$user = $this->input->post('hintPwd');
21
'hint' => $this->user->getPasswordHint($user)
25
echo json_encode($data);
29
* This function outputs data: user password hint.
31
public function ladok() {
32
$string = $this->input->post('data');
34
$parsedArray = $this->user->parseLadok($string);
36
if ($parsedArray === FALSE) {
37
$data = array('status' => FALSE);
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']);
44
$data = array('status' => TRUE);
48
echo json_encode($data);
52
* This function outputs data: user password hint.
54
public function pwdchange() {
55
$pwdOld = $this->input->post('currentPwd');
56
$pwdNew = $this->input->post('newPwd');
57
$pwdHint = $this->input->post('hintPwd');
60
'status' => $this->user->changePassword($pwdOld, $pwdNew, $pwdHint)
64
echo json_encode($data);
67
public function categoryOrderDecrease(){
68
$pwdOld = $this->input->post('currentPwd');
69
$pwdNew = $this->input->post('newPwd');
b'\\ No newline at end of file'