<?php

require_once "../helper.php";
require_once "../classes/User.class.php";
$helper = new Helper();
$userObj = new User();
if (($result = $userObj->checkLoggedIn()) && !isset($result['error'])) {
    $result = $userObj->editEducation($result['id'], $_POST);
}
echo json_encode($result);
Example #2
0
function saveSettings()
{
    global $error;
    User::checkLoggedIn();
    global $error;
    $arr_submit = array(array('language', 'string', false, ''), array('other_language', 'string', false, ''), array('default_view', 'string', false, ''), array('timezone', 'string', false, ''), array('user_id', 'int', true, ''));
    $frm_submitted = validate_var($arr_submit);
    if (!$error) {
        $arr_user = User::getUser();
        if ($frm_submitted['user_id'] == $arr_user['user_id']) {
            unset($frm_submitted['user_id']);
            Settings::saveSettings($frm_submitted, '', $arr_user['user_id']);
        } else {
            echo json_encode(array('success' => false, 'error' => 'NO rights to do that'));
            exit;
        }
    } else {
        echo json_encode(array('success' => false, 'error' => $error));
        exit;
    }
    echo json_encode(array('success' => true));
    exit;
    //$obj_smarty->assign('active', 'settings');
    //$obj_smarty->assign('settings', Settings::getSettings($arr_user['user_id']));
    //$obj_smarty->display(FULLCAL_DIR.'/view/user_panel.tpl');
    //exit;
}
Example #3
0
<?php

require_once "../../config/helper.php";
require_once "../classes/User.class.php";
$helper = new Helper();
$userObj = new User();
$result = $userObj->checkLoggedIn();
echo json_encode($result);