示例#1
0
<?php

/* For licensing terms, see /license.txt */
/**
 * Responses to AJAX calls
 */
//require_once '../global.inc.php';
\Chamilo\CoreBundle\Framework\Container::$legacyTemplate = 'layout_empty.html.twig';
api_protect_admin_script();
$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : null;
switch ($action) {
    case 'update_changeable_setting':
        $url_id = api_get_current_access_url_id();
        if (api_is_global_platform_admin() && $url_id == 1) {
            if (isset($_GET['id']) && !empty($_GET['id'])) {
                $params = array('variable = ? ' => array($_GET['id']));
                $data = api_get_settings_params($params);
                if (!empty($data)) {
                    foreach ($data as $item) {
                        $params = array('id' => $item['id'], 'access_url_changeable' => $_GET['changeable']);
                        api_set_setting_simple($params);
                    }
                }
                echo '1';
            }
        }
        break;
    case 'version':
        echo version_check();
        break;
    case 'get_extra_content':
<?php

/* For licensing terms, see /license.txt */
/**
 * Form for group message
 * @package chamilo.social
 */
$cidReset = true;
//require_once '../inc/global.inc.php';
\Chamilo\CoreBundle\Framework\Container::$legacyTemplate = 'layout_one_col_no_content.html.twig';
api_block_anonymous_users();
if (api_get_setting('social.allow_social_tool') != 'true') {
    api_not_allowed();
}
$tok = Security::get_token();
if (isset($_REQUEST['user_friend'])) {
    $info_user_friend = array();
    $info_path_friend = array();
    $userfriend_id = intval($_REQUEST['user_friend']);
    $info_user_friend = api_get_user_info($userfriend_id);
    $info_path_friend = UserManager::get_user_picture_path_by_id($userfriend_id, 'web');
}
$group_id = isset($_GET['group_id']) ? intval($_GET['group_id']) : null;
$message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null;
$actions = array('add_message_group', 'edit_message_group', 'reply_message_group');
$allowed_action = isset($_GET['action']) && in_array($_GET['action'], $actions) ? Security::remove_XSS($_GET['action']) : '';
$to_group = '';
$subject = '';
$message = '';
$usergroup = new UserGroup();
if (!empty($group_id) && $allowed_action) {