Beispiel #1
0
 function make_serialized_task_params()
 {
     global $dbh, $type_proc, $form_procs, $form_procs_remote;
     global $pmb_procedure_server_credentials, $pmb_procedure_server_address;
     $t = parent::make_serialized_task_params();
     $t["type_proc"] = stripslashes($type_proc);
     $t["form_procs"] = stripslashes($form_procs);
     $t["form_procs_remote"] = stripslashes($form_procs_remote);
     if ($form_procs) {
         $hp = new parameters($form_procs, "procs");
         $t["envt"] = $hp->make_serialized_parameters_params();
     } else {
         if ($form_procs_remote) {
             $id = $form_procs_remote;
             $pmb_procedure_server_credentials_exploded = explode("\n", $pmb_procedure_server_credentials);
             if ($pmb_procedure_server_address && count($pmb_procedure_server_credentials_exploded) == 2) {
                 $aremote_procedure_client = new remote_procedure_client($pmb_procedure_server_address, trim($pmb_procedure_server_credentials_exploded[0]), trim($pmb_procedure_server_credentials_exploded[1]));
                 $procedure = $aremote_procedure_client->get_proc($id, "AP");
                 if (!$procedure["error_message"]) {
                     $the_procedure = $procedure["procedure"];
                     if ($the_procedure) {
                         $sql = "CREATE TEMPORARY TABLE remote_proc LIKE procs";
                         mysql_query($sql, $dbh) or die(mysql_error());
                         $sql = "INSERT INTO remote_proc (idproc, name, requete, comment, autorisations, parameters, num_classement) VALUES (0, '" . mysql_escape_string($the_procedure->name) . "', '" . mysql_escape_string($the_procedure->sql) . "', '" . mysql_escape_string($the_procedure->comment) . "', '', '" . mysql_escape_string($the_procedure->params) . "', 0)";
                         mysql_query($sql, $dbh) or die(mysql_error());
                         $idproc = mysql_insert_id($dbh);
                         $hp = new parameters($idproc, "remote_proc");
                         $t["envt"] = $hp->make_serialized_parameters_params();
                     }
                 }
             }
         }
     }
     return serialize($t);
 }
Beispiel #2
0
 function make_serialized_task_params()
 {
     global $dbh, $type_proc, $form_procs, $form_procs_remote;
     global $tocsv_checked, $tocsv_sep, $tocsv_filepath, $tocsv_enclosure;
     global $pmb_procedure_server_credentials, $pmb_procedure_server_address;
     $t = parent::make_serialized_task_params();
     $t['type_proc'] = stripslashes($type_proc);
     $t['form_procs'] = stripslashes($form_procs);
     $t['form_procs_remote'] = stripslashes($form_procs_remote);
     $t['tocsv']['checked'] = $tocsv_checked;
     $t['tocsv']['sep'] = stripslashes($tocsv_sep);
     $t['tocsv']['filepath'] = stripslashes($tocsv_filepath);
     $t['tocsv']['enclosure'] = stripslashes($tocsv_enclosure);
     if ($form_procs) {
         $hp = new parameters($form_procs, 'procs');
         $t['envt'] = $hp->make_serialized_parameters_params();
     } else {
         if ($form_procs_remote) {
             $id = $form_procs_remote;
             $pmb_procedure_server_credentials_exploded = explode("\n", $pmb_procedure_server_credentials);
             if ($pmb_procedure_server_address && count($pmb_procedure_server_credentials_exploded) == 2) {
                 $aremote_procedure_client = new remote_procedure_client($pmb_procedure_server_address, trim($pmb_procedure_server_credentials_exploded[0]), trim($pmb_procedure_server_credentials_exploded[1]));
                 $procedure = $aremote_procedure_client->get_proc($id, "AP");
                 if (!$procedure['error_message']) {
                     $the_procedure = $procedure['procedure'];
                     if ($the_procedure) {
                         $sql = "CREATE TEMPORARY TABLE remote_proc LIKE procs";
                         pmb_mysql_query($sql, $dbh) or die(pmb_mysql_error());
                         $sql = "INSERT INTO remote_proc (idproc, name, requete, comment, autorisations, parameters, num_classement) VALUES (0, '" . pmb_mysql_escape_string($the_procedure->name) . "', '" . pmb_mysql_escape_string($the_procedure->sql) . "', '" . pmb_mysql_escape_string($the_procedure->comment) . "', '', '" . pmb_mysql_escape_string($the_procedure->params) . "', 0)";
                         pmb_mysql_query($sql, $dbh) or die(pmb_mysql_error());
                         $idproc = pmb_mysql_insert_id($dbh);
                         $hp = new parameters($idproc, "remote_proc");
                         $t['envt'] = $hp->make_serialized_parameters_params();
                     }
                 }
             }
         }
     }
     return serialize($t);
 }