/[drupal]/contributions/modules/ipaper/ipaper.module
ViewVC logotype

Diff of /contributions/modules/ipaper/ipaper.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.4.8, Mon Jun 16 00:18:43 2008 UTC revision 1.1.4.9, Tue Jun 17 05:33:06 2008 UTC
# Line 683  function _ipaper_request($request_url, $ Line 683  function _ipaper_request($request_url, $
683    if (variable_get('ipaper_log_requests', 0) && $params){    if (variable_get('ipaper_log_requests', 0) && $params){
684      $APImethod = $params['method'];      $APImethod = $params['method'];
685      $doc_id = $params['doc_id'] ? $params['doc_id'] : $params['doc_ids'];      $doc_id = $params['doc_id'] ? $params['doc_id'] : $params['doc_ids'];
686      watchdog('ipaper', "Action: $APImethod, Document ID: $doc_id", NULL, WATCHDOG_NOTICE, $request_url . http_build_query($params));      watchdog('ipaper', "Action: $APImethod, Document ID: $doc_id", WATCHDOG_NOTICE, $request_url . http_build_query($params));
687    }    }
688    
689    if (function_exists("curl_init")){    if (function_exists("curl_init")){
# Line 699  function _ipaper_request($request_url, $ Line 699  function _ipaper_request($request_url, $
699      return $data;      return $data;
700    }    }
701    else{    else{
   
     //I haven't yet figured out how to upload files via drupal_http_request  
     drupal_set_message("CURL is not enabled.", 'error');  
     return;  
   
     $data = NULL;  
702      $headers = array();      $headers = array();
703      if ($params['file']){      $data = NULL;
704        $headers = array('Content-Type' => 'multipart/form-data');      if ($method == "POST"){
705          require_once drupal_get_path('module', 'ipaper') .'/multipart.inc';
706          $boundary = 'A0sFSD';
707          $headers = array("Content-Type" => "multipart/form-data; boundary=$boundary");
708          $data = multipart_encode($boundary, $params);
709      }      }
710      $request = drupal_http_request($request_url, $headers, $method, http_build_query($params));      $request = drupal_http_request($request_url, $headers, $method, $data);
711      if ($request->error)      if ($request->error)
712        watchdog("ipaper", "Request failed - ". $request->error .' - '. http_build_query($params));        watchdog("ipaper", "Request failed - ". $request->error .' - '. http_build_query($params));
713        drupal_set_message($request->data);
714      return $request->data;      return $request->data;
715    }    }
716    

Legend:
Removed from v.1.1.4.8  
changed lines
  Added in v.1.1.4.9

  ViewVC Help
Powered by ViewVC 1.1.2