Beispiel #1
0
 /**
  * SendPost - Send values via curl to target
  *
  * @param User $user User properties
  * @param array $config TypoScript Settings
  * @param ContentObjectRenderer $contentObject
  * @return void
  */
 public static function sendPost($user, $config, $contentObject)
 {
     // stop if turned off
     if (!$contentObject->cObjGetSingle($config['new.']['sendPost.']['_enable'], $config['new.']['sendPost.']['_enable.'])) {
         return;
     }
     $properties = $user->_getCleanProperties();
     $contentObject->start($properties);
     $curl = array('url' => $config['new.']['sendPost.']['targetUrl'], 'data' => $contentObject->cObjGetSingle($config['new.']['sendPost.']['data'], $config['new.']['sendPost.']['data.']), 'properties' => $properties);
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $curl['url']);
     curl_setopt($ch, CURLOPT_POST, 1);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $curl['data']);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
     curl_exec($ch);
     curl_close($ch);
     // Debug Output
     if ($config['new.']['sendPost.']['debug']) {
         GeneralUtility::devLog('femanager sendpost values', 'femanager', 0, $curl);
     }
 }