Claroline is an Open Source eLearning and eWorking platform allowing teachers to build effective online courses and to manage learning and collaborative activities on the web. Translated into 35 languages, Claroline has a large worldwide users’ and developers’ community.
$this->setOpt('active_fix_word_entities',1);
$imgFile['name'] = replace_dangerous_char($imgFile['name'],'strict');
inc/lib/file.lib.php和inc/lib/html.lib.php
......
// TODO FIXME is this valid in all charsets ???
if ($strict == 'strict')
{
$string = str_replace('-', '_', $string);
$string = str_replace("'", '', $string);
$string = strtr($string,
'M-@M-AM-BM-CM-DM-EM-`M-aM-bM-cM-dM-eM-RM-SM-TM-UM-VM-XM-rM-sM-tM-uM-,
'AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn');
}
return $string;
}
}
6.53 KB, 下载次数: 140
exercise/lib/answer_multiplechoice.class.php
// add 2 empty answers as minimum requested number of answers
$this->addAnswer();
$this->addAnswer();
[quote] // add 2 empty answers as minimum requested number of answers
$this->addAnswer();
$this->addAnswer();
$this->addAnswer();
$this->addAnswer();
$html .=
'</td>' . "\n"
. '<td valign="top"><textarea rows="7" cols="25" name="answer_'.$i.'">' . htmlspecialchars($answer['answer']) . '</textarea></td>' . "\n"
. '<td><textarea rows="7" cols="25" name="comment_'.$i.'">' . htmlspecialchars($answer['comment']) . '</textarea></td>' . "\n"
. '<td valign="top"><input name="grade_'.$i.'" size="5" value="' . htmlspecialchars($answer['grade']) . '" type="text" /></td>' . "\n"
. '</tr>' . "\n\n";
function replace_dangerous_char($string, $strict = 'loose')
{
$search[] = ' '; $replace[] = '_';
$search[] = '/'; $replace[] = '-';
$search[] = '\\'; $replace[] = '-';
$search[] = '"'; $replace[] = '-';
$search[] = '\''; $replace[] = '_';
$search[] = '?'; $replace[] = '-';
$search[] = '*'; $replace[] = '-';
$search[] = '>'; $replace[] = '';
$search[] = '<'; $replace[] = '-';
$search[] = '|'; $replace[] = '-';
$search[] = ':'; $replace[] = '-';
$search[] = '$'; $replace[] = '-';
$search[] = '('; $replace[] = '-';
$search[] = ')'; $replace[] = '-';
$search[] = '^'; $replace[] = '-';
$search[] = '['; $replace[] = '-';
$search[] = ']'; $replace[] = '-';
$search[] = '..'; $replace[] = '';
$search[] = '?; $replace[] = 'o';
foreach($search as $key=>$char )
{
$string = str_replace($char, $replace[$key], $string);
}
// TODO FIXME is this valid in all charsets ???
if ($strict == 'strict')
{
$string = str_replace('-', '_', $string);
$string = str_replace("'", '', $string);
$string = strtr($string,
'懒旅呐噌忏溴矣哉重蝮趱鲽壬仕栝觌晴掏蜗祉铒仝圮??疡',
'AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn');
}
return $string;
}
// find module or claroline existing tools
$sql = "SELECT DISTINCT ctl.id AS id,
pct.id AS tool_id,
pct.claro_label AS label,
ctl.script_name AS external_name,
ctl.visibility AS visibility,
IFNULL(pct.icon,'tool.gif') AS icon,
ISNULL(ctl.tool_id) AS external,
m.activation ,
m.name AS name,
IFNULL( ctl.script_url ,
pct.script_url ) AS url
FROM `" . $tbl_course_tool_list . "` AS ctl,
`" . $tbl_module . "` AS m,
`" . $tbl_tool_list . "` AS pct
WHERE pct.id = ctl.tool_id
AND pct.claro_label = m.label
". ($active ? " AND m.activation = 'activated' " :"") . "
ORDER BY external, pct.def_rank, ctl.rank";
id claro_label script_url icon def_access def_rank add_in_course access_manager
1 CLDSC index.php info.gif ALL 1 AUTOMATIC COURSE_ADMIN
2 CLCAL agenda.php agenda.gif ALL 2 AUTOMATIC COURSE_ADMIN
id label name activation type script_url
1 CLDSC Course description activated tool index.php
2 CLCAL Agenda activated tool agenda.php
id tool_id rank visibility script_url script_name addedTool
1 1 1 1 NULL NULL YES
2 2 2 1 NULL NULL YES
if( false !== ($modulePath = get_and_unzip_uploaded_package()) )
}
function dir_total_space($dirPath)
{
chdir ($dirPath) ;
$handle = opendir($dirPath);
$sumSize = 0;
while (false !== ($element = readdir($handle) ) )
{
if ( $element == '.' || $element == '..')
{
continue; // skip the current and parent directories
}
if ( is_file($element) )
{
$sumSize += filesize($element);
}
if ( is_dir($element) )
{
$dirList[] = $dirPath.'/'.$element;
}
}
closedir($handle) ;
function dir_total_space($dirPath)
{
chdir ($dirPath) ;
$handle = opendir($dirPath);
$sumSize = 0;
while (false !== ($element = readdir($handle) ) )
{
if ( $element == '.' || $element == '..' || is_link($element) )
{
continue; // skip the current and parent directories
}
if ( is_file($element) )
{
$sumSize += filesize($element);
}
if ( is_dir($element) )
{
$dirList[] = $dirPath.'/'.$element;
}
}
closedir($handle) ;
// the following constant defines the default display of the learning path browser // 0 : display only table of content and content // 1 : display claroline header and footer and table of content, and content define ( 'USE_FRAMES' , 0 ); |
if( $displayFrames ) { ?> <frameset border="0" rows="150,*,70" frameborder="no"> <frame src="topModule.php" name="headerFrame" /> <frame src="startModule.php" name="mainFrame" /> <frame src="bottomModule.php" name="bottomFrame" /> </frameset> <?php } else { ?> <frameset cols="*" border="0"> <frame src="startModule.php" name="mainFrame" /> </frameset> <?php } |
<module>
<label>CLLNP</label>
<name>Learning path</name>
<version>1.0</version>
<license>GPL</license>
<icon>learnpath.gif</icon>
<type>tool</type>
<web>http://www.claroline.net/wiki/CLLNP/</web>
<entry>learningPathList.php</entry>
<description>
<![CDATA[
This tool is an original tool of claroline.
It's able to ordering course step.
Each step can be a text, a document or a qwizz.
This tool can read ane write SCORM
]]>
</description>
<author>
<name>Claro team</name>
<email>devteam@claroline.net</email>
<web>http://www.claroline.net/</web>
</author>
<requirements>
<claroline>
<version>1.8</version>
<configuration>
</configuration>
</claroline>
</requirements>
</module>
<!-- 3 --> <input type="hidden" name="a_3" value="5" /> <!-- 3(end) --> <!-- 4 --> <input type="hidden" name="a_4" value="10" /> <!-- 4(end) --> <!-- 5 --> <input type="hidden" name="a_5" value="16" /> <!-- 5(end) --> <!-- 6 --> <input type="hidden" name="a_6" value="19" /> <!-- 6(end) --> <!-- 7 --> <input type="hidden" name="a_7" value="TRUE" /> <!-- 7(end) --> <!-- 8 --> <input type="hidden" name="a_8" value="22" /> <!-- 8(end) --> <!-- 9 --> <input type="hidden" name="a_9" value="28" /> <!-- 9(end) --> <!-- 10 --> <input type="hidden" name="a_10" value="FALSE" /> <!-- 10(end) --> <!-- 11 --> <input type="hidden" name="a_11" value="31" /> <!-- 11(end) --> <!-- 12 --> <input type="hidden" name="a_12" value="36" /> <!-- 12(end) --> <tr class="headerX"> <th>习题 11 / 88</th> </tr> |
[4]=>
string(993) "O:8:"Question":12:{s:2:"id";i:7;s:5:"title";s:105:"一般来说,矢量图像的文件容量比较小,图像在放大或者旋转等操作是不会失真";s:11:"description";s:31:"<!-- content: html tiny_mce -->";s:10:"attachment";s:0:"";s:4:"type";s:2:"TF";s:5:"grade";s:1:"2";s:14:"questionDirSys";s:70:"/usr/local/www/nginx-dist/claroline/courses/ZSF01/exercise/question_7/";s:14:"questionDirWeb";s:45:"/claroline/courses/ZSF01/exercise/question_7/";s:6:"answer";O:15:"answerTrueFalse":10:{s:2:"id";i:1;s:10:"questionId";i:7;s:12:"trueFeedback";s:0:"";s:9:"trueGrade";s:1:"2";s:13:"falseFeedback";s:0:"";s:10:"falseGrade";s:1:"0";s:13:"correctAnswer";s:4:"TRUE";s:8:"response";s:0:"";s:9:"errorList";a:0:{}s:9:"tblAnswer";s:28:"c_ZSF01_qwz_answer_truefalse";}s:17:"tmpQuestionDirSys";s:76:"/usr/local/www/nginx-dist/claroline/courses/ZSF01/exercise/tmp49f648773ae5a/";s:11:"tblQuestion";s:20:"c_ZSF01_qwz_question";s:22:"tblRelExerciseQuestion";s:33:"c_ZSF01_qwz_rel_exercise_question";}"
字段 类型 整理
code_cours varchar(40) utf8_unicode_ci //课程代码
user_id int(11) UNSIGNED //用户id
profile_id int(11) 否 //用户的类别
isCourseManager tinyint(4) 否 //是不是该课程的管理员
role varchar(60) utf8_unicode_ci //角色
team int(11) 否 //没找到用途
tutor int(11) 否 //是不是“课程”辅导员(还有一个是“组辅导员”,很容易混淆。)
count_user_enrol int(11) 否 //用户自行加入的次数
count_class_enrol int(11) 否 //因为班级加入的次数
$userToolUrlList[] = '<a href="'
. get_path('clarolineRepositoryWeb')
. 'messaging" target="_top">'
. get_lang('My messages').'</a>'
;
location ~ //claro {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /web$fastcgi_script_name;
include fastcgi_params;
}
受此影响的还有wiki的主题。
function document_web_path()
{
return "http://" . $_SERVER['HTTP_HOST'] . dirname( $_SERVER['SCRIPT_NAME'] );
}
$template = new CoreTemplate('platform_index.tpl.php');
$customTemplatePath = get_path('rootSys') . '/platform/templates/'.$template;
$defaultTemplatePath = get_path('includePath') . '/templates/'.$template;
if ( file_exists( $customTemplatePath ) )
{
parent::__construct( $customTemplatePath );
}
elseif ( file_exists( $defaultTemplatePath ) )
{
parent::__construct( $defaultTemplatePath );
}
else ......
$my_html_cont = '<a href="http://www.sdcangyuan.com">sdcangyuan</a>' ;
$template->assign("my_html",$my_html_cont);
public function assign( $name, $value )
{
$this->$name = $value;
}
<?php echo $this->my_html; ?>
$out .= '<tr class="toolbar" valign="top">' . "\n";
// --------------------- display link to previous image ------------------
display_link_to_previous_image($imageList, $fileList, $current);
// --------------------- display title of current image ------------------
$out .= '<th class="' . $titleStyle . '">' ."\n"
. $imgTitle
. '</th>' . "\n"
;
// --------------------- display link to previous image ------------------
display_link_to_next_image($imageList, $fileList, $current);
$out .= '</tr>' . "\n"
. '</table>' . "\n"
;
echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?docView=image&file="
. base64_encode($prevName) . "&cwd=" . $curDirPath
. $searchCmdUrl . "\">", "<< " . basename($prevName) . "</a>\n"
;
if ( isset($_REQUEST['file']) /*&& is_download_url_encoded($_REQUEST['file']) */ )
{
$_REQUEST['file'] = download_url_decode( $_REQUEST['file'] );
}
function download_url_decode( $str )
{
if ( $GLOBALS['is_Apache'] && get_conf('usePrettyUrl', false) )
{
$str = ltrim($str, '/');
return '/' . ltrim( base64_decode( $str ), '/' );
}
else
{
return base64_decode( $str );
}
}
header('Content-Type: text/html; charset=UTF-8'); // Charset
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
echo claro_utf8_encode($out);
elseif( !in_array( $_FILES['CSVfile']['type'], $mimetypes) )
{
$dialogBox->error(get_lang('CSV file is in the bad format'));
$content .= $content_default;
}
$mimetypes[] = 'text/comma-separated-values';
$mimetypes[] = 'text/csv';
$mimetypes[] = 'text/plain';
$mimetypes[] = 'application/csv';
$mimetypes[] = 'application/excel';
$mimetypes[] = 'application/vnd.ms-excel';
$mimetypes[] = 'application/vnd.msexcel';
$mimetypes[] = 'text/anytext';
application/octet-stream
$mimetypes[] = 'application/octet-stream';
allow_call_time_pass_reference On On
allow_url_fopen On On
allow_url_include Off Off
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
diff -r claroline194/claroline/admin/upgrade/upgrade_init_global.inc.php claroline194_orig/claroline/admin/upgrade/upgrade_init_global.inc.php
145c145
< mysql_query("SET NAMES UTF8");//***
---
>
diff -r claroline194/claroline/editor/tiny_mce/tiny_mce/themes/advanced/skins/default/content.css claroline194_orig/claroline/editor/tiny_mce/tiny_mce/themes/advanced/skins/default/content.css
1c1
< body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:8px;}
---
> body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
diff -r claroline194/claroline/editor/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/content.css claroline194_orig/claroline/editor/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/content.css
1c1
< body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:8px;}
---
> body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
diff -r claroline194/claroline/editor/tiny_mce/tiny_mce/themes/simple/skins/default/content.css claroline194_orig/claroline/editor/tiny_mce/tiny_mce/themes/simple/skins/default/content.css
3c3
< font-size: 12px;
---
> font-size: 10px;
diff -r claroline194/claroline/editor/tiny_mce/tiny_mce/themes/simple/skins/o2k7/content.css claroline194_orig/claroline/editor/tiny_mce/tiny_mce/themes/simple/skins/o2k7/content.css
1c1
< body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px;}
---
> body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
diff -r claroline194/claroline/exercise/lib/answer_multiplechoice.class.php claroline194_orig/claroline/exercise/lib/answer_multiplechoice.class.php
75,77c75
< $this->addAnswer(); //added by lsstarboy : sdcangyuan@gmail.com
< $this->addAnswer();
<
---
>
539c537
< . claro_html_textarea_editor('answer_'.$i,$answer['answer'],2,25,'','simple') //modified by lsstarboy : sdcangyuan@gmail.com
---
> . claro_html_textarea_editor('answer_'.$i,$answer['answer'],10,25,'','simple')
542c540
< . claro_html_textarea_editor('comment_'.$i,$answer['comment'],2,25,'','simple')
---
> . claro_html_textarea_editor('comment_'.$i,$answer['comment'],10,25,'','simple')
diff -r claroline194/claroline/inc/lib/core/claroline.lib.php claroline194_orig/claroline/inc/lib/core/claroline.lib.php
222,223c222
< //Added by lsstarboy:sdcangyuan@gmail.com
< mysql_query("SET NAMES UTF8");
---
>
diff -r claroline194/claroline/inc/lib/database/database.lib.php claroline194_orig/claroline/inc/lib/database/database.lib.php
162d161
< mysql_query("SET NAMES UTF8"); //added by lsstarboy:sdcangyuan@gmail.com
diff -r claroline194/claroline/inc/lib/display/banner.lib.php claroline194_orig/claroline/inc/lib/display/banner.lib.php
251c251
< . 'messaging/index.php" target="_top">'
---
> . 'messaging" target="_top">'
253c253
< ; //Modified by lsstarboy:sdcangyuan@gmail.com
---
> ;
diff -r claroline194/claroline/inc/lib/display/footer.lib.php claroline194_orig/claroline/inc/lib/display/footer.lib.php
115c115
< . ' <a href="http://www.claroline.net.cn" target="_blank">Claroline</a> '
---
> . ' <a href="http://www.claroline.net" target="_blank">Claroline</a> '
117d116
< . ' Modified By <a href="mailto:sdcangyuan@gmail.com">lsstarboy</a> '
diff -r claroline194/claroline/inc/lib/faculty.lib.inc.php claroline194_orig/claroline/inc/lib/faculty.lib.inc.php
65c65
< $out .= ' ! '; //Modified by lsstarboy : sdcangyuan@gmail.com
---
> $out .= ' ? ';
diff -r claroline194/claroline/inc/lib/file.lib.php claroline194_orig/claroline/inc/lib/file.lib.php
477,478c477
< // $search[] = '?; $replace[] = 'o';
< // Modified by lsstarboy:sdcangyuan@gmail.com
---
> $search[] = '?; $replace[] = 'o';
diff -r claroline194/claroline/inc/lib/fileDisplay.lib.php claroline194_orig/claroline/inc/lib/fileDisplay.lib.php
378,379c378
< htmlspecialchars( Url::Contextualize( get_module_entry_url('CLDOC') . '?cmd=exChDir&file='.urlencode(base64_encode($urlTrail) ) ) ) )); // Modified by lsstarboy : sdcangyuan@gmail.com
< // htmlspecialchars( Url::Contextualize( get_module_entry_url('CLDOC') . '?cmd=exChDir&file='.base64_encode($urlTrail) ) ) ));
---
> htmlspecialchars( Url::Contextualize( get_module_entry_url('CLDOC') . '?cmd=exChDir&file='.base64_encode($urlTrail) ) ) ));
diff -r claroline194/claroline/inc/lib/fileUpload.lib.php claroline194_orig/claroline/inc/lib/fileUpload.lib.php
125c125
< if ( $element == '.' || $element == '..'|| is_link($element) ) //modified by lsstarboy : sdcangyuan@gmail.com
---
> if ( $element == '.' || $element == '..')
diff -r claroline194/claroline/inc/lib/forum.lib.php claroline194_orig/claroline/inc/lib/forum.lib.php
1121c1121
< get_lang('Forum Index'), // Modified by lsstarboy : sdcangyuan@gmail.com
---
> 'Forum Index',
diff -r claroline194/claroline/inc/templates/banner.tpl.php claroline194_orig/claroline/inc/templates/banner.tpl.php
45,46c45,46
< , array( '%firstName' => $this->user['lastName']
< , '%lastName' => $this->user['firstName'] ) ) ?> :
---
> , array( '%firstName' => $this->user['firstName']
> , '%lastName' => $this->user['lastName'] ) ) ?> :
diff -r claroline194/claroline/install/index.php claroline194_orig/claroline/install/index.php
413d412
< mysql_query("SET NAMES UTF8"); //added by lsstarboy@gmail.com
diff -r claroline194/claroline/messaging/lib/notification/notifier/mail.notifier.lib.php claroline194_orig/claroline/messaging/lib/notification/notifier/mail.notifier.lib.php
130,131c130
< if ( get_conf('smtp_host') =='' ) return 0; //added by lsstarboy : sdcangyuan@gmail.com
<
---
>
diff -r claroline194/claroline/user/AddCSVusers.php claroline194_orig/claroline/user/AddCSVusers.php
301d300
< $mimetypes[] = 'application/octet-stream'; //Added by lsstarboy:sdcangyuan@gmail.com
diff -r claroline194/claroline/wiki/lib/class.dbconnection.php claroline194_orig/claroline/wiki/lib/class.dbconnection.php
179c179
< mysql_query("SET NAMES UTF8"); //added by lsstarboy:sdcangyuan@gmail.com
---
>
diff -r claroline194/claroline/wiki/lib/wiki2xhtml/class.wiki2xhtml.php claroline194_orig/claroline/wiki/lib/wiki2xhtml/class.wiki2xhtml.php
142c142
< $this->setOpt('active_fix_word_entities',0); # Fixe les caract鑢es MS
---
> $this->setOpt('active_fix_word_entities',1); # Fixe les caract鑢es MS
1. function xmlentities( $string, $quote_style = ENT_QUOTES )
2. {
3. static $trans;
4.
5. // remove all html entities before xml encoding
6. // must convert all quotes to avoid remaining html entity in code
7. $string = html_entity_decode($string, ENT_QUOTES);
8.
9. // xml encoding
10. if ( ! isset( $trans ) )
11. {
12. $trans = get_html_translation_table( HTML_ENTITIES, $quote_style );
13. foreach ( array_keys($trans) as $key )
14. {
15. $trans[$key] = '&#'.ord( $key ).';';
16. }
17. // dont translate the '&' in case it is part of &xxx;
18. $trans[chr(3] = '&';
19. }
20.
21. // after the initial translation, _do_ map standalone '&' into '&'
22. $str_temp = preg_replace( "/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3}/u"
23. , "&"
24. , strtr( $string, $trans )
25. );
26. return $str_temp;
27. }
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |