Remove error_logs, remove called to unused code.

pull/2487/head
jmontoyaa 7 years ago
parent 4c08b6b3b5
commit 193a286273
  1. 65
      plugin/openmeetings/lib/openmeetings.class.php
  2. 9
      plugin/openmeetings/lib/openmeetings_gateway.php
  3. 1
      plugin/sepe/src/formative-action-edit.php
  4. 18
      plugin/sepe/src/function.php
  5. 3
      plugin/sepe/src/participant-action-edit.php
  6. 1
      plugin/sepe/src/participant-specialty-edit.php
  7. 1
      plugin/sepe/src/specialty-action-edit.php
  8. 2
      plugin/sepe/src/specialty-classroom-edit.php
  9. 3
      plugin/sepe/src/specialty-tutor-edit.php
  10. 1
      plugin/sepe/src/specialty-tutorial-edit.php
  11. 4
      tests/scripts/delete_old_tasks.php

@ -91,41 +91,6 @@ class OpenMeetings
return api_is_course_admin() || api_is_coach() || api_is_platform_admin();
}
/**
* Login the user with OM Server. This generates a session ID that is
* specific to the current user, but that does not require specific user data
*
* It is similar to opening a PHP session. In fact, the session ID is kept
* inside the $_SESSION['openmeetings_session'] session variable
* @return bool True if the user is correct and false when is incorrect
* @deprecated loginUser now called at object instanciation
*/
/**
function loginUser()
{
try {
//Verifying if there is already an active session
if (empty($_SESSION['openmeetings_session'])) {
// Login user returns either 0 or >0, depending on the results
// Technically, as long as the SOAP user has been configured in OpenMeetings and OpenMeetings is on, this should always succeed.
if ($this->gateway->loginUser()) {
$this->sessionId = $_SESSION['openmeetings_session'] = $this->gateway->session_id;
return true;
} else {
error_log('loginUser did not succeed');
return false;
}
} else {
$this->sessionId = $_SESSION['openmeetings_session'];
return true;
}
} catch (SoapFault $e) {
error_log(__FILE__.'+'.__LINE__.' Warning: We have detected some problems. Fault: '.$e->faultstring);
return false;
}
}
*/
/*
* Creating a Room for the meeting
* @return bool True if the user is correct and false when is incorrect
@ -152,8 +117,6 @@ class OpenMeetings
);
if ($meetingData != false && count($meetingData) > 0) {
//error_log(print_r($meetingData,1));
//error_log('Found previous room reference - reusing');
// There has been a room in the past for this course. It should
// still be on the server, so update (instead of creating a new one)
// This fills the following attributes: status, name, comment, chamiloCourseId, chamiloSessionId
@ -164,12 +127,9 @@ class OpenMeetings
$roomId = $this->gateway->updateRoomWithModeration($room);
if ($roomId != $meetingData['room_id']) {
$msg = 'Something went wrong: the updated room ID ('.$roomId.') is not the same as the one we had ('.$meetingData['room_id'].')';
error_log($msg);
die($msg);
}
} else {
//error_log('Found no previous room - creating');
$room = new Room();
$room->SID = $this->sessionId;
$room->name = $this->roomName;
@ -387,31 +347,8 @@ class OpenMeetings
)
)
);
/*$urlWsdl = $this->url."/services/RoomService?wsdl";
$omServices = new \SoapClient($urlWsdl);*/
$room = new Room();
/*
try {
$rooms = $this->gateway->getRoomsWithCurrentUsersByType();
//$rooms = $omServices->getRoomsPublic(array(
//'SID' => $this->sessionId,
//'start' => 0,
//'max' => 10,
//'orderby' => 'name',
//'asc' => 'true',
//'externalRoomType' => 'chamilo',
//'roomtypes_id' => 'chamilo',
//)
//);
} catch (SoapFault $e) {
error_log(__FILE__.'+'.__LINE__.' '.$e->faultstring);
//error_log($rooms->getDebug());
return false;
}
*/
$room->SID = $this->sessionId;
//error_log(__FILE__.'+'.__LINE__.' Meetings found: '.print_r($room->SID,1));
if (!empty($meetingsList)) {
foreach ($meetingsList as $meetingDb) {
//$room->rooms_id = $meetingDb['room_id'];
@ -593,7 +530,6 @@ class OpenMeetings
array('id = ? ' => $meetingId)
);
}
//error_log(__FILE__.'+'.__LINE__.' Finished closing');
} catch (SoapFault $e) {
error_log(__FILE__.'+'.__LINE__.' Warning: We have detected some problems: Fault: '.$e->faultstring);
exit;
@ -619,7 +555,6 @@ class OpenMeetings
array('id = ? ' => $id)
);
return $id;
//error_log(__FILE__.'+'.__LINE__.' Finished closing');
} catch (SoapFault $e) {
error_log(__FILE__.'+'.__LINE__.' Warning: We have detected some problems: Fault: '.$e->faultstring);
exit;

@ -98,7 +98,6 @@ class OpenMeetingsGateway
if ($err) {
error_log('Error: '.$err);
} else {
//error_log('getSession returned '.$response. ' - Storing as sessionId');
$this->sessionId = $response;
$url = $this->getRestUrl("UserService")
@ -157,7 +156,7 @@ class OpenMeetingsGateway
. "&isDemoRoom=false"
. "&demoTime=0"
. "&isModeratedRoom=".$this->var_to_str($isModeratedRoom));
//error_log($url);
$result = $this->rest->call($url);
if ($result->fault) {
@ -167,8 +166,6 @@ class OpenMeetingsGateway
if ($err) {
error_log('Error: '.$err);
} else {
// echo '<h2>Result</h2><pre>'; print_r($result["return"]); echo '</pre>';
//error_log('Room updated successfully '.print_r($result,1));
return $result;
}
}
@ -366,7 +363,6 @@ class OpenMeetingsGateway
if ($err) {
error_log('Error: '.$err);
} else {
//error_log('Creation of a new room succeeded: ID '.print_r($result,1));
return $result;
}
}
@ -391,11 +387,9 @@ class OpenMeetingsGateway
// . "getRoomTypes?"
// . "SID=" . $this->sessionId;
//$url = $this->getRestUrl('JabberService') . 'getAvailableRooms?SID=' . $this->sessionId;
//error_log(__FILE__.'+'.__LINE__.' Calling WS: '.$url);
$result = $this->rest->call($url, "return");
$rooms = array();
foreach ($result as $room) {
//error_log(__FILE__.'+'.__LINE__.': one room found on remote: '.print_r($room,1));
if ($room['externalRoomType'] == $type && count($room['currentusers']) > 0) {
$rooms[] = $room;
}
@ -420,7 +414,6 @@ class OpenMeetingsGateway
. "getRoomById?"
. "SID=".$this->sessionId
. "&rooms_id=".$roomId;
//error_log(__FILE__.'+'.__LINE__.' Calling WS: '.$url);
$result = $this->rest->call($url, "return");
return $result;
}

