Minor - Format code

1.9.x
Julio Montoya 11 years ago
parent 5528500519
commit c9295139e3
  1. 14
      main/inc/global.inc.php
  2. 21
      main/inc/local.inc.php

@ -114,13 +114,15 @@ if (empty($_configuration['statistics_database']) && $already_installed) {
} }
global $database_connection; global $database_connection;
// Connect to the server database and select the main chamilo database. // Connect to the server database and select the main chamilo database.
// When $_configuration['db_persistent_connection'] is set, it is expected to be a boolean type.
if (!($conn_return = @Database::connect( if (!($conn_return = @Database::connect(
array( array(
'server' => $_configuration['db_host'], 'server' => $_configuration['db_host'],
'username' => $_configuration['db_user'], 'username' => $_configuration['db_user'],
'password' => $_configuration['db_password'], 'password' => $_configuration['db_password'],
'persistent' => $_configuration['db_persistent_connection'] // When $_configuration['db_persistent_connection'] is set, it is expected to be a boolean type. 'persistent' => $_configuration['db_persistent_connection']
)))) { )))
) {
$global_error_code = 3; $global_error_code = 3;
// The database server is not available or credentials are invalid. // The database server is not available or credentials are invalid.
require $includePath.'/global_error_message.inc.php'; require $includePath.'/global_error_message.inc.php';
@ -317,8 +319,6 @@ if (file_exists($mail_conf)) {
// ===== "who is logged in?" module section ===== // ===== "who is logged in?" module section =====
// check and modify the date of user in the track.e.online table // check and modify the date of user in the track.e.online table
if (!$x = strpos($_SERVER['PHP_SELF'], 'whoisonline.php')) { if (!$x = strpos($_SERVER['PHP_SELF'], 'whoisonline.php')) {
LoginCheck(isset($_user['user_id']) ? $_user['user_id'] : ''); LoginCheck(isset($_user['user_id']) ? $_user['user_id'] : '');
@ -327,9 +327,9 @@ if (!$x = strpos($_SERVER['PHP_SELF'], 'whoisonline.php')) {
// ===== end "who is logged in?" module section ===== // ===== end "who is logged in?" module section =====
if (api_get_setting('server_type') == 'test') { if (api_get_setting('server_type') == 'test') {
//error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
ini_set('display_errors', '1'); /*ini_set('display_errors', '1');
error_reporting(-1); error_reporting(-1);*/
} else { } else {
/* /*
Server type is not test Server type is not test

@ -177,14 +177,20 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
//Platform legal terms and conditions //Platform legal terms and conditions
if (api_get_setting('allow_terms_conditions') == 'true') { if (api_get_setting('allow_terms_conditions') == 'true') {
if (isset($_POST['login']) && isset($_POST['password']) && isset($_SESSION['term_and_condition']['user_id'])) { if (isset($_POST['login']) && isset($_POST['password']) &&
$user_id = $_SESSION['term_and_condition']['user_id']; // user id isset($_SESSION['term_and_condition']['user_id'])
) {
// user id
$user_id = $_SESSION['term_and_condition']['user_id'];
// Update the terms & conditions // Update the terms & conditions
$legal_type = null; $legal_type = null;
//verify type of terms and conditions //verify type of terms and conditions
if (isset($_POST['legal_info'])) { if (isset($_POST['legal_info'])) {
$info_legal = explode(':', $_POST['legal_info']); $info_legal = explode(':', $_POST['legal_info']);
$legal_type = LegalManager::get_type_of_terms_and_conditions($info_legal[0], $info_legal[1]); $legal_type = LegalManager::get_type_of_terms_and_conditions(
$info_legal[0],
$info_legal[1]
);
} }
//is necessary verify check //is necessary verify check
@ -717,7 +723,9 @@ if (!empty($cDir)) {
// if the requested course is different from the course in session // if the requested course is different from the course in session
if (!empty($cidReq) && (!isset($_SESSION['_cid']) or (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid']))) { if (!empty($cidReq) && (!isset($_SESSION['_cid']) or
(isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid']))
) {
$cidReset = true; $cidReset = true;
$gidReset = true; // As groups depend from courses, group id is reset $gidReset = true; // As groups depend from courses, group id is reset
} }
@ -853,7 +861,7 @@ if (isset($cidReset) && $cidReset) {
} }
} }
//Deleting session info // Deleting session info.
if (api_get_session_id()) { if (api_get_session_id()) {
Session::erase('id_session'); Session::erase('id_session');
Session::erase('session_name'); Session::erase('session_name');
@ -880,7 +888,7 @@ if (isset($cidReset) && $cidReset) {
} }
if (empty($_SESSION['_course']) or empty($_SESSION['_cid'])) { //no previous values... if (empty($_SESSION['_course']) or empty($_SESSION['_cid'])) { //no previous values...
$_cid = -1; //set default values that will be caracteristic of being unset $_cid = -1; // Set default values
$_course = -1; $_course = -1;
} else { } else {
@ -1154,7 +1162,6 @@ if ((isset($uidReset) && $uidReset) || (isset($cidReset) && $cidReset)) {
} }
} }
} }
} }
//If I'm the admin platform i'm a teacher of the course //If I'm the admin platform i'm a teacher of the course

Loading…
Cancel
Save