芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/public_html/cepali/repository/equella/callback.php
. /** * Callback for equella repository. * * @since Moodle 2.3 * @package repository_equella * @copyright 2012 Dongsheng Cai {@link http://dongsheng.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require(__DIR__.'/../../config.php'); require_once($CFG->dirroot . '/repository/lib.php'); $json = required_param('tlelinks', PARAM_RAW); require_login(); $decodedinfo = json_decode($json); $info = array_pop($decodedinfo); $url = ''; if (isset($info->url)) { $url = s(clean_param($info->url, PARAM_URL)); } $filename = ''; // Use $info->filename if exists, $info->name is a display name, // it may not have extension if (isset($info->filename)) { $filename = s(clean_param($info->filename, PARAM_FILE)); } else if (isset($info->name)) { $filename = s(clean_param($info->name, PARAM_FILE)); } $thumbnail = ''; if (isset($info->thumbnail)) { $thumbnail = s(clean_param($info->thumbnail, PARAM_URL)); } $author = ''; if (isset($info->owner)) { $author = s(clean_param($info->owner, PARAM_NOTAGS)); } $license = ''; if (isset($info->license)) { $license = s(clean_param($info->license, PARAM_ALPHAEXT)); } $source = base64_encode(json_encode(array('url'=>$url,'filename'=>$filename))); $sourcekey = sha1($source . repository::get_secret_key() . sesskey()); $js =<<