Commit 6750fd37 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Fix form submission for no-reply email setting (Bug #946880)"

parents a824c9eb 1a83b282
...@@ -931,10 +931,17 @@ function auth_check_required_fields() { ...@@ -931,10 +931,17 @@ function auth_check_required_fields() {
'name' => 'requiredfields', 'name' => 'requiredfields',
'method' => 'post', 'method' => 'post',
'action' => '', 'action' => '',
'elements' => $elements 'elements' => $elements,
'dieaftersubmit' => FALSE,
'backoutaftersubmit' => TRUE,
)); ));
} }
// Has the form been successfully submitted? Back out and let the requested URL continue.
if ($form === FALSE) {
return;
}
$smarty = smarty(); $smarty = smarty();
if ($USER->get('parentuser')) { if ($USER->get('parentuser')) {
$smarty->assign('loginasoverridepasswordchange', $smarty->assign('loginasoverridepasswordchange',
...@@ -1103,6 +1110,10 @@ function requiredfields_submit(Pieform $form, $values) { ...@@ -1103,6 +1110,10 @@ function requiredfields_submit(Pieform $form, $values) {
} }
} }
if ($form->get_property('backoutaftersubmit')) {
return;
}
redirect(); redirect();
} }
......
...@@ -160,7 +160,12 @@ class Pieform {/*{{{*/ ...@@ -160,7 +160,12 @@ class Pieform {/*{{{*/
*/ */
public static function process($data) {/*{{{*/ public static function process($data) {/*{{{*/
$form = new Pieform($data); $form = new Pieform($data);
return $form->build(); if ($form->get_property('backingout')) {
return FALSE;
}
else {
return $form->build();
}
}/*}}}*/ }/*}}}*/
/** /**
...@@ -536,6 +541,9 @@ class Pieform {/*{{{*/ ...@@ -536,6 +541,9 @@ class Pieform {/*{{{*/
} }
else { else {
// Successful submission, and the user doesn't care about replying, so... // Successful submission, and the user doesn't care about replying, so...
if (isset($this->data['backoutaftersubmit'])) {
$this->data['backingout'] = TRUE;
}
return; return;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment