Minor - fix function name apiBlockInactiveUser, update from master

pull/3683/head
Julio Montoya 5 years ago
parent 4c1f61e948
commit d3e46317ae
  1. 2
      main/auth/profile.php
  2. 2
      main/calendar/agenda_js.php
  3. 5
      main/dashboard/dashboard_controller.php
  4. 4
      main/exercise/exercise.class.php
  5. 8
      main/exercise/exercise_report.php
  6. 2
      main/exercise/exercise_result.php
  7. 7
      main/exercise/export/qti2/qti2_export.php
  8. 4
      main/exercise/export/scorm/ScormQuestion.php
  9. 14
      main/exercise/question.class.php
  10. 2
      main/gradebook/my_certificates.php
  11. 20
      main/inc/lib/api.lib.php
  12. 2
      whoisonline.php

@ -13,7 +13,7 @@ use ChamiloSession as Session;
*/
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
apiBlockInactiveUser();
api_block_inactive_user();
$this_section = SECTION_MYPROFILE;
$allowSocialTool = api_get_setting('allow_social_tool') === 'true';

@ -13,7 +13,7 @@ if ('personal' == $type || 'admin' == $type) {
$cidReset = true; // fixes #5162
}
require_once __DIR__.'/../inc/global.inc.php';
apiBlockInactiveUser();
api_block_inactive_user();
$current_course_tool = TOOL_CALENDAR_EVENT;
$this_section = SECTION_MYAGENDA;

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**
@ -9,8 +10,6 @@
* @author Christian Fasanando <christian1827@gmail.com>
*
* @todo move to main/inc/lib
*
* @package chamilo.dashboard
*/
class DashboardController
{
@ -126,7 +125,7 @@ class DashboardController
*/
public function store_user_block()
{
if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") {
if ("POST" == strtoupper($_SERVER['REQUEST_METHOD'])) {
$enabled_blocks = $_POST['enabled_blocks'];
$columns = $_POST['columns'];
DashboardManager::store_user_blocks($this->user_id, $enabled_blocks, $columns);

@ -23,7 +23,7 @@ use Doctrine\DBAL\Types\Type;
*/
class Exercise
{
const PAGINATION_ITEMS_PER_PAGE = 20;
public const PAGINATION_ITEMS_PER_PAGE = 20;
public $iId;
public $id;
public $name;
@ -6462,7 +6462,7 @@ class Exercise
if (!empty($track_exercise_info)) {
$totalScore = 0;
$objExercise = new Exercise();
$objExercise = new self();
$objExercise->read($track_exercise_info['exe_exo_id']);
if (!empty($track_exercise_info['data_tracking'])) {
$question_list = explode(',', $track_exercise_info['data_tracking']);

@ -313,7 +313,7 @@ if (isset($_REQUEST['comments']) &&
if ($prereqCheck) {
$passed = true;
}
if ($passed === false) {
if (false === $passed) {
if (!empty($objExerciseTmp->pass_percentage)) {
$passed = ExerciseLib::isSuccessExerciseResult(
$tot,
@ -334,9 +334,9 @@ if (isset($_REQUEST['comments']) &&
}
$sql = "UPDATE $TBL_LP_ITEM_VIEW
SET score = '".floatval($tot)."'
SET score = '".(float) $tot."'
$statusCondition
WHERE c_id = ".$course_id." AND id = ".$lp_item_view_id;
WHERE c_id = $course_id AND id = $lp_item_view_id";
Database::query($sql);
header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/exercise_show.php?id='.$id.'&student='.$student_id.'&'.api_get_cidreq());
@ -675,7 +675,7 @@ if ($is_allowedToEdit || $is_tutor) {
['name' => 'actions', 'index' => 'actions', 'width' => '60', 'align' => 'left', 'search' => 'false', 'sortable' => 'false'],
];
if ($officialCodeInList === 'true') {
if ('true' === $officialCodeInList) {
$officialCodeRow = ['name' => 'official_code', 'index' => 'official_code', 'width' => '50', 'align' => 'left', 'search' => 'true'];
$column_model = array_merge([$officialCodeRow], $column_model);
}

@ -276,7 +276,7 @@ if (!in_array($origin, ['learnpath', 'embeddable', 'mobileapp'])) {
$url = '../lp/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$learnpath_id
.'&lp_item_id='.$learnpath_item_id.'&exeId='.$exeId
.'&fb_type='.$objExercise->getFeedbackType().'#atoc_'.$learnpath_item_id;
$href = $lp_mode === 'fullscreen' ? ' window.opener.location.href="'.$url.'" ' : ' top.location.href="'.$url.'"';
$href = 'fullscreen' === $lp_mode ? ' window.opener.location.href="'.$url.'" ' : ' top.location.href="'.$url.'"';
if (api_is_allowed_to_session_edit()) {
Exercise::cleanSessionVariables();

@ -60,7 +60,7 @@ class ImsAssessmentItem
}
}
$string = '<assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1"
return '<assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 imsqti_v2p1.xsd"
identifier="'.$this->questionIdent.'"
@ -68,7 +68,6 @@ class ImsAssessmentItem
category = "'.$categoryTitle.'"
>'."\n";
return $string;
}
/**
@ -264,7 +263,7 @@ class ImsSection
."<questestinterop>\n";
$foot = "</questestinterop>\n";
}
$out = $head
return $head
.$this->start_section()
.$this->export_duration()
.$this->export_presentation()
@ -272,8 +271,6 @@ class ImsSection
.$this->exportQuestions()
.$this->end_section()
.$foot;
return $out;
}
}

@ -171,7 +171,7 @@ class ScormQuestion extends Question
$title = $this->selectTitle();
$description = $this->selectDescription();
$cols = 2;
$s = '<tr>
return '<tr>
<td colspan="'.$cols.'" id="question_'.$this->id.'_title" valign="middle" style="background-color:#d6d6d6;">
'.$title.'
</td>
@ -181,8 +181,6 @@ class ScormQuestion extends Question
<i>'.$description.'</i>
</td>
</tr>';
return $s;
}
/**

@ -1917,10 +1917,8 @@ abstract class Question
/**
* abstract function which creates the form to create / edit the answers of the question.
*
* @param FormValidator $form
*/
abstract public function createAnswersForm($form);
abstract public function createAnswersForm(FormValidator $form);
/**
* abstract function which process the creation of answers.
@ -2236,7 +2234,7 @@ abstract class Question
['class' => 'question_description']
);
} else {
if ($score['pass'] == true) {
if (true == $score['pass']) {
$message = Display::div(
sprintf(
get_lang('ReadingQuestionCongratsSpeedXReachedForYWords'),
@ -2294,10 +2292,10 @@ abstract class Question
$tbl_quiz_question = Database::get_course_table(TABLE_QUIZ_QUESTION);
$tbl_quiz_rel_question = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$quiz_id = intval($quiz_id);
$quiz_id = (int) $quiz_id;
$max_score = (float) $max_score;
$type = intval($type);
$level = intval($level);
$type = (int) $type;
$level = (int) $level;
// Get the max position
$sql = "SELECT max(position) as max_position
@ -2543,7 +2541,7 @@ abstract class Question
return
in_array($this->type, $this->questionTypeWithFeedback) &&
$exercise->getFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM;
EXERCISE_FEEDBACK_TYPE_EXAM != $exercise->getFeedbackType();
}
/**

@ -10,7 +10,7 @@
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
apiBlockInactiveUser();
api_block_inactive_user();
$logInfo = [
'tool' => 'MyCertificates',

@ -1,11 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\SettingsCurrent;
use Chamilo\CourseBundle\Entity\CItemProperty;
use Chamilo\UserBundle\Entity\User;
use ChamiloSession as Session;
use PHPMailer\PHPMailer\PHPMailer as PHPMailer;
use PHPMailer\PHPMailer\PHPMailer;
use Symfony\Component\Finder\Finder;
/**
@ -14,8 +15,6 @@ use Symfony\Component\Finder\Finder;
* This library is in process of being transferred to src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.
* Whenever a function is transferred to the ChamiloApi class, the places where it is used should include
* the "use Chamilo\CoreBundle\Component\Utils\ChamiloApi;" statement.
*
* @package chamilo.library
*/
// PHP version requirement.
@ -1287,7 +1286,7 @@ function api_protect_course_script($print_headers = false, $allow_session_admins
}
}
apiBlockInactiveUser();
api_block_inactive_user();
return true;
}
@ -1315,18 +1314,18 @@ function api_protect_admin_script($allow_sessions_admins = false, $allow_drh = f
return false;
}
apiBlockInactiveUser();
api_block_inactive_user();
return true;
}
/**
* Blocks inactive users with a currently active session from accessing more
* pages "live".
* Blocks inactive users with a currently active session from accessing more pages "live".
*
* @return bool Returns true if the feature is disabled or the user account is still enabled. Returns false (and shows a message) if the feature is enabled *and* the user is disabled.
* @return bool Returns true if the feature is disabled or the user account is still enabled.
* Returns false (and shows a message) if the feature is enabled *and* the user is disabled.
*/
function apiBlockInactiveUser()
function api_block_inactive_user()
{
$data = true;
if (api_get_configuration_value('security_block_inactive_users_immediately') != 1) {
@ -1335,7 +1334,7 @@ function apiBlockInactiveUser()
$userId = api_get_user_id();
$homeUrl = api_get_path(WEB_PATH);
if (($userId) == 0) {
if ($userId == 0) {
return $data;
}
@ -1345,7 +1344,6 @@ function apiBlockInactiveUser()
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
$result_array = Database::fetch_array($result);
$data = (bool) $result_array['active'];
}
if ($data == false) {

@ -9,7 +9,7 @@ if (!isset($_GET['cidReq'])) {
}
require_once './main/inc/global.inc.php';
apiBlockInactiveUser();
api_block_inactive_user();
if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) {
api_protect_course_script(true);

Loading…
Cancel
Save