Minor - format code, fix PHP warning

pull/2650/head
Julio Montoya 6 years ago
parent a6e7489964
commit 6abf2036b4
  1. 16
      main/inc/global.inc.php
  2. 4
      main/inc/lib/api.lib.php
  3. 2
      main/inc/lib/tracking.lib.php

@ -34,6 +34,7 @@ require_once __DIR__.'/../../public/legacy.php';
// Check the PHP version
api_check_php_version(__DIR__.'/');
try {
// Get settings from .env file created when installation Chamilo
$envFile = __DIR__.'/../../.env';
@ -55,6 +56,7 @@ try {
$response = $kernel->handle($request);
$container = $kernel->getContainer();
if ($kernel->isInstalled()) {
require_once $kernel->getConfigurationFile();
} else {
@ -526,16 +528,15 @@ try {
// ===== "who is logged in?" module section =====
// check and modify the date of user in the track.e.online table
if (isset($_user['user_id'])) {
if (!$x = strpos($_SERVER['PHP_SELF'], 'whoisonline.php')) {
preventMultipleLogin($_user["user_id"]);
LoginCheck(isset($_user['user_id']) ? $_user['user_id'] : '');
preventMultipleLogin($_user['user_id']);
LoginCheck($_user['user_id']);
}
// ===== end "who is logged in?" module section =====
// Update of the logout_date field in the table track_e_login
// (needed for the calculation of the total connection time)
if (!isset($_SESSION['login_as']) && isset($_user)) {
if (!isset($_SESSION['login_as'])) {
// if $_SESSION['login_as'] is set, then the user is an admin logged as the user
$tbl_track_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql = "SELECT login_id, login_date
@ -573,6 +574,7 @@ try {
Database::query($sql);
}
}
}
// Add language_measure_frequency to your main/inc/conf/configuration.php in
// order to generate language variables frequency measurements (you can then
@ -597,7 +599,9 @@ try {
// Forcing PclZip library to use a custom temporary folder.
define('PCLZIP_TEMPORARY_DIR', api_get_path(SYS_ARCHIVE_PATH));
} catch (Exception $e) {
/*var_dump($e->getMessage());
error_log($e->getMessage());
/*
var_dump($e->getMessage());
var_dump($e->getCode());
var_dump($e->getLine());
echo $e->getTraceAsString();

@ -6456,9 +6456,9 @@ function api_request_uri()
*/
function api_get_current_access_url_id()
{
$access_url_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL);
$table = Database::get_main_table(TABLE_MAIN_ACCESS_URL);
$path = Database::escape_string(api_get_path(WEB_PATH));
$sql = "SELECT id FROM $access_url_table WHERE url = '".$path."'";
$sql = "SELECT id FROM $table WHERE url = '".$path."'";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
$access_url_id = Database::result($result, 0, 0);

@ -2578,7 +2578,7 @@ class Tracking
if (!empty($sessionId)) {
$conditions[] = " session_id = $sessionId ";
} else {
$conditions[] = " (session_id = 0 OR session_id IS NULL) ";
$conditions[] = ' (session_id = 0 OR session_id IS NULL) ';
}
$conditionToString = implode('AND', $conditions);

Loading…
Cancel
Save