function process_stack($stack)
{
    $xml = '<?xml version="1.0" encoding="' . FIANET_ENCODING . '" ?>' . "\n";
    $xml .= '<stack>' . "\n";
    foreach ($stack as $order) {
        $xml .= $order->get_xml();
        if (!isset($siteid)) {
            $siteid = $order->info_commande->siteid;
        }
    }
    $xml .= '</stack>';
    $data['siteid'] = $siteid;
    $data['controlcallback'] = clean_xml($xml);
    $this->send_fsock_stacking($data);
}
Ejemplo n.º 2
0
function clean_stream($incoming)
{
    debug("clean_stream ()");
    global $pure;
    $temper = array();
    // take out the payload ...
    foreach ($incoming as $examiner) {
        $newlined = str_replace("\n", "", $examiner);
        $test = strstr($newlined, "</log_action>");
        if ($test != false) {
            $tutorinfo = strstr($newlined, "<tutor_related_message_sequence");
            $payloadindex = strpos($newlined, "<tutor_related_message_sequence");
            $tutorpayload = substr($newlined, 0, $payloadindex);
            $tutorpayload .= "</log_action>";
            array_push($temper, clean_xml($tutorpayload));
            $tutormessage = str_replace("</log_action>", "", $tutorinfo);
            array_push($temper, '<?xml_version "1.0" encoding="UTF-8"?>' . $tutormessage);
        } else {
            array_push($temper, $newlined);
            array_push($temper, "<content></content>");
        }
    }
    return $temper;
}
 function get_formular($url_call = null, $url_sys = null, $ParamCallBack = array(), $typeIHM = 3, $enProd = false, $auto_send = true)
 {
     $flux = $this->get_xml();
     $flux = clean_xml($flux);
     $flux = str_replace('"', "'", $flux);
     $flux = str_replace('&amp;', '&amp;amp;', $flux);
     $flux = str_replace('&lt;', '&amp;lt;', $flux);
     $flux = str_replace('&gt;', '&amp;gt;', $flux);
     $my_hashmd5 = new HashMD5();
     //$toto = html_entity_decode($flux);
     //debug($toto);
     $checksum = $my_hashmd5->hash(html_entity_decode($flux));
     if (is_array($ParamCallBack) && count($ParamCallBack) > 0) {
         $XMLParam = new fianet_xml_paracallback_builder();
         foreach ($ParamCallBack as $index => $value) {
             $XMLParam->add_param(new fianet_paraobject_xml($index, urlencode(htmlentities($value))));
         }
     }
     if ($enProd) {
         $url = URL_RNP_PROD;
     } else {
         $url = URL_RNP_TEST;
     }
     $url .= URL_RNP_FRONTLINE;
     $form = '';
     $form .= '<form name="RnPform" action="' . $url . '" method="post">';
     $form .= '<input type="hidden" name="MerchID" value="' . $this->info_commande->siteid . '">' . "\n";
     $form .= '<input type="hidden" name="XMLInfo" value="' . $flux . '">' . "\n";
     if ($url_call != null && $url_call != '') {
         $form .= '<input type="hidden" name="URLCall" value="' . $url_call . '">' . "\n";
     }
     if ($url_sys != null && $url_sys != '') {
         $form .= '<input type="hidden" name="URLSys" value="' . $url_sys . '">' . "\n";
     }
     if (isset($XMLParam)) {
         $form .= '<input type="hidden" name="XMLParam" value="' . clean_xml(str_replace('"', "'", $XMLParam->get_xml())) . '">' . "\n";
     }
     $form .= '<input type="hidden" name="CheckSum" value="' . $checksum . '">' . "\n";
     $form .= '<input type="hidden" name="TypeIHM" value="' . $typeIHM . '">' . "\n";
     $form .= '</form>';
     if ($auto_send) {
         $form .= '<script>document.RnPform.submit();</script>';
     }
     return $form;
 }
 {
     return str_replace(array('<![CDATA', ']]>'), array('&lt;![CDATA', ']]&gt;'), $str);
 }
 echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
 echo '<kleeja>' . "\n";
 echo "\t" . '<info>' . "\n";
 echo "\t\t" . '<plugin_name>' . clean_xml($row['plg_name']) . '</plugin_name>' . "\n";
 echo "\t\t" . '<plugin_version>' . clean_xml($row['plg_ver']) . '</plugin_version>' . "\n";
 echo "\t\t" . '<plugin_description>' . "\n";
 $plgdsc = unserialize(kleeja_base64_decode($row['plg_dsc']));
 foreach ($plgdsc as $ln => $cn) {
     echo "\t\t\t" . '<description lang="' . $ln . '">' . clean_xml($cn) . '</description>' . "\n";
 }
 echo "\t\t" . '</plugin_description>' . "\n";
 echo "\t\t" . '<plugin_author>' . clean_xml($row['plg_author']) . '</plugin_author>' . "\n";
 echo "\t\t" . '<plugin_kleeja_version>' . clean_xml(KLEEJA_VERSION) . '</plugin_kleeja_version>' . "\n";
 echo "\t" . '</info>' . "\n";
 if (!empty($row['plg_instructions'])) {
     echo "\t" . '<instructions>' . "\n";
     $inst = unserialize(kleeja_base64_decode($row['plg_instructions']));
     foreach ($inst as $lang => $instruction) {
         echo "\t\t" . '<instruction lang="' . $lang . '"><![CDATA[' . clean_xml_cdata($instruction) . ']]></instruction>' . "\n";
     }
     echo "\t" . '</instructions>' . "\n";
 }
 echo "\t" . '<uninstall><![CDATA[' . "\n";
 echo clean_xml_cdata($row['plg_uninstall']);
 echo "\t" . ']]></uninstall>' . "\n";
 echo "\t" . $row['plg_store'] . "\n";
 $querylang = $SQL->build(array('SELECT' => 'DISTINCT(lang_id)', 'FROM' => "{$dbprefix}lang", 'WHERE' => "plg_id=" . $plg_id));
 if ($SQL->num_rows($querylang) > 0) {