"_TIME":"' . $lang->def('_TIME') . '", "_CLOSE":"' . $lang->def('_CLOSE') . '", "_START":"' . $lang->def('_START') . '", "_END":"' . $lang->def('_END') . '", "_SUBJECT":"' . $lang->def('_TITLE') . '", "_DESCR":"' . $lang->def('_DESCRIPTION') . '", "_SAVE":"' . $lang->def('_SAVE') . '", "_DEL":"' . $lang->def('_DEL') . '", "_NOTITLE":"' . $lang->def('_NOTITLE') . '", "_NEW_EVENT":"' . $lang->def('_NEW_EVENT') . '", "_MOD":"' . $lang->def('_MOD') . '", "_OPERATION_FAILURE":"' . $lang->def('_OPERATION_FAILURE') . '", "_PLS_WAIT":"' . $lang->def('_PLS_WAIT') . '", "_DEL_EVENT":"' . $lang->def('_DEL') . '", "_AREYOUSURE":"' . $lang->def('_AREYOUSURE') . '", "_CATEGORY":"' . $lang->def('_CATEGORY') . '", "_EVENT":"' . $lang->def('_EVENT') . '", "_YES":"' . $lang->def('_YES') . '", "_NO":"' . $lang->def('_NO') . '", "_PRIVATE":"' . $lang->def('_PRIVATE') . '", "_GENERIC":"' . $lang->def('_GENERIC') . '", "_VIDEOCONFERENCE":"' . $lang->def('_VIDEOCONFERENCE') . '", "_MEETING":"' . $lang->def('_MEETING') . '", "_CHAT":"' . $lang->def('_CHAT') . '", "_PUBLISHING":"' . $lang->def('_PUBLISHING') . '", "_ASSESSMENT":"' . $lang->def('_ASSESSMENT') . '" }'; aout($lang_obj); break; }
$request = $_GET['r']; $r = explode('/', $request); $action = $r[1]; if (count($r) == 3) { // Position, class and method defined in the path requested $mvc = ucfirst(strtolower($r[1])) . ucfirst(strtolower($r[0])) . 'Controller'; $action = $r[2]; } else { // Only class and method defined in the path requested $mvc = '' . ucfirst(strtolower($r[0])) . 'AdmController'; $action = $r[1]; } ob_clean(); $controller = new $mvc(strtolower($r[1])); $controller->request($action); aout(ob_get_contents()); ob_clean(); } else { if ($mn == '') { $fl = Get::req('file', DOTY_ALPHANUM, ''); $sf = Get::req('sf', DOTY_ALPHANUM, ''); $aj_file = $GLOBALS['where_' . $plf] . '/lib/' . ($sf ? $sf . '/' : '') . 'ajax.' . $fl . '.php'; } else { if ($plf == 'framework') { $aj_file = $GLOBALS['where_' . $plf] . '/modules/' . $mn . '/ajax.' . $mn . '.php'; } else { $aj_file = $GLOBALS['where_' . $plf] . '/admin/modules/' . $mn . '/ajax.' . $mn . '.php'; } } } include $aj_file;
$url = Get::req('server_url', DOTY_ALPHANUM, false); $parent_id = Get::req('parent_id', DOTY_ALPHANUM, false); $output = array(); $output['body'] = '<form name="tree_addfolder_form" method="POST" action="' . $url . '">' . '<input type="hidden" id="authentic_request_addfolder" name="authentic_request" value="' . Util::getSignature() . '" />' . '<input type="hidden" name="op" value="add_folder" />' . '<input type="hidden" name="parent_id" value="' . $parent_id . '" />' . '<label for="newname">' . "lang._NEW_FOLDER" . ':</label><input type="text" name="newname" /></form>'; $json = new Services_JSON(); aout($json->encode($output)); break; case "add_folder": $output = array(); $output['success'] = true; $output['folder_id'] = 666; $output['label'] = 'label'; $output['is_leaf'] = false; $json = new Services_JSON(); aout($json->encode($output)); break; case "add_element": break; case "del_folder": $output = array(); $output['success'] = true; $json = new Services_JSON(); aout($json->encode($output)); break; case "del_element": break; case "rename_folder": break; case "rename_element": break; }
"content":' . $msgs . ', "name_sender":"' . $name_sender . '", "id_sender":"' . $id_sender . '" }'; aout($content); break; case "sendLine": $wChat = Get::req('wChat', DOTY_ALPHANUM, ''); $id_sender = importVar('id_sender'); $id_receiver = importVar('id_receiver'); $msg = importVar('msg'); $msg = htmlentities(addslashes(trim($msg))); //$msg=$GLOBALS["chat_emo"]->drawEmoticon($msg); $query = "INSERT INTO " . $GLOBALS['prefix_lms'] . "_instmsg SET " . " id_sender='{$id_sender}'," . " id_receiver='{$id_receiver}'," . " msg='{$msg}'," . " status='0'," . " data=now()"; @sql_query($query); aout("1"); break; } function getOnlineUsers() { global $acl_man; $whoIsOnlineList = TrackUser::getListWhoIsOnline($_SESSION['idCourse']); $first = true; $list = '"list":['; $emptylist = true; for ($i = 0; $i < count($whoIsOnlineList); $i++) { $idSt = $whoIsOnlineList[$i]; //if (Docebo::user()->getIdSt()<>$idSt) { $emptylist = false; $userInfo = $acl_man->getUser($idSt, ''); $ids = split("/", $userInfo[1]);
$dlist_sessions = $dlist_sessions->item(0); if ((int) $dlist_sessions->getAttribute('uid') != 0 && $dlist_sessions->getAttribute('uid') !== '') { $gmt = date('P', fromDatetimeToTimestamp($dlist_sessions->getAttribute('date'))); $gmt_split = explode(':', $gmt); $gmt_offset = (int) $gmt_split[0]; $query_control = "SELECT COUNT(*)" . " FROM " . $GLOBALS['prefix_scs'] . "_teleskill_log" . " WHERE roomid = '" . $dlist_sessions->getAttribute('roomid') . "'" . " AND idUser = '******'uid') . "'"; list($control) = sql_fetch_row(sql_query($query_control)); if ($control) { $query = "UPDATE " . $GLOBALS['prefix_scs'] . "_teleskill_log" . " SET role = '" . $dlist_sessions->getAttribute('role') . "'," . " duration = (duration + '" . $dlist_sessions->getAttribute('duration') . "')," . " access = (access + " . ($dlist_sessions->getAttribute('duration') == 0 ? 1 : 0) . ")" . " WHERE roomid = '" . $dlist_sessions->getAttribute('roomid') . "'" . " AND idUser = '******'uid') . "'"; $result = sql_query($query); } else { $query = "INSERT INTO " . $GLOBALS['prefix_scs'] . "_teleskill_log (roomid, idUser, role, `date`, duration, access)" . " VALUES ('" . $dlist_sessions->getAttribute('roomid') . "',\r\n\t\t\t\t\t\t'" . (int) $dlist_sessions->getAttribute('uid') . "',\r\n\t\t\t\t\t\t'" . $dlist_sessions->getAttribute('role') . "',\r\n\t\t\t\t\t\t'" . date('Y-m-d H:i:s', fromDatetimeToTimestamp($dlist_sessions->getAttribute('date')) + $gmt_offset * 3600) . "',\r\n\t\t\t\t\t\t'" . $dlist_sessions->getAttribute('duration') . "',\r\n\t\t\t\t\t\t'" . ($dlist_sessions->getAttribute('duration') == 0 ? 1 : 0) . "')"; $result = sql_query($query); } if ($result) { aout('<?xml version="1.0" encoding="UTF-8"?><ews><errorcode>0</errorcode><errormessage></errormessage></ews>'); } else { aout('<?xml version="1.0" encoding="UTF-8"?><ews><errorcode>1</errorcode><errormessage>Error during insertion in db</errormessage></ews>'); } } else { aout('<?xml version="1.0" encoding="UTF-8"?><ews><errorcode>1</errorcode><errormessage>No data found</errormessage></ews>'); } } else { aout('<?xml version="1.0" encoding="UTF-8"?><ews><errorcode>1</errorcode><errormessage>No data found</errormessage></ews>'); } // ===================================================================================== // close database connection mysql_close($GLOBALS['dbConn']); ob_clean(); print $GLOBALS['operation_result']; ob_end_flush();
$GLOBALS['current_user'] =& DoceboUser::createDoceboUserFromSession('public_area'); //require_once(_i18n_.'/lib.lang.php'); require_once _base_ . '/lib/lib.template.php'; require_once _base_ . '/lib/lib.utils.php'; // security check -------------------------------------------------------------------- chkInput($_GET); chkInput($_POST); chkInput($_COOKIE); $GLOBALS['operation_result'] = ''; function aout($string) { $GLOBALS['operation_result'] .= $string; } // here all the specific code ========================================================== $op = importVar('op'); switch ($op) { case "getmaxroom": $room_type = importVar('room_type'); $maxp = Get::sett($room_type . "_max_participant"); aout($maxp); break; default: aout(0); break; } // ===================================================================================== // close database connection mysql_close($GLOBALS['dbConn']); ob_clean(); print $GLOBALS['operation_result']; ob_end_flush();
} } aout($json->encode($result)); break; case "delete": $node_id = Get::req('node_id', DOTY_INT, 0); $result = array('success' => $treecat->deleteTreeById($node_id)); aout($json->encode($result)); break; case "movefolder": $src = Get::req('src', DOTY_INT, 0); $dest = Get::req('dest', DOTY_INT, 0); $result = array('success' => $treecat->move($src, $dest)); aout($json->encode($result)); break; case "options": $node_id = Get::req('node_id', DOTY_INT, 0); //get properties from DB $count = $treecat->getChildrenCount($node_id); $is_leaf = true; if ($count > 0) { $is_leaf = false; } $node_options = getNodeOptions($node_id, $is_leaf); $result = array('success' => true, 'options' => $node_options, '_debug' => $count); aout($json->encode($result)); break; //invalid command //invalid command default: }
\ ======================================================================== */ /** * @package course management * @subpackage course catalogue * @category ajax server * @author Giovanni Derks * @version $Id:$ * */ if (Docebo::user()->isAnonymous()) { die('You can\'t access'); } require_once $GLOBALS['where_framework'] . '/lib/lib.permission.php'; $op = Get::req('op', DOTY_ALPHANUM, ''); switch ($op) { case "getuserprofile": $lang =& DoceboLanguage::createInstance('standard', 'framework'); $lang->setGlobal(); require_once _base_ . '/lib/lib.user_profile.php'; $id_user = importVar('id_user', true, 0); $profile = new UserProfile($id_user); $profile->init('profile', 'framework', 'modname=directory&op=org_manageuser&id_user='******'ap'); $profile->enableGodMode(); $profile->disableModViewerPolicy(); $value = array("content" => $profile->getUserInfo(), "id_user" => $id_user); require_once _base_ . '/lib/lib.json.php'; $json = new Services_JSON(); $output = $json->encode($value); aout($output); break; }
} aout($json->encode($output)); break; case 'updateField': require_once _base_ . '/lib/lib.json.php'; $json = new Services_JSON(); $id_course = Get::req('idCourse', DOTY_INT, false); $field = Get::req('col', DOTY_MIXED, false); $old_value = Get::req('old_value', DOTY_MIXED, false); $new_value = Get::req('new_value', DOTY_MIXED, false); switch ($field) { case 'name': $res = false; if ($new_value !== '') { $query = "UPDATE " . $GLOBALS['prefix_lms'] . "_course" . " SET name = '" . $new_value . "'" . " WHERE idCourse = " . (int) $id_course; $res = sql_query($query); } aout($json->encode(array('success' => $res, 'new_value' => $new_value, 'old_value' => $old_value))); break; case 'code': $res = false; if ($new_value !== '') { $query = "UPDATE " . $GLOBALS['prefix_lms'] . "_course" . " SET code = '" . $new_value . "'" . " WHERE idCourse = " . (int) $id_course; $res = sql_query($query); } aout($json->encode(array('success' => $res, 'new_value' => stripslashes($new_value), 'old_value' => stripslashes($old_value)))); break; } break; default: }
$rule_man = new AssessmentRule(); $use_default = importVar('usedef', false, 1); $id_rule = importVar('id_rule', true, 0); if ($id_rule != 0) { // load old data ------------------------------------ $rule = $rule_man->getRule($id_rule); $rule_type = $rule[RULE_TYPE]; $setting = $rule_man->parseRuleSetting($rule[RULE_TYPE], $rule[RULE_SETTING]); $score_type_one = isset($setting[0]) ? $setting[0] : ''; $score_type_two = isset($setting[1]) ? $setting[1] : ''; } else { $rule_type = $use_default ? RULE_DEFAULT : RULE_GREATER; $score_type_one = ''; $score_type_two = ''; } $arr_question = array(); $arr_question[RULE_GREATER] = strip_tags(str_replace('[score]', $lang->def('_SCORE'), $lang->def('_RULE_GREATER'))); $arr_question[RULE_LESSER] = strip_tags(str_replace('[score]', $lang->def('_SCORE'), $lang->def('_RULE_LESSER'))); $arr_question[RULE_BETWEEN] = strip_tags(str_replace(array('[score_1]', '[score_2]'), array($lang->def('_SCORE'), $lang->def('_SCORE_2')), $lang->def('_RULE_BETWEEN'))); if ($use_default || $id_rule != 0) { $arr_question[RULE_DEFAULT] = $lang->def('_RULE_DEFAULT'); } aout(Form::getHidden('id_assessment', 'id_assessment', importVar('id_assessment', true, 0))); aout(Form::getHidden('id_rule', 'id_rule', $id_rule)); aout('<b><label for="rule_type">' . $lang->def('_RULE_TEXT') . '</label>: </b>' . Form::getInputDropdown('dropdown_nowh', 'rule_type', 'rule_type', $arr_question, $rule_type, ' onChange="rule_type_change(\'rule_type\', \'score_type_one\', \'score_type_two\');"') . '<br />' . '<br />'); aout(Form::getTextfield($lang->def('_SCORE') . ': ', 'score_type_one', 'score_type_one', 255, $score_type_one)); aout(Form::getTextfield($lang->def('_SCORE_2') . ': ', 'score_type_two', 'score_type_two', 255, $score_type_two)); aout(Form::getBreakRow()); aout('<script type="text/javascript">' . 'rule_type_change(\'rule_type\', \'score_type_one\', \'score_type_two\');' . '</script>'); break; }