@ -102,7 +102,6 @@ if (!empty($_POST)) {
}
$res = Database::query($sql);
if (!$res) {
echo Database::error();
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($actionId == '0') {

@ -15,7 +15,7 @@ if ($_REQUEST['tab'] == 'delete_center_data') {
if (!$res) {
$sql = "DELETE FROM $tableSepeActions;";
$res = Database::query($sql);
$content = $plugin->get_lang('ProblemToDeleteInfoCenter').Database::error();
$content = $plugin->get_lang('ProblemToDeleteInfoCenter');
echo json_encode(array("status" => "false", "content" => $content));
} else {
$content = $plugin->get_lang('DeleteOk');
@ -28,7 +28,7 @@ if ($_REQUEST['tab'] == 'delete_action') {
$sql = "DELETE FROM $tableSepeActions WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoAction').Database::error();
$content = $plugin->get_lang('ProblemToDeleteInfoAction');
echo json_encode(array("status" => "false", "content" => $content));
} else {
$content = $plugin->get_lang('DeleteOk');
@ -42,7 +42,7 @@ if ($_REQUEST['tab'] == 'delete_specialty') {
$sql = "DELETE FROM $tableSepeSpecialty WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialty').Database::error();
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialty');
echo json_encode(array("status" => "false", "content" => $content));
} else {
$content = $plugin->get_lang('DeleteOk');
@ -55,7 +55,7 @@ if ($_REQUEST['tab'] == 'delete_specialty_participant') {
$sql = "DELETE FROM $tableSepeParticipantsSpecialty WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialty').Database::error();
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialty');
echo json_encode(array("status" => "false", "content" => $content));
} else {
$content = $plugin->get_lang('DeleteOk');
@ -68,7 +68,7 @@ if ($_REQUEST['tab'] == 'delete_classroom') {
$sql = "DELETE FROM $tableSepeSpecialtyClassroom WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialtyClassroom').Database::error();
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialtyClassroom');
echo json_encode(array("status" => "false", "content" => $content));
} else {
$content = $plugin->get_lang('DeleteOk');
@ -87,7 +87,7 @@ if ($_REQUEST['tab'] == 'checkTutorEdit') {
WHERE document_type='".$type."' AND document_number='".$number."' AND document_letter='".$letter."';";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemDataBase').Database::error();
$content = $plugin->get_lang('ProblemDataBase');
error_log(print_r($content, 1));
exit;
} else {
@ -106,7 +106,7 @@ if ($_REQUEST['tab'] == 'delete_tutor') {
$sql = "DELETE FROM $tableSepeSpecialtyTutors WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialtyTutor').Database::error();
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialtyTutor');
echo json_encode(array("status" => "false", "content" => $content));
} else {
$content = $plugin->get_lang('DeleteOk');
@ -126,7 +126,7 @@ if ($_REQUEST['tab'] == 'delete_participant') {
$sql = "DELETE FROM $tableSepeParticipants WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoParticipant').Database::error();
$content = $plugin->get_lang('ProblemToDeleteInfoParticipant');
echo json_encode(array("status" => "false", "content" => $content));
} else {
$content = $plugin->get_lang('DeleteOk');
@ -139,7 +139,7 @@ if ($_REQUEST['tab'] == 'unlink_action') {
$sql = "DELETE FROM $tableSepeCourseActions WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDesvincularInfoAction').Database::error();
$content = $plugin->get_lang('ProblemToDesvincularInfoAction');
echo json_encode(array("status" => "false", "content" => $content));
} else {
$content = $plugin->get_lang('DeleteOk');

@ -52,7 +52,6 @@ if (!empty($_POST)) {
VALUES ('".$tutorCompanyAlias."','".$tutorCompanyDocumentType."','".$tutorCompanyDocumentNumber."','".$tutorCompanyDocumentLetter."','1');";
$rs = Database::query($sql);
if (!$rs) {
echo Database::error();
} else {
$companyTutorId = Database::insert_id();
}
@ -74,7 +73,6 @@ if (!empty($_POST)) {
VALUES ('".$tutorTrainingAlias."','".$tutorTrainingDocumentType."','".$tutorTrainingDocumentNumber."','".$tutorTrainingDocumentLetter."','1');";
$rs = Database::query($sql);
if (!$rs) {
echo Database::error();
} else {
$trainingTutorId = Database::insert_id();
}
@ -114,7 +112,6 @@ if (!empty($_POST)) {
}
$res = Database::query($sql);
if (!$res) {
error_log(Database::error());
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newParticipant == 1) {

@ -93,7 +93,6 @@ if (!empty($_POST)) {
}
$res = Database::query($sql);
if (!$res) {
echo Database::error();
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
$_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');

@ -130,7 +130,6 @@ if (!empty($_POST)) {
}
$res = Database::query($sql);
if (!$res) {
echo Database::error();
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newSpecialty == 1) {

@ -29,7 +29,6 @@ if (!empty($_POST)) {
VALUES ($specialtyId, $existsCenterId);";
$res = Database::query($sql);
if (!$res) {
echo Database::error();
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newClassroom == 1) {
@ -60,7 +59,6 @@ if (!empty($_POST)) {
}
$res = Database::query($sql);
if (!$res) {
echo Database::error();
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newClassroom == 1) {

@ -74,7 +74,6 @@ if (!empty($_POST)) {
WHERE id = '".$aux['id']."';";
$res = Database::query($sql);
if (!$res) {
error_log(Database::error());
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
}
$newTutor = 0; //Reset variable, no create new tutor, exists tutor
@ -108,7 +107,6 @@ if (!empty($_POST)) {
);";
$res = Database::query($sql);
if (!$res) {
error_log(Database::error());
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
$tutorId = Database::insert_id();
@ -145,7 +143,6 @@ if (!empty($_POST)) {
}
$res = Database::query($sql);
if (!$res) {
error_log(Database::error());
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newTutor == 1) {

@ -54,7 +54,6 @@ if (!empty($_POST)) {
}
$res = Database::query($sql);
if (!$res) {
error_log(Database::error());
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
$_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');

@ -39,14 +39,12 @@ $sql = "SELECT id FROM session where access_start_date < '$expiryDate' AND acces
$res = mysql_query($sql, $conexion);
if ($res === false) {
//die("Error querying sessions: ".Database::error($res)."\n");
}
$countSessions = mysql_num_rows($res);
$sql = "SELECT count(*) FROM session";
$resc = mysql_query($sql, $conexion);
if ($resc === false) {
//die("Error querying sessions: ".Database::error($res)."\n");
}
$countAllSessions = mysql_result($resc, 0, 0);
echo "[".time()."] Found $countSessions sessions between $fromDate and $expiryDate on a total of $countAllSessions sessions."."\n";
@ -115,7 +113,7 @@ foreach ($sessionCourses as $sid => $cid) {
AND session_id = $sid AND active = 1;";
$resdel = mysql_query($sqldel);
if ($resdel === false) {
echo "Error querying sessions: ".Database::error($resdel)."\n";
echo "Error querying sessions";
}
}
}

Loading…
Cancel
Save