Minor - format code, add "exit" after "header()"

pull/2487/head
jmontoyaa 7 years ago
parent e61ffc63df
commit 293c3ab548
  1. 4
      plugin/sepe/admin.php
  2. 1
      plugin/sepe/config.php
  3. 2
      plugin/sepe/install.php
  4. 3
      plugin/sepe/plugin.php
  5. 1
      plugin/sepe/src/formative-action.php
  6. 4
      plugin/sepe/uninstall.php
  7. 2
      plugin/sepe/update.php
  8. 27
      plugin/sepe/ws/Sepe.php
  9. 10
      plugin/sepe/ws/service.php

@ -7,6 +7,8 @@ $pluginPath = api_get_path(WEB_PLUGIN_PATH).'sepe/src/sepe-administration-menu.p
if ($enable && api_is_platform_admin()) {
header('Location:'.$pluginPath);
exit;
} else {
header('Location: ../../index.php');
}
exit;
}

@ -8,7 +8,6 @@
*/
require_once __DIR__.'/../../main/inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'plugin.class.php';
require_once 'src/sepe.lib.php';
require_once 'src/sepe_plugin.class.php';

@ -7,7 +7,7 @@
require_once __DIR__.'/config.php';
if (!api_is_platform_admin()) {
die ('You must have admin permissions to install plugins');
die('You must have admin permissions to install plugins');
}
SepePlugin::create()->install();

@ -1,7 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* This script is a configuration file for the date plugin. You can use it as a master for other platform plugins (course plugins are slightly different).
* This script is a configuration file for the date plugin.
* You can use it as a master for other platform plugins (course plugins are slightly different).
* These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins)
* @package chamilo.plugin.sepe
*/

@ -18,6 +18,7 @@ if (api_is_platform_admin()) {
$info = getActionInfo($actionId);
if ($info === false) {
header("Location: formative-actions-list.php");
exit;
}
$templateName = $plugin->get_lang('FormativeActionData');
$interbreadcrumb[] = array(

@ -6,8 +6,6 @@
* the global database and the courses tables
* @package chamilo.plugin.sepe
*/
/**
* Queries
*/
require_once __DIR__.'/config.php';
SepePlugin::create()->uninstall();

@ -7,7 +7,7 @@
require_once __DIR__.'/config.php';
if (!api_is_platform_admin()) {
die ('You must have admin permissions to install plugins');
die('You must have admin permissions to install plugins');
}
SepePlugin::create()->update();

@ -5,7 +5,6 @@
*/
class Sepe
{
/**
* @param crearCentroInput[] $crearCentroInput
*
@ -104,7 +103,7 @@ class Sepe
/**
*
* @return array
* @return stdClass
*/
public function obtenerDatosCentro()
{
@ -398,7 +397,8 @@ class Sepe
foreach ($centroList as $centro) {
$centerOrigin = $centro->ORIGEN_CENTRO;
$centerCode = $centro->CODIGO_CENTRO;
$sql = "SELECT id FROM $tableCenters WHERE center_origin='".$centerOrigin."' AND center_code='".$centerCode."';";
$sql = "SELECT id FROM $tableCenters
WHERE center_origin='".$centerOrigin."' AND center_code='".$centerCode."';";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
$aux_row = Database::fetch_assoc($res);
@ -448,7 +448,9 @@ class Sepe
/* check tutor not exists */
$sql = "SELECT id FROM $tableTutors WHERE
document_type='".$documentType."' AND document_number='".$documentNumber."' AND document_letter='".$documentLetter."';";
document_type='".$documentType."' AND
document_number='".$documentNumber."' AND
document_letter='".$documentLetter."';";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
$aux_row = Database::fetch_assoc($res);
@ -530,7 +532,13 @@ class Sepe
$documentNumberTraining = isset($participant->CONTRATO_FORMACION->ID_TUTOR_FORMACION->NUM_DOCUMENTO) ? $participant->CONTRATO_FORMACION->ID_TUTOR_FORMACION->NUM_DOCUMENTO : null;
$documentLetterTraining = isset($participant->CONTRATO_FORMACION->ID_TUTOR_FORMACION->LETRA_NIF) ? $participant->CONTRATO_FORMACION->ID_TUTOR_FORMACION->LETRA_NIF : null;
if (!empty($documentTypeTraining) || !empty($documentNumberTraining) || !empty($documentLetterTraining)) {
$tmp_f = Database::query('SELECT id FROM '.$tableTutorsCompany.' WHERE document_type="'.$documentTypeTraining.'" AND document_number="'.$documentNumberTraining.'" AND document_letter="'.$documentLetterTraining.'";');
$tmp_f = Database::query('
SELECT id FROM '.$tableTutorsCompany.'
WHERE
document_type="'.$documentTypeTraining.'" AND
document_number="'.$documentNumberTraining.'" AND
document_letter="'.$documentLetterTraining.'";'
);
if (Database::num_rows($tmp_f) > 0) {
$row_tmp = Database::fetch_assoc($tmp_f);
$tutorIdTraining = $row_tmp['id'];
@ -768,7 +776,13 @@ class Sepe
$classroomCenter = new stdClass();
$classroomCenter->ORIGEN_CENTRO = $auxCenter['center_origin'];
$classroomCenter->CODIGO_CENTRO = $auxCenter['center_code'];
$classroomCenter = new SoapVar($classroomCenter, SOAP_ENC_OBJECT, null, null, 'CENTRO_PRESENCIAL');
$classroomCenter = new SoapVar(
$classroomCenter,
SOAP_ENC_OBJECT,
null,
null,
'CENTRO_PRESENCIAL'
);
$classroomCenterList->append($classroomCenter);
}
$sql = "SELECT * FROM $specialityTutorTable
@ -1290,7 +1304,6 @@ class Sepe
protected function checkAuth()
{
if (!$this->authenticated) {
// HTML_Output::error(403);
error_log('403');
}
}

@ -22,6 +22,9 @@ $ns = api_get_path(WEB_PLUGIN_PATH)."sepe/ws/ProveedorCentroTFWS.wsdl";
$wsdl = api_get_path(SYS_PLUGIN_PATH)."sepe/ws/ProveedorCentroTFWS.wsdl";
$serviceUrl = api_get_path(WEB_PLUGIN_PATH).'sepe/ws/service.php';
/**
* Class CustomServer
*/
class CustomServer extends Zend\Soap\Server
{
/**
@ -88,7 +91,12 @@ function authenticate($WSUser, $WSKey)
$tUser = Database::get_main_table(TABLE_MAIN_USER);
$tApi = Database::get_main_table(TABLE_MAIN_USER_API_KEY);
$login = Database::escape_string($WSUser);
$sql = "SELECT u.user_id, u.status FROM $tUser u, $tApi a WHERE u.username='".$login."' and u.user_id = a.user_id AND a.api_service = 'dokeos' and a.api_key='".$WSKey."'";
$sql = "SELECT u.user_id, u.status FROM $tUser u, $tApi a
WHERE
u.username='".$login."' AND
u.user_id = a.user_id AND
a.api_service = 'dokeos' AND
a.api_key='".$WSKey."'";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {

Loading…
Cancel
Save