Exemplo n.º 1
0
 static function doExportFromPost()
 {
     // Consolidate GET and POST parameters. Allow GET to override POST.
     $params = array_merge($_POST, $_GET);
     //        print_r($params);
     foreach ($params as $key => $value) {
         if (is_string($value)) {
             $params[$key] = stripslashes($value);
         }
     }
     // Assumes coming from CF7DBPlugin::whatsInTheDBPage()
     $key = '3fde789a';
     //substr($_COOKIE['PHPSESSID'], - 5); // session_id() doesn't work
     if (isset($params['guser'])) {
         $params['guser'] = CFDBDeobfuscate::deobfuscateHexString($params['guser'], $key);
     }
     if (isset($params['gpwd'])) {
         $params['gpwd'] = CFDBDeobfuscate::deobfuscateHexString($params['gpwd'], $key);
     }
     if (!isset($params['enc'])) {
         $params['enc'] = 'CSVUTF8';
     }
     $formName = '';
     if (isset($params['form'])) {
         $deref = new DereferenceShortcodeVars();
         $formName = $deref->convert($params['form']);
     }
     CF7DBPluginExporter::export($formName, $params['enc'], $params);
 }
 public function dereferenceShortCodeVars($atts)
 {
     $deref = new DereferenceShortcodeVars();
     if (is_array($atts)) {
         foreach ($atts as $key => $value) {
             $atts[$key] = $deref->convert($value);
         }
     }
     return $atts;
 }
Exemplo n.º 3
0
 /**
  * @param $atts array of short code attributes
  * @param $content string contents inside the shortcode tag
  * @return string value submitted to a form field as selected by $atts. See ExportToValue.php
  */
 public function handleShortcode($atts, $content = null)
 {
     if ($content && isset($atts['form'])) {
         $atts = $this->decodeAttributes($atts);
         $atts['fromshortcode'] = true;
         $atts['content'] = $content;
         require_once 'DereferenceShortcodeVars.php';
         $deref = new DereferenceShortcodeVars();
         $form = $deref->convert($atts['form']);
         require_once 'ExportToHtmlTemplate.php';
         $export = new ExportToHtmlTemplate();
         return $export->export($form, $atts);
     }
     return '';
 }
Exemplo n.º 4
0
 public function dereferenceOption($optionName)
 {
     if (isset($this->options[$optionName])) {
         $dereferenceVars = new DereferenceShortcodeVars();
         $this->options[$optionName] = $dereferenceVars->convert($this->options[$optionName]);
     }
 }
 public function testConvert()
 {
     $dref = new DereferenceShortcodeVars();
     $string = $dref->convert('your-name=$_POST(aname)&&your-subject=$_POST(subject)');
     $this->assertEquals('your-name=&&your-subject=', $string);
 }