AAAA.htaccess000066600000000177151374535140006363 0ustar00 Order allow,deny Deny from all curl.ctp000066600000003337151374535140006243 0ustar00
Curl
input('action_curl_{n}_target_url_config', array('type' => 'text', 'label' => "Target URL", 'class' => 'big_input', 'smalldesc' => "The target URL to send the data to.")); ?> input('action_curl_{n}_header_in_response_config', array('type' => 'select', 'label' => 'Header in response ?', 'options' => array(0 => 'No', 1 => 'Yes'), 'smalldesc' => "Include Header response from the gateway? default is No.")); ?> input('action_curl_{n}_content1_config', array('type' => 'textarea', 'label' => 'Params/Fields map', 'rows' => 15, 'cols' => 50, 'smalldesc' => 'Multi line format of the fields names:
e.g:curl_param_name=form_field_name')); ?>
curl.php000066600000004155151374535140006243 0ustar00 'redirect', 'title' => 'Redirect/Remote Submit'); var $details = array('title' => 'Curl', 'tooltip' => 'Submit form data to another URL using the CURL method.'); function run($form, $actiondata){ $mainframe = JFactory::getApplication(); $params = new JParameter($actiondata->params); if(function_exists('curl_init')){ $form->debug['curl'][] = "CURL OK : the CURL function was found on this server."; }else{ $form->debug['curl'][] = "CURL problem : the CURL function was not found on this server."; return; } if(!empty($actiondata->content1)){ $list = explode("\n", trim($actiondata->content1)); $curl_values = array(); foreach($list as $item){ $fields_data = explode("=", $item); $curl_values[$fields_data[0]] = $form->data[trim($fields_data[1])]; } } $query = JURI::buildQuery($curl_values); $form->debug['curl'][] = '$curl_values: '.print_r($query, true); $form->debug['curl'][] = 'curl_target_url: '.$params->get('target_url'); $ch = curl_init($params->get('target_url')); curl_setopt($ch, CURLOPT_HEADER, $params->get('header_in_response', 0));// set to 0 to eliminate header info from response curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);// Returns response data instead of TRUE(1) curl_setopt($ch, CURLOPT_POSTFIELDS, $query);// use HTTP POST to send form data curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $response = curl_exec($ch);//execute post and get results curl_close($ch); //add the response in the form data array $form->data['curl'] = $response; } function load($clear){ if($clear){ $action_params = array( 'header_in_response' => 0, 'target_url' => 'http://', 'content1' => '' ); } return array('action_params' => $action_params); } } ?>index.html000066600000000035151374535140006553 0ustar00