Merge pull request #1749 from chamilo/scrutinizer-patch-1

Scrutinizer Auto-Fixes
pull/2487/head
Julio Montoya 9 years ago committed by GitHub
commit 0501791994
  1. 2
      main/admin/access_url_add_usergroup_to_url.php
  2. 14
      main/blog/download.php
  3. 32
      main/cron/document/index_all_docs.php
  4. 14
      main/document/exit_pixlr.php
  5. 24
      main/document/slideshowoptions.php
  6. 2
      main/dropbox/dropbox_download.php
  7. 8
      main/dropbox/dropbox_functions.inc.php
  8. 2
      main/gradebook/lib/fe/displaygradebook.php
  9. 2
      main/group/settings.php
  10. 16
      main/template/default/auth/courses_list.php

@ -87,7 +87,7 @@ $db_urls = Database::store_result($result);
<?php
echo Display::get_alphabet_options($firstLetterUserGroup);
echo Display::get_numeric_options(0, 9, $firstLetterUserGroup);
?>
?>
</select>
</td>
<td width="20%">&nbsp;</td>

@ -30,18 +30,18 @@ $doc_url = str_replace(' ', '+', $doc_url);
$doc_url = str_replace('/..', '', $doc_url); //echo $doc_url;
if (! isset($_course)) {
api_not_allowed(true);
api_not_allowed(true);
}
$full_file_name = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/blog/'.$doc_url;
//if the rewrite rule asks for a directory, we redirect to the course view
if (is_dir($full_file_name)) {
//remove last slash if present
while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul);
//create the path
$document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
//redirect
header('Location: '.$document_explorer);
//remove last slash if present
while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul);
//create the path
$document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
//redirect
header('Location: '.$document_explorer);
exit;
}

