Minor - format code.

pull/2487/head
jmontoyaa 8 years ago
parent 5a3d83c218
commit e0ca9fcc09
  1. 122
      main/exercise/Hpdownload.php
  2. 10
      main/inc/lib/AnnouncementManager.php
  3. 81
      main/inc/lib/timeline.lib.php
  4. 156
      main/webservices/soap.php
  5. 115
      plugin/sepe/ws/Sepe.php
  6. 68
      plugin/sepe/ws/service.php

@ -1,14 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script shows the list of exercises for administrators and students.
* @package chamilo.exercise
* @author Istvan Mandak
* @version $Id: Hpdownload.php 22201 2009-07-17 19:57:03Z cfasanando $
* This script shows the list of exercises for administrators and students.
* @package chamilo.exercise
* @author Istvan Mandak
* @version $Id: Hpdownload.php 22201 2009-07-17 19:57:03Z cfasanando $
*/
/**
* Code
*/
session_cache_limiter('public');
require_once __DIR__.'/../inc/global.inc.php';
@ -23,14 +20,14 @@ $filename = basename($doc_url);
//Event::event_download($doc_url);
if (isset($_course['path'])) {
$course_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
$full_file_name = $course_path.Security::remove_XSS($doc_url);
$full_file_name = $course_path.Security::remove_XSS($doc_url);
} else {
$course_path = api_get_path(SYS_COURSE_PATH).$cid.'/document';
$full_file_name = $course_path.Security::remove_XSS($doc_url);
$full_file_name = $course_path.Security::remove_XSS($doc_url);
}
if (!is_file($full_file_name)) {
exit;
exit;
}
if (!Security::check_abs_path($full_file_name, $course_path.'/')) {
@ -41,36 +38,36 @@ $extension = explode('.', $filename);
$extension = strtolower($extension[sizeof($extension) - 1]);
switch ($extension) {
case 'gz':
$content_type = 'application/x-gzip';
break;
case 'zip':
$content_type = 'application/zip';
break;
case 'pdf':
$content_type = 'application/pdf';
break;
case 'png':
$content_type = 'image/png';
break;
case 'gif':
$content_type = 'image/gif';
break;
case 'jpg':
$content_type = 'image/jpeg';
break;
case 'txt':
$content_type = 'text/plain';
break;
case 'htm':
$content_type = 'text/html';
break;
case 'html':
$content_type = 'text/html';
break;
default:
$content_type = 'application/octet-stream';
break;
case 'gz':
$content_type = 'application/x-gzip';
break;
case 'zip':
$content_type = 'application/zip';
break;
case 'pdf':
$content_type = 'application/pdf';
break;
case 'png':
$content_type = 'image/png';
break;
case 'gif':
$content_type = 'image/gif';
break;
case 'jpg':
$content_type = 'image/jpeg';
break;
case 'txt':
$content_type = 'text/plain';
break;
case 'htm':
$content_type = 'text/html';
break;
case 'html':
$content_type = 'text/html';
break;
default:
$content_type = 'application/octet-stream';
break;
}
header('Content-disposition: filename='.$filename);
@ -79,38 +76,38 @@ header('Expires: '.gmdate('D, d M Y H:i:s', time() + 10).' GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s', time() + 10).' GMT');
/*
Dynamic parsing section
is activated whenever a user views an html file
work in progress
- question: we could also parse per line,
perhaps this would be faster.
($file_content = file($full_file_name) returns file in array)
Dynamic parsing section
is activated whenever a user views an html file
work in progress
- question: we could also parse per line,
perhaps this would be faster.
($file_content = file($full_file_name) returns file in array)
*/
if ($content_type == 'text/html') {
$directory_name = dirname($full_file_name);
$directory_name = dirname($full_file_name);
$coursePath = api_get_path(SYS_COURSE_PATH);
$dir = str_replace(array('\\', $coursePath.$_course['path'].'/document'), array('/', ''), $directory_name);
$dir = str_replace(array('\\', $coursePath.$_course['path'].'/document'), array('/', ''), $directory_name);
if ($dir[strlen($dir) - 1] != '/') {
$dir .= '/';
}
if ($dir[strlen($dir) - 1] != '/') {
$dir .= '/';
}
//Parse whole file at one
$fp = fopen($full_file_name, "r");
$file_content = fread($fp, filesize($full_file_name));
fclose($fp);
//Parse whole file at one
$fp = fopen($full_file_name, "r");
$file_content = fread($fp, filesize($full_file_name));
fclose($fp);
$exercisePath = api_get_self();
$exfile = explode('/', $exercisePath);
$exfile = $exfile[sizeof($exfile) - 1];
$exercisePath = substr($exercisePath, 0, strpos($exercisePath, $exfile));
$exfile = explode('/', $exercisePath);
$exfile = $exfile[sizeof($exfile) - 1];
$exercisePath = substr($exercisePath, 0, strpos($exercisePath, $exfile));
$content = $file_content;
$mit = "function Finish(){";
$js_content = "var SaveScoreVariable = 0; // This variable included by Dokeos System\n".
"function mySaveScore() // This function included by Dokeos System\n".
"function mySaveScore() // This function included by Dokeos System\n".
"{\n".
" if (SaveScoreVariable==0)\n".
" {\n".
@ -133,18 +130,13 @@ if ($content_type == 'text/html') {
$prehref = "javascript:void(0);";
$posthref = api_get_path(WEB_CODE_PATH)."main/exercise/Hpdownload.php?doc_url=".$doc_url."&cid=".$cid."&uid=".$uid;
$newcontent = str_replace($prehref, $posthref, $newcontent);
$prehref = "class=\"GridNum\" onclick=";
$posthref = "class=\"GridNum\" onMouseover=";
$newcontent = str_replace($prehref, $posthref, $newcontent);
header('Content-length: '.strlen($newcontent));
// Dipsp.
echo $newcontent;
exit();
exit();
}
//normal case, all non-html files

@ -1180,12 +1180,12 @@ class AnnouncementManager
*/
public static function get_attachment($announcementId)
{
$tbl_announcement_attachment = Database::get_course_table(TABLE_ANNOUNCEMENT_ATTACHMENT);
$table = Database::get_course_table(TABLE_ANNOUNCEMENT_ATTACHMENT);
$announcementId = intval($announcementId);
$course_id = api_get_course_int_id();
$row = array();
$sql = 'SELECT id, path, filename, comment
FROM ' . $tbl_announcement_attachment.'
FROM '.$table.'
WHERE c_id = ' . $course_id.' AND announcement_id = '.$announcementId;
$result = Database::query($sql);
if (Database::num_rows($result) != 0) {
@ -1725,8 +1725,7 @@ class AnnouncementManager
if (api_is_allowed_to_edit(false, true)) {
// check teacher status
if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath') {
if (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath') {
if (api_get_group_id() == 0) {
$group_condition = '';
} else {
@ -1754,7 +1753,7 @@ class AnnouncementManager
}
} else {
// students only get to see the visible announcements
if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath') {
if (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath') {
$group_memberships = GroupManager::get_group_ids($_course['real_id'], $userId);
if ((api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous())) {
@ -1834,7 +1833,6 @@ class AnnouncementManager
ORDER BY display_order DESC
LIMIT 0, $maximum";
} else {
if (api_get_course_setting('allow_user_edit_announcement')) {
$cond_user_id = " AND (
ip.lastedit_user_id = '".api_get_user_id()."' OR ip.to_group_id='0' OR ip.to_group_id IS NULL

@ -36,7 +36,19 @@ class Timeline extends Model
public function get_count()
{
$course_id = api_get_course_int_id();
$row = Database::select('count(*) as count', $this->table, array('where' => array('parent_id = ? AND c_id = ?' => array('0', $course_id))), 'first');
$row = Database::select(
'count(*) as count',
$this->table,
array(
'where' => array(
'parent_id = ? AND c_id = ?' => array(
'0',
$course_id
)
)
),
'first'
);
return $row['count'];
}
@ -46,7 +58,11 @@ class Timeline extends Model
*/
public function get_all($where_conditions = array())
{
return Database::select('*', $this->table, array('where'=>$where_conditions, 'order' =>'headline ASC'));
return Database::select(
'*',
$this->table,
array('where' => $where_conditions, 'order' => 'headline ASC')
);
}
/**
@ -65,7 +81,10 @@ class Timeline extends Model
public function get_status_list()
{
return array(TIMELINE_STATUS_ACTIVE => get_lang('Active'), TIMELINE_STATUS_INACTIVE => get_lang('Inactive'));
return array(
TIMELINE_STATUS_ACTIVE => get_lang('Active'),
TIMELINE_STATUS_INACTIVE => get_lang('Inactive')
);
}
/**
@ -88,7 +107,6 @@ class Timeline extends Model
$form->addElement('hidden', 'id', $id);
$form->addElement('text', 'headline', get_lang('Name'), array('size' => '70'));
//$form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'Careers','Width' => '100%', 'Height' => '250'));
$status_list = $this->get_status_list();
$form->addElement('select', 'status', get_lang('Status'), $status_list);
if ($action == 'edit') {
@ -126,7 +144,6 @@ class Timeline extends Model
*/
public function return_item_form($url, $action)
{
$form = new FormValidator('item_form', 'post', $url);
// Setting the form elements
$header = get_lang('Add');
@ -152,9 +169,6 @@ class Timeline extends Model
$form->addRule('headline', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('start_date', get_lang('ThisFieldIsRequired'), 'required');
//$form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'Careers','Width' => '100%', 'Height' => '250'));
if ($action == 'edit') {
// Setting the defaults
$defaults = $this->get($id);
@ -162,19 +176,11 @@ class Timeline extends Model
} else {
$form->addButtonCreate(get_lang('Add'), 'submit');
}
/*if (!empty($defaults['created_at'])) {
$defaults['created_at'] = api_convert_and_format_date($defaults['created_at']);
}
if (!empty($defaults['updated_at'])) {
$defaults['updated_at'] = api_convert_and_format_date($defaults['updated_at']);
}*/
$form->setDefaults($defaults);
// Setting the rules
$form->addRule('headline', get_lang('ThisFieldIsRequired'), 'required');
return $form;
}
/**
@ -184,38 +190,42 @@ class Timeline extends Model
public function save_item($params)
{
$params['c_id'] = api_get_course_int_id();
$id = parent::save($params);
if (!empty($id)) {
//event_system(LOG_CAREER_CREATE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id());
}
return $id;
$id = parent::save($params);
if (!empty($id)) {
//event_system(LOG_CAREER_CREATE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id());
}
return $id;
}
/**
* @param array $params
* @return bool
*/
public function save($params) {
public function save($params)
{
$params['c_id'] = api_get_course_int_id();
$params['parent_id'] = '0';
$params['type'] = 'default';
$id = parent::save($params);
if (!empty($id)) {
//event_system(LOG_CAREER_CREATE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id());
}
return $id;
$id = parent::save($params);
if (!empty($id)) {
//event_system(LOG_CAREER_CREATE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id());
}
return $id;
}
public function delete($id) {
parent::delete($id);
//event_system(LOG_CAREER_DELETE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id());
public function delete($id)
{
parent::delete($id);
//event_system(LOG_CAREER_DELETE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id());
}
public function get_url($id) {
public function get_url($id)
{
return api_get_path(WEB_AJAX_PATH).'timeline.ajax.php?a=get_timeline_content&id='.intval($id);
}
public function get_timeline_content($id) {
public function get_timeline_content($id)
{
$timeline = array();
$course_id = api_get_course_int_id();
$timeline['timeline'] = $this->process_item($this->get($id));
@ -224,7 +234,8 @@ class Timeline extends Model
return $timeline;
}
function process_items($items) {
function process_items($items)
{
foreach ($items as &$item) {
$item = $this->process_item($item);
}
@ -234,7 +245,9 @@ class Timeline extends Model
}
return $new_array;
}
function process_item($item) {
function process_item($item)
{
$item['startDate'] = $item['start_date'];
unset($item['start_date']);
if (!empty($item['end_date'])) {

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.webservices
*/
@ -10,105 +11,116 @@ $libpath = api_get_path(LIBRARY_PATH);
/**
* SOAP error handler. Handles an error sending a SOAP fault
*/
class WSSoapErrorHandler implements WSErrorHandler {
/**
* Handles the error by sending a SOAP fault through the server
*
* @param WSError Error to handle
*/
public function handle($error) {
$server = WSSoapServer::singleton();
$server->fault(strval($error->code), $error->message);
}
class WSSoapErrorHandler implements WSErrorHandler
{
/**
* Handles the error by sending a SOAP fault through the server
*
* @param WSError Error to handle
*/
public function handle($error)
{
$server = WSSoapServer::singleton();
$server->fault(strval($error->code), $error->message);
}
}
/**
* SOAP server wrapper implementing a Singleton
*/
class WSSoapServer {
/**
* SOAP server instance
*
* @var soap_server
*/
private static $_instance;
class WSSoapServer
{
/**
* SOAP server instance
*
* @var soap_server
*/
private static $_instance;
/**
* Private constructor
*/
private function __construct() {
}
/**
* Constructor
*/
public function __construct()
{
}
/**
* Singleton method
*/
public static function singleton() {
if (!isset(self::$_instance)) {
self::$_instance = new soap_server();
// Set the error handler
WSError::setErrorHandler(new WSSoapErrorHandler());
// Configure the service
self::$_instance->configureWSDL('WSService', 'urn:WSService');
}
/**
* Singleton method
*/
public static function singleton()
{
if (!isset(self::$_instance)) {
self::$_instance = new soap_server();
// Set the error handler
WSError::setErrorHandler(new WSSoapErrorHandler());
// Configure the service
self::$_instance->configureWSDL('WSService', 'urn:WSService');
}
return self::$_instance;
}
return self::$_instance;
}
}
$s = WSSoapServer::singleton();
$s->wsdl->addComplexType(
'result',
'complexType',
'struct',
'all',
'',
array(
'code' => array('name' => 'code', 'type' => 'xsd:int'),
'message' => array('name' => 'message', 'type' => 'xsd:string')
)
'result',
'complexType',
'struct',
'all',
'',
array(
'code' => array('name' => 'code', 'type' => 'xsd:int'),
'message' => array('name' => 'message', 'type' => 'xsd:string')
)
);
$s->wsdl->addComplexType(
'extras',
'complexType',
'struct',
'all',
'',
array(
'field_name' => array('name' => 'field_name', 'type' => 'xsd:string'),
'field_value' => array('name' => 'field_value', 'type' => 'xsd:string')
)
'extras',
'complexType',
'struct',
'all',
'',
array(
'field_name' => array('name' => 'field_name', 'type' => 'xsd:string'),
'field_value' => array('name' => 'field_value', 'type' => 'xsd:string')
)
);
$s->wsdl->addComplexType(
'extra_field',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:extras[]')), 'tns:extras'
'extra_field',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(
array(
'ref' => 'SOAP-ENC:arrayType',
'wsdl:arrayType' => 'tns:extras[]'
)
),
'tns:extras'
);
/*
$s->wsdl->addComplexType(
'extra_field',
'complexType',
'struct',
'all',
'',
array(
'field_name' => array('name' => 'field_name', 'type' => 'xsd:string'),
'field_value' => array('name' => 'field_value', 'type' => 'xsd:string')
)
'extra_field',
'complexType',
'struct',
'all',
'',
array(
'field_name' => array('name' => 'field_name', 'type' => 'xsd:string'),
'field_value' => array('name' => 'field_value', 'type' => 'xsd:string')
)
);
*/
$s->register(
'WS.test',
array(),
array('return' => 'xsd:string')
'WS.test',
array(),
array('return' => 'xsd:string')
);
require_once __DIR__.'/soap_user.php';

@ -258,7 +258,6 @@ class Sepe
"ACCION_FORMATIVA"=>$crearAccionInputArray['ACCION_FORMATIVA']
)
);
}
$startDate = self::fixDate($startDate);
@ -810,24 +809,80 @@ class Sepe
$idEspecialidad->AREA_PROFESIONAL = $aux['professional_area'];
$idEspecialidad->CODIGO_ESPECIALIDAD = $aux['specialty_code'];
$params[0] = new SoapVar($idEspecialidad, SOAP_ENC_OBJECT, NULL, null, 'ID_ESPECIALIDAD', null);
$params[0] = new SoapVar(
$idEspecialidad,
SOAP_ENC_OBJECT,
null,
null,
'ID_ESPECIALIDAD',
null
);
$centroImparticion = new stdClass();
$centroImparticion->ORIGEN_CENTRO = $aux['center_origin'];
$centroImparticion->CODIGO_CENTRO = $aux['center_code'];
$params[1] = new SoapVar($centroImparticion, SOAP_ENC_OBJECT, NULL, null, 'CENTRO_IMPARTICION', null);
$params[2] = new SoapVar(self::undoFixDate($aux['start_date']), XSD_STRING, NULL, null, 'FECHA_INICIO', null);
$params[3] = new SoapVar(self::undoFixDate($aux['end_date']), XSD_STRING, NULL, null, 'FECHA_FIN', null);
$params[4] = new SoapVar($aux['modality_impartition'], XSD_STRING, NULL, null, 'MODALIDAD_IMPARTICION', null);
$params[1] = new SoapVar(
$centroImparticion,
SOAP_ENC_OBJECT,
null,
null,
'CENTRO_IMPARTICION',
null
);
$params[2] = new SoapVar(
self::undoFixDate($aux['start_date']),
XSD_STRING,
null,
null,
'FECHA_INICIO',
null
);
$params[3] = new SoapVar(
self::undoFixDate($aux['end_date']),
XSD_STRING,
null,
null,
'FECHA_FIN',
null
);
$params[4] = new SoapVar(
$aux['modality_impartition'],
XSD_STRING,
null,
null,
'MODALIDAD_IMPARTICION',
null
);
$obj = new stdClass();
$obj->HORAS_PRESENCIAL = $aux['classroom_hours'];
$obj->HORAS_TELEFORMACION = $aux['distance_hours'];
$params[5] = new SoapVar($obj, SOAP_ENC_OBJECT, NULL, null, 'DATOS_DURACION', null);
$params[6] = new SoapVar($classroomCenterList, SOAP_ENC_OBJECT, null, null, 'CENTROS_SESIONES_PRESENCIALES', null);
$params[7] = new SoapVar($trainingTutors, SOAP_ENC_OBJECT, null, null, 'TUTORES_FORMADORES', null);
$params[5] = new SoapVar(
$obj,
SOAP_ENC_OBJECT,
null,
null,
'DATOS_DURACION',
null
);
$params[6] = new SoapVar(
$classroomCenterList,
SOAP_ENC_OBJECT,
null,
null,
'CENTROS_SESIONES_PRESENCIALES',
null
);
$params[7] = new SoapVar(
$trainingTutors,
SOAP_ENC_OBJECT,
null,
null,
'TUTORES_FORMADORES',
null
);
$obj = new stdClass();
@ -873,8 +928,21 @@ class Sepe
$obj->SEGUIMIENTO_EVALUACION->NUMERO_ACTIVIDADES_EVALUACION = $aux['evaluation_activity_count'];
}
$params[8] = new SoapVar($obj, SOAP_ENC_OBJECT, null, null, 'USO', null);
$specialty[] = new SoapVar($params, SOAP_ENC_OBJECT, null, null, 'ESPECIALIDAD');
$params[8] = new SoapVar(
$obj,
SOAP_ENC_OBJECT,
null,
null,
'USO',
null
);
$specialty[] = new SoapVar(
$params,
SOAP_ENC_OBJECT,
null,
null,
'ESPECIALIDAD'
);
}
} else {
return array(
@ -921,7 +989,13 @@ class Sepe
$obj->FECHA_FIN = $endDate;
}
$obj = new SoapVar($obj, SOAP_ENC_OBJECT, null, null, 'TUTORIA_PRESENCIAL');
$obj = new SoapVar(
$obj,
SOAP_ENC_OBJECT,
null,
null,
'TUTORIA_PRESENCIAL'
);
$classroomTutorials->append($obj);
}
@ -943,7 +1017,14 @@ class Sepe
$obj->FECHA_BAJA = $leavingDate;
}
$obj->TUTORIAS_PRESENCIALES = new SoapVar($classroomTutorials, SOAP_ENC_OBJECT, null, null, 'TUTORIAS_PRESENCIALES', null);
$obj->TUTORIAS_PRESENCIALES = new SoapVar(
$classroomTutorials,
SOAP_ENC_OBJECT,
null,
null,
'TUTORIAS_PRESENCIALES',
null
);
$obj->EVALUACION_FINAL = new stdClass();
if (!empty($tmp['center_origin']) && !empty($tmp['center_code'])) {
@ -975,7 +1056,13 @@ class Sepe
if (isset($tmp['final_score']) && $tmp['final_score'] != '') {
$obj->RESULTADOS->PUNTUACION_FINAL = $tmp['final_score'];
}
$specialtyParticipant[] = new SoapVar($obj, SOAP_ENC_OBJECT, null, null, 'ESPECIALIDAD');
$specialtyParticipant[] = new SoapVar(
$obj,
SOAP_ENC_OBJECT,
null,
null,
'ESPECIALIDAD'
);
}
$params = new stdClass();

@ -20,7 +20,6 @@ require_once api_get_path(SYS_PLUGIN_PATH).'sepe/src/wsse/soap-server-wsse.php';
$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 extends Zend\Soap\Server
@ -86,22 +85,22 @@ class CustomServer extends Zend\Soap\Server
function authenticate($WSUser,$WSKey)
{
$tUser = Database::get_main_table(TABLE_MAIN_USER);
$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."'";
$result = Database::query($sql);
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
$row = Database::fetch_row($result);
if ($row[1] == '4') { //UserManager::is_admin($row[0])) {
$row = Database::fetch_row($result);
if ($row[1] == '4') { //UserManager::is_admin($row[0])) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
$doc = new DOMDocument();
@ -109,36 +108,33 @@ $post = file_get_contents('php://input');
if (!empty($post)) {
$doc->loadXML($post);
$WSUser = $doc->getElementsByTagName('Username')->item(0)->nodeValue;
$WSKey = $doc->getElementsByTagName('Password')->item(0)->nodeValue;
$WSUser = $doc->getElementsByTagName('Username')->item(0)->nodeValue;
$WSKey = $doc->getElementsByTagName('Password')->item(0)->nodeValue;
$s = new WSSESoapServer($doc);
if (!empty($WSUser) && !empty($WSKey)) {
if (authenticate($WSUser,$WSKey)) {
// pointing to the current file here
$options = array(
'soap_version' => SOAP_1_1
);
$soap = new CustomServer($wsdl, $options);
$soap->setObject(new Sepe());
if ($s->process()) {
$xml = $s->saveXML();
//header('Content-type: application/xml');
$soap->handle($xml);
exit;
} else {
error_log('not processed');
}
} else {
error_log('Claves incorrectas');
}
} else {
error_log('not processed');
}
if (!empty($WSUser) && !empty($WSKey)) {
if (authenticate($WSUser, $WSKey)) {
// pointing to the current file here
$options = array(
'soap_version' => SOAP_1_1
);
$soap = new CustomServer($wsdl, $options);
$soap->setObject(new Sepe());
if ($s->process()) {
$xml = $s->saveXML();
//header('Content-type: application/xml');
$soap->handle($xml);
exit;
} else {
error_log('not processed');
}
} else {
error_log('Claves incorrectas');
}
} else {
error_log('not processed');
}
} else {
$contents = file_get_contents($wsdl);
header('Content-type: application/xml');

Loading…
Cancel
Save