Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions component/libraries/redform/core/form/submission.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct($formId = null)
{
if ($formId)
{
$formId = (int) $formId;
$formId = (int) $formId;
$this->formId = $formId;
}
}
Expand Down Expand Up @@ -104,7 +104,7 @@ public function apisaveform($integration_key = '', $options = array(), $formData
$token = RdfCore::getToken();

// Get data from post if not specified
$data = $formData;
$data = $formData;
$data['form_id'] = isset($data['form_id']) ? $data['form_id'] : $app->input->getInt('form_id', 0);
$data['module_id'] = isset($data['module_id']) ? $data['module_id'] : $app->input->getInt('module_id', 0);
$data['submit_key'] = isset($data['submit_key']) ? $data['submit_key'] : $app->input->getCmd('submit_key', false);
Expand Down Expand Up @@ -244,12 +244,12 @@ public function apisaveform($integration_key = '', $options = array(), $formData
throw new RdfExceptionSubmission('Form integrity check failed');
}

if (RdfEntityForm::load($this->formId)->get('captchaactive'))
if (RdfEntityForm::load($this->formId)->get('captchaactive') && $form->getParam('captchaactive'))
{
JPluginHelper::importPlugin('redform_captcha');
$res = true;
$res = true;
$dispatcher = JDispatcher::getInstance();
$results = $dispatcher->trigger('onCheckCaptcha', array(&$res));
$results = $dispatcher->trigger('onCheckCaptcha', array(&$res));

if (count($results) && $res == false)
{
Expand Down Expand Up @@ -322,7 +322,7 @@ public function apisaveform($integration_key = '', $options = array(), $formData
*/
public function quicksubmit($fields, $integration = null, $options = null)
{
$submit_key = uniqid();
$submit_key = uniqid();
$this->submit_key = $submit_key;

$form = $this->getForm();
Expand Down Expand Up @@ -395,7 +395,7 @@ public function hasActivePayment($submitKey = null)
$submitKey = $this->submitKey;
}

$db = JFactory::getDbo();
$db = JFactory::getDbo();
$query = $db->getQuery(true);

$query->select('pr.id');
Expand Down Expand Up @@ -452,7 +452,7 @@ public function getCartReference()
throw new RuntimeException('missing submit key');
}

$db = JFactory::getDbo();
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('c.reference')
->from('#__rwf_cart AS c')
Expand Down Expand Up @@ -497,7 +497,7 @@ public function load($sids = null)

foreach ($sids as $sid)
{
$answers = $this->getSidAnswers($sid);
$answers = $this->getSidAnswers($sid);
$this->answers[] = $answers;
}
}
Expand All @@ -514,7 +514,7 @@ public function load($sids = null)
*/
public function getSids($submitKey)
{
$db = JFactory::getDbo();
$db = JFactory::getDbo();
$query = $db->getQuery(true);

$query->select('id');
Expand Down Expand Up @@ -680,14 +680,14 @@ protected function updateMailingList(RdfAnswers $answers)
if (!$lists['email'])
{
$emails = $answers->getSubmitterEmails();
$email = reset($emails);
$email = reset($emails);
}
else
{
$email = $lists['email'];
}

$subscriber = new stdclass;
$subscriber = new stdclass;
$subscriber->name = empty($fullname) ? $email : $fullname;
$subscriber->email = $email;

Expand Down