Beispiel #1
0
function run_task($id_tache, $type_tache, $id_planificateur, $num_es_user, $connectors_out_source_id)
{
    global $base_path, $dbh;
    global $PMBuserid;
    @ini_set('zend.ze1_compatibility_mode', 0);
    $query = "select * from connectors_out_sources where connectors_out_source_id=" . $connectors_out_source_id;
    $res = mysql_query($query);
    $row = mysql_fetch_object($res);
    $connectors_out_sources_connectornum = $row->connectors_out_sources_connectornum;
    $daconn = instantiate_connecteur_out($connectors_out_sources_connectornum);
    if ($daconn) {
        $source_object = $daconn->instantiate_source_class($connectors_out_source_id);
    } else {
        $source_object = NULL;
    }
    $es = new external_services();
    $array_functions = array();
    foreach ($source_object->config["exported_functions"] as $exported_function) {
        $array_functions[] = $exported_function["group"] . "_" . $exported_function["name"];
    }
    $proxy = $es->get_proxy($PMBuserid, $array_functions);
    $filename = $base_path . "/admin/planificateur/catalog.xml";
    $xml = file_get_contents($filename);
    $param = _parser_text_no_function_($xml, "CATALOG");
    foreach ($param["ACTION"] as $anitem) {
        if ($type_tache == $anitem["ID"]) {
            require_once $base_path . "/admin/planificateur/" . $anitem["NAME"] . "/" . $anitem["NAME"] . ".class.php";
            $obj_type = new $anitem["NAME"]($id_tache);
            $obj_type->setEsProxy($proxy);
            $obj_type->execute();
            $obj_type->checkParams($id_planificateur);
        }
    }
}
Beispiel #2
0
function show_connector_out_form($connector_id)
{
    global $msg;
    print '<form method="POST" action="admin.php?categ=connecteurs&sub=out&action=update" name="form_connectorout">';
    print '<h3>' . $msg['connector_out_edit'] . '</h3>';
    print '<div class="form-contenu">';
    //id
    print '<input type="hidden" name="id" value="' . $connector_id . '" />';
    $daconn = instantiate_connecteur_out($connector_id);
    if ($daconn) {
        echo $daconn->get_config_form();
    }
    //buttons
    print "</div><div class='row'>\n\t<div class='left'>";
    print "<input class='bouton' type='button' value=' {$msg['76']} ' onClick=\"document.location='./admin.php?categ=connecteurs&sub=out'\" />&nbsp";
    print '<input class="bouton" type="submit" value="' . $msg[77] . '" />';
    print "</div></div>&nbsp;";
    print '</form>';
}
Beispiel #3
0
$source_id += 0;
if (!$source_id) {
    die;
}
//Trouvons de quel connecteur dépend la source
$sql = "SELECT connectors_out_sources_connectornum FROM connectors_out_sources WHERE connectors_out_source_id = " . $source_id;
$res = mysql_query($sql, $dbh);
if (!mysql_num_rows($res)) {
    die;
}
$connector_id = mysql_result($res, 0, 0);
if (!$connector_id) {
    die;
}
//Instantions le connecteur
$daconn = instantiate_connecteur_out($connector_id);
//Cherchons l'id de l'utilisateur pmb qui doit faire tourner les fonctions
$running_pmb_user_id = $daconn->get_running_pmb_userid($source_id);
//Créons un environnement de session virtuel.
if (!create_user_environment($running_pmb_user_id)) {
    die;
}
if (SESSlang) {
    $lang = SESSlang;
    $helpdir = $lang;
} else {
    $lang = "fr_FR";
    $helpdir = "fr_FR";
}
if ($daconn->need_global_messages()) {
    //Allons chercher les messages