@ -8,9 +8,9 @@
die();
require '../../inc/global.inc.php';
if (empty($_GET['doc'])) {
echo "To add a document name to search, add ?doc=abc to the URL\n";
echo "To add a document name to search, add ?doc=abc to the URL\n";
} else {
echo "Received param ".$_GET['doc']."<br />\n";
echo "Received param ".$_GET['doc']."<br />\n";
}
$allowed_mime_types = DocumentManager::file_get_mime_type(true);
$allowed_extensions = array(
@ -40,30 +40,30 @@ require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
$specific_fields = get_specific_field_list();
$specific_fields_values = array();
foreach ($specific_fields as $sf) {
$specific_fields_values[$sf['code']] = '';
$specific_fields_values[$sf['code']] = '';
}
$td = Database::get_course_table(TABLE_DOCUMENT);
foreach ($courses_list as $course) {
$course_dir = $course['directory'].'/document';
$title = Database::escape_string($_GET['doc']);
$sql = "SELECT id, path, session_id FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' or title LIKE '%$title%'";
$res = Database::query($sql);
if (Database::num_rows($res)>0) {
$course_dir = $course['directory'].'/document';
$title = Database::escape_string($_GET['doc']);
$sql = "SELECT id, path, session_id FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' or title LIKE '%$title%'";
$res = Database::query($sql);
if (Database::num_rows($res)>0) {
while ($row = Database::fetch_array($res)) {
$doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path'];
$extensions = preg_split("/[\/\\.]/", $doc_path);
$doc_ext = strtolower($extensions[count($extensions) - 1]);
if (in_array($doc_ext, $allowed_extensions) && !is_dir($doc_path)) {
$doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path'];
$extensions = preg_split("/[\/\\.]/", $doc_path);
$doc_ext = strtolower($extensions[count($extensions) - 1]);
if (in_array($doc_ext, $allowed_extensions) && !is_dir($doc_path)) {
$doc_mime = mime_content_type($doc_path);
echo "Indexing doc ".$row['id']." (".$row['path'].") in course ".$course['code']."\n";
$residx = DocumentManager::index_document($row['id'], $course['code'], $row['session_id'], $course['course_language'], $specific_fields_values);
if ($residx) {
echo "Success\n";
echo "Success\n";
} else {
echo "Failure\n";
echo "Failure\n";
}
}
}
}
}
}
}

@ -24,12 +24,12 @@ unset($_SESSION['whereami']);
unset($_SESSION['temp_realpath_image']);
if (!isset($_SESSION['exit_pixlr'])){
$location=api_get_path(WEB_CODE_PATH).'document/document.php';
echo '<script>window.parent.location.href="'.$location.'"</script>';
api_not_allowed(true);
$location=api_get_path(WEB_CODE_PATH).'document/document.php';
echo '<script>window.parent.location.href="'.$location.'"</script>';
api_not_allowed(true);
} else {
echo '<div align="center" style="padding-top:150; font-family:Arial, Helvetica, Sans-serif;font-size:25px;color:#aaa;font-weight:bold;">'.get_lang('PleaseStandBy').'</div>';
$location=api_get_path(WEB_CODE_PATH).'document/document.php?id='.Security::remove_XSS($_SESSION['exit_pixlr']);
echo '<script>window.parent.location.href="'.$location.'"</script>';
unset($_SESSION['exit_pixlr']);
echo '<div align="center" style="padding-top:150; font-family:Arial, Helvetica, Sans-serif;font-size:25px;color:#aaa;font-weight:bold;">'.get_lang('PleaseStandBy').'</div>';
$location=api_get_path(WEB_CODE_PATH).'document/document.php?id='.Security::remove_XSS($_SESSION['exit_pixlr']);
echo '<script>window.parent.location.href="'.$location.'"</script>';
unset($_SESSION['exit_pixlr']);
}

@ -77,7 +77,7 @@ Display::toolbarAction('toolbar-slideshow', $content)
if ($image_resizing == 'noresizing' || $image_resizing == '') {
echo ' checked';
}
?>>
?>>
</label>
<?php echo '<b>'. get_lang('NoResizing') . '</b>, ' . get_lang('NoResizingComment') ;?>
</div>
@ -87,7 +87,7 @@ Display::toolbarAction('toolbar-slideshow', $content)
if ($image_resizing == 'resizing_auto' || $image_resizing == '') {
echo ' checked';
}
?>>
?>>
</label>
<?php echo '<b>'. get_lang('ResizingAuto') . '</b>, ' . get_lang('ResizingAutoComment');?>
</div>
@ -99,7 +99,7 @@ Display::toolbarAction('toolbar-slideshow', $content)
$width = $_SESSION['image_resizing_width'];
$height = $_SESSION['image_resizing_height'];
}
?>>
?>>
</label>
<?php echo '<b>'. get_lang('Resizing') . '</b>, ' . get_lang('ResizingComment'); ?>
</div>
@ -107,13 +107,13 @@ Display::toolbarAction('toolbar-slideshow', $content)
<label class="col-sm-1 control-label"><?php echo get_lang('Width'); ?></label>
<div class="col-sm-3">
<input class="form-control" name="width" type="text" id="width" <?php
if ($image_resizing == 'resizing') {
echo ' value="'.$width.'"';
echo ' class="enabled_input"';
if ($image_resizing == 'resizing') {
echo ' value="'.$width.'"';
echo ' class="enabled_input"';
} else {
echo ' class="disabled_input"';
}
?> >
?> >
</div>
<div class="col-sm-8"></div>
</div>
@ -121,13 +121,13 @@ Display::toolbarAction('toolbar-slideshow', $content)
<label class="col-sm-1 control-label"><?php echo get_lang('Height'); ?></label>
<div class="col-sm-3">
<input class="form-control" name="height" type="text" id="height" <?php
if ($image_resizing == 'resizing') {
echo ' value="'.$height.'"';
echo ' class="enabled_input"';
} else {
if ($image_resizing == 'resizing') {
echo ' value="'.$height.'"';
echo ' class="enabled_input"';
} else {
echo ' class="disabled_input"';
}
?> >
?> >
</div>
<div class="col-sm-8"></div>
</div>

@ -86,7 +86,7 @@ if (!$allowed_to_download) {
'error'
)
);
exit;
exit;
} else {
/* DOWNLOAD THE FILE */
// the user is allowed to download the file

@ -84,11 +84,11 @@ function handle_multiple_actions()
if (strstr($_POST['action'], 'move_')) {
// check move_received_n or move_sent_n command
if (strstr($_POST['action'], 'received')) {
$part = 'received';
$to_cat_id = str_replace('move_received_', '', $_POST['action']);
$part = 'received';
$to_cat_id = str_replace('move_received_', '', $_POST['action']);
} else {
$part = 'sent';
$to_cat_id = str_replace('move_sent_', '', $_POST['action']);
$part = 'sent';
$to_cat_id = str_replace('move_sent_', '', $_POST['action']);
}
foreach ($checked_file_ids as $value) {

@ -364,7 +364,7 @@ class DisplayGradebook
$my_api_cidreq = 'cidReq=' . $my_category['course_code'];
}
if ($show_add_link && !$message_resource) {
$actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' .
$actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' .
Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM) . '</a>';
$cats = Category :: load($selectcat);

@ -3,7 +3,7 @@
/**
* This script displays an area where teachers can edit the group properties and member list.
*
*
* @author various contributors
* @author Roan Embrechts (VUB), partial code cleanup, initial virtual course support
* @package chamilo.group

@ -29,11 +29,11 @@ if (!empty($message)) {
// COURSES WITH CATEGORIES
if (!empty($user_course_categories)) {
foreach ($user_course_categories as $row) {
echo Display::page_subheader($row['title']);
echo '<a name="category'.$row['id'].'"></a>';
foreach ($user_course_categories as $row) {
echo Display::page_subheader($row['title']);
echo '<a name="category'.$row['id'].'"></a>';
if (isset($_GET['categoryid']) && $_GET['categoryid'] == $row['id']) { ?>
if (isset($_GET['categoryid']) && $_GET['categoryid'] == $row['id']) { ?>
<!-- We display the edit form for the category -->
<form name="edit_course_category" method="post" action="courses.php?action=<?php echo $action; ?>">
@ -241,15 +241,15 @@ if (!empty($courses_without_category)) {
</a>
<?php } else {
echo Display::display_icon('up_na.png', get_lang('Up'),'',22);
}
}
if ($key < $number_of_courses - 1) { ?>
if ($key < $number_of_courses - 1) { ?>
<a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
<?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?>
</a>
<?php } else {
echo Display::display_icon('down_na.png', get_lang('Down'),'',22);
}?>
}?>
</div>
<div style="float:left; margin-right:10px;">
<!-- cancel subscrioption-->
@ -267,7 +267,7 @@ if (!empty($courses_without_category)) {
</div>
<?php }
}
?>
?>
</td>
</tr>
<?php

Loading…
Cancel
Save