Changeset f57102f in TibisayFirmaWeb
- Timestamp:
- Sep 30, 2015, 9:51:45 AM (9 years ago)
- Branches:
- master
- Children:
- 1076148
- Parents:
- cc1b143
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
firma_adjuntos.js
rcc1b143 rf57102f 89 89 //console.log(data); 90 90 $.ajax({ 91 url: " sendFile.php",91 url: "./plugins/firma_adjuntos/sendFile.php", 92 92 type: "POST", 93 93 data: data, … … 114 114 //Enviar el identificador del documento y obterner el hash 115 115 $.ajax({ 116 url:" sendCert.php",116 url:"./plugins/firma_adjuntos/sendCert.php", 117 117 type: 'POST', 118 118 data: {"parameters":parameters,'format':format } … … 135 135 var singvalue = signature.hex; 136 136 $.ajax({ 137 url:" sendSing.php",137 url:"./plugins/firma_adjuntos/sendSing.php", 138 138 type: 'POST', 139 139 data: {"signature":singvalue,'format':format} … … 178 178 179 179 $.ajax({ 180 url: " sendFile.php",180 url: "./plugins/firma_adjuntos/sendFile.php", 181 181 type: "POST", 182 182 data: formData, … … 205 205 //Enviar el identificador del documento y obterner el hash 206 206 $.ajax({ 207 url:" sendCert.php",207 url:"./plugins/firma_adjuntos/sendCert.php", 208 208 type: 'POST', 209 209 data: {"parameters":parameters,'format':format} … … 223 223 var singvalue = signature.hex; 224 224 $.ajax({ 225 url:" sendSing.php",225 url:"./plugins/firma_adjuntos/sendSing.php", 226 226 type: 'POST', 227 227 data: {"signature":singvalue, "containerId":containerId, 'format':format} -
sendSing.php
rcc1b143 rf57102f 5 5 //Sección del pdf ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 6 7 if(isset($_POST['signature']) && $_POST['format'] == 'pdf') {7 if(isset($_POST['signature']) && $_POST['format'] == 'pdf') { 8 8 9 //$url = "https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/pdfs/resenas";10 11 9 $url = "https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/pdfs/resenas"; 10 //$url = "https://192.168.12.125:8443/Murachi/0.1/archivos/pdfs/resenas"; 11 $fields = array( 12 12 'signature' => $signatureData, 13 13 'containerId' => "" 14 14 ); 15 //print_r(json_encode($fields)); 16 $fieldsJson = json_encode($fields); 15 //print_r(json_encode($fields)); 16 $fieldsJson = json_encode($fields); 17 18 $headers = array( 19 'Content-Type: application/json', 20 'Authorization: Basic '. base64_encode("admin:admin"), 21 'Content-Length:'.strlen($fieldsJson) 22 ); 17 23 18 19 $headers = array( 20 'Content-Type: application/json', 21 'Authorization: Basic '. base64_encode("admin:admin"), // <--- 22 'Content-Length:'.strlen($signatureData) 23 ); 24 if ($ch = curl_init($url)) { 25 curl_setopt($ch, CURLOPT_TIMEOUT, 5); 26 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 27 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); 28 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 29 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 30 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 31 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); 32 //curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); 33 //curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 34 //curl_setopt($ch, CURLOPT_POST, true); // enable posting 24 35 25 if ($ch = curl_init($url)) { 26 curl_setopt($ch, CURLOPT_TIMEOUT, 5); 27 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 28 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); 29 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 30 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 31 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 32 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); 33 //curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); 34 //curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 35 //curl_setopt($ch, CURLOPT_POST, true); // enable posting 36 curl_setopt($ch, CURLOPT_POSTFIELDS, $fieldsJson); 37 //curl_setopt($ch, CURLOPT_POSTFIELDS, $parameterData); 36 38 37 curl_setopt($ch, CURLOPT_POSTFIELDS, $fieldsJson);38 //curl_setopt($ch, CURLOPT_POSTFIELDS, $parameterData);39 $data = curl_exec($ch); 40 $response = curl_getinfo($ch); 39 41 40 $data = curl_exec($ch);41 $response = curl_getinfo($ch);42 //print('curl getInfo: \n\t'); 43 print_r($response); 42 44 43 //print('curl getInfo: \n\t'); 44 //print_r($response); 45 if ($data == false) { 46 echo 'Warning : ' . curl_error($ch); 47 curl_close($ch); 48 print_r($data); 49 } 50 else { 51 echo'Exit'; 52 curl_close($ch); 53 print_r($data); 54 } 55 } 45 56 46 if ($data == false) { 47 //echo 'Warning : ' . curl_error($ch); 48 curl_close($ch); 49 //print_r($data); 50 } 51 else { 52 //echo'Exit'; 53 curl_close($ch); 54 print_r($data); 55 } 56 } 57 58 59 } 57 } 60 58 61 59 //Sección del bdoc ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: … … 93 91 94 92 $data = curl_exec($ch); 93 $datajson = json_decode($data,true); 94 $idFile = $datajson['signedFileId']; 95 $pathFile = 'https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/descargas/'. $idFile; 95 96 $response = curl_getinfo($ch); 96 97 … … 106 107 curl_close($ch); 107 108 //echo'Exit'; 108 print_r($ data);109 print_r($pathFile); 109 110 } 110 111 }
Note: See TracChangeset
for help on using the changeset viewer.