skala
cvargas 16 years ago
commit c18d531ae6
  1. 6
      main/forum/forumfunction.inc.php
  2. 2
      main/forum/reply.php
  3. 9
      main/forum/viewthread_flat.inc.php
  4. 7
      main/forum/viewthread_nested.inc.php
  5. 16
      main/forum/viewthread_threaded.inc.php
  6. 12
      main/inc/lib/main_api.lib.php
  7. 1228
      main/install/install.lib.php
  8. 3
      main/install/update-db-1.6.x-1.8.0.inc.php
  9. 2
      main/install/update-db-1.8.0-1.8.2.inc.php
  10. 4
      main/install/update-db-1.8.2-1.8.3.inc.php
  11. 3
      main/install/update-db-1.8.3-1.8.4.inc.php
  12. 3
      main/install/update-db-1.8.4-1.8.5.inc.php
  13. 2
      main/install/update-db-1.8.5-1.8.6.inc.php
  14. 2
      main/install/update-db-1.8.6-1.8.6.1.inc.php
  15. 2
      main/install/update-db-1.8.6.1-1.8.6.2.inc.php
  16. 2
      main/install/update-db-1.8.6.2-1.8.7.inc.php
  17. 8
      main/work/work.php

@ -2229,8 +2229,8 @@ function store_reply($values) {
if ($upload_ok) { if ($upload_ok) {
// We first store an entry in the forum_post table // We first store an entry in the forum_post table
$sql="INSERT INTO $table_posts (post_title, post_text, thread_id, forum_id, poster_id, post_date, post_notification, post_parent_id, visible) $sql="INSERT INTO $table_posts (post_title, post_text, thread_id, forum_id, poster_id, post_date, post_notification, post_parent_id, visible)
VALUES ('".Database::escape_string(Security::remove_XSS($values['post_title']))."', VALUES ('".Database::escape_string($values['post_title'])."',
'".Database::escape_string(isset($values['post_text']) ? Security::remove_XSS(stripslashes(api_html_entity_decode($values['post_text'])),COURSEMANAGERLOWSECURITY) : null)."', '".Database::escape_string(isset($values['post_text']) ? (api_html_entity_decode($values['post_text'])) : null)."',
'".Database::escape_string($values['thread_id'])."', '".Database::escape_string($values['thread_id'])."',
'".Database::escape_string($values['forum_id'])."', '".Database::escape_string($values['forum_id'])."',
'".Database::escape_string($_user['user_id'])."', '".Database::escape_string($_user['user_id'])."',
@ -2265,7 +2265,7 @@ function store_reply($values) {
// Storing the attachments if any // Storing the attachments if any
if ($result) { if ($result) {
$sql='INSERT INTO '.$forum_table_attachment.'(filename,comment, path, post_id,size) '. $sql='INSERT INTO '.$forum_table_attachment.'(filename,comment, path, post_id,size) '.
"VALUES ( '".Database::escape_string($file_name)."', '".Database::escape_string($comment)."', '".Database::escape_string($new_file_name)."' , '".$new_post_id."', '".$_FILES['user_upload']['size']."' )"; "VALUES ( '".Database::escape_string($file_name)."', '".Database::escape_string($comment)."', '".Database::escape_string($new_file_name)."' , '".$new_post_id."', '".intval($_FILES['user_upload']['size'])."' )";
$result=Database::query($sql); $result=Database::query($sql);
$message.=' / '.get_lang('FileUploadSucces'); $message.=' / '.get_lang('FileUploadSucces');
$last_id=Database::insert_id(); $last_id=Database::insert_id();

@ -215,7 +215,7 @@ $my_elements = isset($_SESSION['formelements']) ? $_SESSION['formelements'] : ''
$values=show_add_post_form(Security::remove_XSS($my_action,$my_post, $my_elements)); // note: this has to be cleaned first $values=show_add_post_form(Security::remove_XSS($my_action,$my_post, $my_elements)); // note: this has to be cleaned first
if (!empty($values) AND isset($_POST['SubmitPost'])) { if (!empty($values) AND isset($_POST['SubmitPost'])) {
store_reply(Security::remove_XSS($values)); store_reply($values);
} }
/* /*

@ -107,17 +107,12 @@ foreach ($rows as $row) {
$post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified')); $post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified'));
} }
// The post title // The post title
echo "\t\t<td class=\"$titleclass\">".prepare4display($row['post_title'])."</td>\n"; echo "\t\t<td class=\"$titleclass\">".prepare4display(Security::remove_XSS($row['post_title'], STUDENT))."</td>\n";
echo "\t</tr>\n"; echo "\t</tr>\n";
// The post message // The post message
//we can see now the html tags
$row['post_text']= Security::remove_XSS($row['post_text'], STUDENT);
echo "\t<tr>\n"; echo "\t<tr>\n";
echo "\t\t<td class=\"$messageclass\">".prepare4display($row['post_text'])."</td>\n"; echo "\t\t<td class=\"$messageclass\">".prepare4display(Security::remove_XSS($row['post_text'], STUDENT))."</td>\n";
echo "\t</tr>\n"; echo "\t</tr>\n";
// The check if there is an attachment // The check if there is an attachment

@ -105,15 +105,12 @@ foreach ($rows as $post) {
$post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified')); $post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified'));
} }
// The post title // The post title
echo "\t\t<td class=\"$titleclass\">".prepare4display($post['post_title'])."</td>\n"; echo "\t\t<td class=\"$titleclass\">".prepare4display(Security::remove_XSS($post['post_title'], STUDENT))."</td>\n";
echo "\t</tr>\n"; echo "\t</tr>\n";
// The post message // The post message
$post['post_text']= Security::remove_XSS($post['post_text'], STUDENT);
echo "\t<tr>\n"; echo "\t<tr>\n";
echo "\t\t<td class=\"$messageclass\">".prepare4display($post['post_text'])."</td>\n"; echo "\t\t<td class=\"$messageclass\">".prepare4display(Security::remove_XSS($post['post_text'], STUDENT))."</td>\n";
echo "\t</tr>\n"; echo "\t</tr>\n";

@ -36,6 +36,7 @@
$rows = get_posts($_GET['thread']); // note: this has to be cleaned first $rows = get_posts($_GET['thread']); // note: this has to be cleaned first
$rows = calculate_children($rows); $rows = calculate_children($rows);
if ($_GET['post']) { if ($_GET['post']) {
$display_post_id = intval($_GET['post']); // note: this has to be cleaned first $display_post_id = intval($_GET['post']); // note: this has to be cleaned first
} else { } else {
@ -62,8 +63,7 @@ $thread_structure="<div class=\"structure\">".get_lang('Structure')."</div>";
$counter=0; $counter=0;
$count=0; $count=0;
$prev_next_array=array(); $prev_next_array=array();
foreach ($rows as $post) foreach ($rows as $post) {
{
$counter++; $counter++;
$indent=$post['indent_cnt']*'20'; $indent=$post['indent_cnt']*'20';
$thread_structure.= "<div style=\"margin-left: ".$indent."px;\">"; $thread_structure.= "<div style=\"margin-left: ".$indent."px;\">";
@ -79,7 +79,7 @@ foreach ($rows as $post)
$thread_structure.= $post_image; $thread_structure.= $post_image;
if ($_GET['post']==$post['post_id'] OR ($counter==1 AND !isset($_GET['post']))) if ($_GET['post']==$post['post_id'] OR ($counter==1 AND !isset($_GET['post'])))
{ {
$thread_structure.='<strong>'.prepare4display($post['post_title']).'</strong></div>'; $thread_structure.='<strong>'.prepare4display(Security::remove_XSS($post['post_title'],STUDENT)).'</strong></div>';
$prev_next_array[]=$post['post_id']; $prev_next_array[]=$post['post_id'];
} }
else else
@ -93,7 +93,7 @@ foreach ($rows as $post)
$class=''; $class='';
} }
$count_loop=($count==0)?'&id=1' : ''; $count_loop=($count==0)?'&id=1' : '';
$thread_structure.= "<a href=\"viewthread.php?".api_get_cidreq()."&forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread'])."&amp;post=".$post['post_id']."&amp;origin=$origin$count_loop\" $class>".prepare4display($post['post_title'])."</a></div>\n"; $thread_structure.= "<a href=\"viewthread.php?".api_get_cidreq()."&forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread'])."&amp;post=".$post['post_id']."&amp;origin=$origin$count_loop\" $class>".prepare4display(Security::remove_XSS($post['post_title'],STUDENT))."</a></div>\n";
$prev_next_array[]=$post['post_id']; $prev_next_array[]=$post['post_id'];
} }
$count++; $count++;
@ -159,8 +159,7 @@ echo '</center>';
//-------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------
// the style depends on the status of the message: approved or not // the style depends on the status of the message: approved or not
if ($rows[$display_post_id]['visible']=='0') if ($rows[$display_post_id]['visible']=='0') {
{
$titleclass='forum_message_post_title_2_be_approved'; $titleclass='forum_message_post_title_2_be_approved';
$messageclass='forum_message_post_text_2_be_approved'; $messageclass='forum_message_post_text_2_be_approved';
$leftclass='forum_message_left_2_be_approved'; $leftclass='forum_message_left_2_be_approved';
@ -277,13 +276,12 @@ if ($rows[$display_post_id]['post_notification']=='1' AND $rows[$display_post_id
$post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified')); $post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified'));
} }
// The post title // The post title
echo "\t\t<td class=\"$titleclass\">".prepare4display(Security::remove_XSS($rows[$display_post_id]['post_title']))."</td>\n"; echo "\t\t<td class=\"$titleclass\">".prepare4display(Security::remove_XSS($rows[$display_post_id]['post_title'], STUDENT))."</td>\n";
echo "\t</tr>\n"; echo "\t</tr>\n";
// The post message // The post message
echo "\t<tr>\n"; echo "\t<tr>\n";
echo "\t\t<td class=\"$messageclass\">".prepare4display(Security::remove_XSS($rows[$display_post_id]['post_text']), STUDENT)."</td>\n"; echo "\t\t<td class=\"$messageclass\">".prepare4display(Security::remove_XSS($rows[$display_post_id]['post_text'], STUDENT))."</td>\n";
echo "\t</tr>\n"; echo "\t</tr>\n";
// The check if there is an attachment // The check if there is an attachment

@ -4036,13 +4036,14 @@ function api_get_access_url_from_user($user_id) {
} }
/** /**
* @author florespaz@bidsoftperu.com * Gets the status of a user in a course
* @param integer $user_id * @param int user_id
* @param string $course_code * @param string course_code
* @return integer status * @return int user status
*/ */
function api_get_status_of_user_in_course ($user_id, $course_code) { function api_get_status_of_user_in_course ($user_id, $course_code) {
$tbl_rel_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER); $tbl_rel_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
if (!empty($user_id) && !empty($course_code)) {
$user_id = Database::escape_string(intval($user_id)); $user_id = Database::escape_string(intval($user_id));
$course_code = Database::escape_string($course_code); $course_code = Database::escape_string($course_code);
$sql = 'SELECT status FROM '.$tbl_rel_course_user.' $sql = 'SELECT status FROM '.$tbl_rel_course_user.'
@ -4050,6 +4051,9 @@ function api_get_status_of_user_in_course ($user_id, $course_code) {
$result = Database::query($sql); $result = Database::query($sql);
$row_status = Database::fetch_array($result, 'ASSOC'); $row_status = Database::fetch_array($result, 'ASSOC');
return $row_status['status']; return $row_status['status'];
} else {
return 0;
}
} }
/** /**

File diff suppressed because it is too large Load Diff

@ -26,7 +26,8 @@
// Check if we come from index.php or update_courses.php - otherwise display error msg // Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) { if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) {
// Check if the current Dokeos install is elligible for update
// Check if the current Dokeos install is eligible for update
if (empty($updateFromConfigFile) || !file_exists($_POST['updatePath'].$updateFromConfigFile) || !in_array(get_config_param('clarolineVersion'), $update_from_version_6)) { if (empty($updateFromConfigFile) || !file_exists($_POST['updatePath'].$updateFromConfigFile) || !in_array(get_config_param('clarolineVersion'), $update_from_version_6)) {
echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br /> echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br />

@ -27,7 +27,7 @@
// Check if we come from index.php or update_courses.php - otherwise display error msg // Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) { if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) {
//check if the current Dokeos install is elligible for update // Check if the current Dokeos install is eligible for update
if (!file_exists('../inc/conf/configuration.php')) { if (!file_exists('../inc/conf/configuration.php')) {
echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br /> echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br />
'.get_lang('PleasGoBackToStep1').'. '.get_lang('PleasGoBackToStep1').'.

@ -24,10 +24,10 @@
============================================================================== ==============================================================================
*/ */
//check if we come from index.php or update_courses.php - otherwise display error msg // Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) { if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) {
// Check if the current Dokeos install is elligible for update // Check if the current Dokeos install is eligible for update
if (!file_exists('../inc/conf/configuration.php')) { if (!file_exists('../inc/conf/configuration.php')) {
echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br /> echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br />
'.get_lang('PleasGoBackToStep1').'. '.get_lang('PleasGoBackToStep1').'.

@ -26,7 +26,8 @@
// Check if we come from index.php or update_courses.php - otherwise display error msg // Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) { if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) {
//check if the current Dokeos install is elligible for update
// Check if the current Dokeos install is eligible for update
if (!file_exists('../inc/conf/configuration.php')) { if (!file_exists('../inc/conf/configuration.php')) {
echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br /> echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br />
'.get_lang('PleasGoBackToStep1').'. '.get_lang('PleasGoBackToStep1').'.

@ -29,7 +29,8 @@ $new_file_version = '1.8.5';
// Check if we come from index.php or update_courses.php - otherwise display error msg // Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) { if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) {
//check if the current Dokeos install is elligible for update
// Check if the current Dokeos install is eligible for update
if (!file_exists('../inc/conf/configuration.php')) { if (!file_exists('../inc/conf/configuration.php')) {
echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br /> echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br />
'.get_lang('PleasGoBackToStep1').'. '.get_lang('PleasGoBackToStep1').'.

@ -30,7 +30,7 @@ $new_file_version = '1.8.6';
// Check if we come from index.php or update_courses.php - otherwise display error msg // Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) { if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) {
// Check if the current Dokeos install is elligible for update // Check if the current Dokeos install is eligible for update
if (!file_exists('../inc/conf/configuration.php')) { if (!file_exists('../inc/conf/configuration.php')) {
echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br /> echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br />
'.get_lang('PleasGoBackToStep1').'. '.get_lang('PleasGoBackToStep1').'.

@ -30,7 +30,7 @@ $new_file_version = '1.8.6.1';
//check if we come from index.php or update_courses.php - otherwise display error msg //check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) { if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) {
//check if the current Dokeos install is elligible for update // Check if the current Dokeos install is eligible for update
if (!file_exists('../inc/conf/configuration.php')) { if (!file_exists('../inc/conf/configuration.php')) {
echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br /> echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br />
'.get_lang('PleasGoBackToStep1').'. '.get_lang('PleasGoBackToStep1').'.

@ -30,7 +30,7 @@ $new_file_version = '1.8.6.2';
// Check if we come from index.php or update_courses.php - otherwise display error msg // Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) { if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) {
// Check if the current Dokeos install is elligible for update // Check if the current Dokeos install is eligible for update
if (!file_exists('../inc/conf/configuration.php')) { if (!file_exists('../inc/conf/configuration.php')) {
echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br /> echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br />
'.get_lang('PleasGoBackToStep1').'. '.get_lang('PleasGoBackToStep1').'.

@ -30,7 +30,7 @@ $new_file_version = '1.8.7';
// Check if we come from index.php or update_courses.php - otherwise display error msg // Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) { if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) {
// Check if the current Dokeos install is elligible for update // Check if the current Dokeos install is eligible for update
if (!file_exists('../inc/conf/configuration.php')) { if (!file_exists('../inc/conf/configuration.php')) {
echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br /> echo '<strong>'.get_lang('Error').' !</strong> Dokeos '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br />
'.get_lang('PleasGoBackToStep1').'. '.get_lang('PleasGoBackToStep1').'.

@ -1259,6 +1259,8 @@ if ($is_course_member) {
if (!empty ($error_message)) { if (!empty ($error_message)) {
Display :: display_error_message($error_message); Display :: display_error_message($error_message);
} }
$show_progress_bar = false;
if ($submitGroupWorkUrl) { if ($submitGroupWorkUrl) {
// For user comming from group space to publish his work // For user comming from group space to publish his work
$realUrl = str_replace($_configuration['root_sys'], $_configuration['root_web'], str_replace("\\", "/", realpath($submitGroupWorkUrl))); $realUrl = str_replace($_configuration['root_sys'], $_configuration['root_web'], str_replace("\\", "/", realpath($submitGroupWorkUrl)));
@ -1281,6 +1283,7 @@ if ($is_course_member) {
} else { } else {
// else standard upload option // else standard upload option
$form->addElement('file', 'file', get_lang('UploadADocument'), 'size="40" onchange="updateDocumentTitle(this.value)"'); $form->addElement('file', 'file', get_lang('UploadADocument'), 'size="40" onchange="updateDocumentTitle(this.value)"');
$show_progress_bar = true;
} }
$titleWork = $form->addElement('text', 'title', get_lang("TitleWork"), 'id="file_upload" style="width: 350px;"'); $titleWork = $form->addElement('text', 'title', get_lang("TitleWork"), 'id="file_upload" style="width: 350px;"');
@ -1335,7 +1338,10 @@ if ($is_course_member) {
$form->addElement('style_submit_button', 'cancelForm', get_lang('Cancel'),'class="cancel"'); $form->addElement('style_submit_button', 'cancelForm', get_lang('Cancel'),'class="cancel"');
} }
$form->add_real_progress_bar('uploadWork', 'DownloadFile'); if ($show_progress_bar) {
$form->add_real_progress_bar('uploadWork', 'file');
}
$form->setDefaults($defaults); $form->setDefaults($defaults);
//$form->addRule('file', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required'); //$form->addRule('file', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
$form->display(); $form->display();

Loading…
Cancel
Save