';
return $result;
}
function update_config_from_form() {
global $cache_wsdl;
$this->config["cache_wsdl"] = isset($cache_wsdl);
return;
}
function instantiate_source_class($source_id) {
return new apisoap_source($this, $source_id, $this->msg);
}
//On chargera nous même les messages si on en a besoin
function need_global_messages() {
return false;
}
function process($source_id, $pmb_user_id) {
global $base_path;
require_once ($base_path."/admin/connecteurs/out/apisoap/apisoap_soapserver.class.php");
$apisoapserver = new apisoap_soapserver($this);
$apisoapserver->process($source_id, $pmb_user_id);
//Rien
return;
}
function get_running_pmb_userid($source_id) {
global $wsdl;
$get_wsdl = isset($wsdl);
//Si on ne souhaite que le wsdl, alors on laisse passer
if ($get_wsdl)
return 1;
if (!isset($_SERVER['PHP_AUTH_USER'])) {
//Si on ne nous fourni pas de credentials, alors on teste l'utilisateur anonyme
$user_id = connector_out_check_credentials('', '', $source_id);
if ($user_id === false) {
header('WWW-Authenticate: Basic realm="PMB SOAP"');
header('HTTP/1.0 401 Unauthorized');
exit();
}
}
else {
//Sinon on teste les credentiels fournis
$rawusername = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
$user_id = connector_out_check_credentials($rawusername, $password, $source_id);
if ($user_id === false) {
header('WWW-Authenticate: Basic realm="PMB SOAP"');
header('HTTP/1.0 401 Unauthorized');
exit();
}
}
return $user_id;
}
}
class apisoap_source extends connecteur_out_source {
function get_config_form() {
global $charset;
$result = parent::get_config_form();
$api_catalog = new es_catalog();
$api_functions = array();
foreach ($api_catalog->groups as $agroup) {
foreach ($agroup->methods as $amethod) {
$api_functions[$agroup->name][] = $amethod->name;
}
}
if (!isset($this->config["exported_functions"]))
$this->config["exported_functions"] = array();
$selected_functions = array();
foreach ($this->config["exported_functions"] as $afunction) {
$selected_functions[] = $afunction["group"]."|_|".$afunction["name"];
}
//Adresse d'utilisation
$result .= '