diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f9cb269..efec8bf 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,8 +6,14 @@ MODULE VERSION HISTORY ------------------------------------------------------------------------------------------------------------------------ + *** 1.3.31 (Martin Hecht: 11-Apr-2019) *** + introduce MPFORM_REQUIRED_ATTRIBUTE to control if and how required attributes are delivered + introduce private_function_for_field for fine grained input evaluation + correction to the captcha patch from 2012 + suppress other forms on the same page when evaluating a submitted one + *** 1.3.30 (Martin Hecht: 14-Mar-2019) *** - secuirty fix for 1.3.29: prevent from injections via url get parameter + security fix for 1.3.29: prevent from injections via url get parameter *** 1.3.29 (Martin Hecht: 07-Mar-2019) *** allow to pre-fill fields via url get parameters diff --git a/add.php b/add.php index fc1be86..296747e 100644 --- a/add.php +++ b/add.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/add_field.php b/add_field.php index 75dc063..112a75c 100644 --- a/add_field.php +++ b/add_field.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/ajax/ajax.php b/ajax/ajax.php index f525769..d4d4f8b 100644 --- a/ajax/ajax.php +++ b/ajax/ajax.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/ajax/ajax_dragdrop.php b/ajax/ajax_dragdrop.php index d025d17..dc0118e 100644 --- a/ajax/ajax_dragdrop.php +++ b/ajax/ajax_dragdrop.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/ajax/index.php b/ajax/index.php index 1f1408f..3efeb52 100644 --- a/ajax/index.php +++ b/ajax/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/ajax/pry_submission.php b/ajax/pry_submission.php index ae40793..beaa820 100644 --- a/ajax/pry_submission.php +++ b/ajax/pry_submission.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/constants.php b/constants.php index 43f27a1..38d8cf1 100644 --- a/constants.php +++ b/constants.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform @@ -163,6 +163,10 @@ function draw_asp_honeypots($iSectionID) { . ' value="{SUBMIT_TEXT}" />'); } +if(!defined('MPFORM_REQUIRED_ATTRIBUTE')){ + define('MPFORM_REQUIRED_ATTRIBUTE', + ' required="required"'); +} // MPForm uses section anchors, but if they are disabled in the WB framework, // it adds its own anchor. If you even want to suppress this, uncomment the following diff --git a/copy_field.php b/copy_field.php index 2c8dae7..720f85d 100644 --- a/copy_field.php +++ b/copy_field.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/delete.php b/delete.php index 04c0223..ba99957 100644 --- a/delete.php +++ b/delete.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/delete_field.php b/delete_field.php index 8ccb4a0..47bcc3e 100644 --- a/delete_field.php +++ b/delete_field.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/delete_submission.php b/delete_submission.php index ccee0ab..a032240 100644 --- a/delete_submission.php +++ b/delete_submission.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/docs/DE/index.php b/docs/DE/index.php index 3a50a70..9a17489 100644 --- a/docs/DE/index.php +++ b/docs/DE/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/docs/DE/mpform/index.php b/docs/DE/mpform/index.php index 3a50a70..9a17489 100644 --- a/docs/DE/mpform/index.php +++ b/docs/DE/mpform/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/docs/DE/mpform/private-funktionen.html b/docs/DE/mpform/private-funktionen.html index 2f0ff5a..b4fd206 100644 --- a/docs/DE/mpform/private-funktionen.html +++ b/docs/DE/mpform/private-funktionen.html @@ -92,12 +92,15 @@

MPForm-Dokumentation: Private Funktionen

function private_function_before_new_form($section_id)
Wird aufgerufen, bevor ein Formular zusammengebaut wird. Hier kann man z.B. Feldinhalte je nach zuvor besuchter Seite vorbelegen.
+
function private_function_for_field($field_id, $post_field)
+
Wird aufgerufen, wenn ein Feld ausgewertet wird. Gibt die Funktion einen Leerstring zurück, + wird dies als fehlerfrei gewertet, während ein nicht-leerer String eine Fehlermeldung für + das aktuelle Feld bedeutet.
function private_function_before_email($section_id, &$html_data_user, &$html_data_site)
Wird aufgerufen, nachdem ein Formular erfolgreich ausgefüllt wurde, aber bevor es verschickt und gespeichert wird. Hier könnte man also z.B. Benachrichtigungstexte anpassen. Dabei gibt es den Benachrichtigungstext an den Sitebetreiber und denjenigen an den Benutzer.
-
private_function_after_email($section_id, &$html_data_site, &$mpform_fields) -
+
private_function_after_email($section_id, &$html_data_site, &$mpform_fields)
Wird aufgerufen, nachdem ein Formular erfolgreich ausgefüllt und verschickt wurde, aber bevor es in der Datenbank gespeichert wird. Eventuell soll der Inhalt in der Datenbank in einem anderen Format abgelegt werden, so dass es leichter zu verarbeiten ist, aber in der Benachrichtigungsmail @@ -115,7 +118,8 @@

MPForm-Dokumentation: Private Funktionen

private_function_before_new_form noch nicht. Bei allen anderen: FALSE dient zum Abbrechen des regulären Programmflusses, bei TRUE geht die Ausführung weiter.

Auf der nächsten Seite gibt es ein Beispiel aus der Praxis: die Programmierung einer - Formularschleife.

+ Formularschleife.

+ diff --git a/docs/DE/mpform/referenz-der-optionen/index.php b/docs/DE/mpform/referenz-der-optionen/index.php index 3a50a70..9a17489 100644 --- a/docs/DE/mpform/referenz-der-optionen/index.php +++ b/docs/DE/mpform/referenz-der-optionen/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/docs/DE/mpform/standardformular.xml b/docs/DE/mpform/standardformular.xml index 8627fb6..e67e18e 100644 --- a/docs/DE/mpform/standardformular.xml +++ b/docs/DE/mpform/standardformular.xml @@ -2,7 +2,7 @@ mpform - 1.3.30 + 1.3.31 mod_mpform_fields diff --git a/docs/EN/index.php b/docs/EN/index.php index 3a50a70..9a17489 100644 --- a/docs/EN/index.php +++ b/docs/EN/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/docs/EN/mpform/index.php b/docs/EN/mpform/index.php index 3a50a70..9a17489 100644 --- a/docs/EN/mpform/index.php +++ b/docs/EN/mpform/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/docs/EN/mpform/private-functions.html b/docs/EN/mpform/private-functions.html index 8de9d83..ed8acb1 100644 --- a/docs/EN/mpform/private-functions.html +++ b/docs/EN/mpform/private-functions.html @@ -85,13 +85,15 @@

MPForm Documentation: Private Functions

function private_function_before_new_form($section_id)
Will be called before a form will be assembled. Here you can, for instance, set the current date in a field.
+
function private_function_for_field($field_id, $post_field)
+
Is called for each field being evaluated. If the function returns an empty string, this is + treated as success, whereas a non-emptry string means an error message for the current field.
function private_function_before_email($section_id, &$html_data_user, &$html_data_site)
Will be called after a form has been submitted successfully, but before it will be saved or sent by email. Here you can, change the message text.
There are two versions, one for the site owner and one for the user who has submitted the form.
-
private_function_after_email($section_id, &$html_data_site, &$mpform_fields) -
+
private_function_after_email($section_id, &$html_data_site, &$mpform_fields)
Will be called after a form has been submitted and email has been sent successfully, but before data is saved to the database. If you need to postprocess the submitted values for later use and you want to keep the original format in the email, this is the place to do this transformation.
diff --git a/docs/EN/mpform/settings-of-mpform/index.php b/docs/EN/mpform/settings-of-mpform/index.php index 3a50a70..9a17489 100644 --- a/docs/EN/mpform/settings-of-mpform/index.php +++ b/docs/EN/mpform/settings-of-mpform/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/docs/EN/mpform/standardform.xml b/docs/EN/mpform/standardform.xml index b38bcfb..f78ab74 100644 --- a/docs/EN/mpform/standardform.xml +++ b/docs/EN/mpform/standardform.xml @@ -2,7 +2,7 @@ mpform - 1.3.30 + 1.3.31 mod_mpform_fields diff --git a/docs/images/index.php b/docs/images/index.php index 3a50a70..9a17489 100644 --- a/docs/images/index.php +++ b/docs/images/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/docs/index.php b/docs/index.php index 619318c..295cb82 100644 --- a/docs/index.php +++ b/docs/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/docs/style/index.php b/docs/style/index.php index 3a50a70..9a17489 100644 --- a/docs/style/index.php +++ b/docs/style/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/evalform.php b/evalform.php index b91729b..de33504 100644 --- a/evalform.php +++ b/evalform.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform @@ -469,11 +469,10 @@ function eval_form($section_id) { // Captcha if($use_captcha AND (!(defined('MPFORM_SKIP_CAPTCHA')&&(MPFORM_SKIP_CAPTCHA))) ) { if(isset($_POST['captcha']) AND $_POST['captcha'] != ''){ - // Check for a mismatch patch from http://www.websitebaker2.org/forum/index.php/topic,23986.msg167490.html#msg167490 - if((!isset($_SESSION['captcha'.$section_id]) - OR $_POST['captcha'] != $_SESSION['captcha'.$section_id]) - && (!isset($_SESSION['captcha']) - OR $_POST['captcha'] != $_SESSION['captcha'])) { + if((isset($_SESSION['captcha'.$section_id]) + AND ($_POST['captcha'] != $_SESSION['captcha'.$section_id])) + OR (!isset($_SESSION['captcha'.$section_id]) + AND ($_POST['captcha'] != $_SESSION['captcha']))) { $err_txt['captcha'.$section_id] = $LANG['frontend']['INCORRECT_CAPTCHA']; $fer[] = 'captcha'.$section_id; @@ -504,6 +503,7 @@ function eval_form($section_id) { // Loop through fields and add to message body $field_id = $field['field_id']; $curr_field = ''; + $post_field = ''; if($field['type'] != '') { if ((!empty($_POST['field'.$field_id])) or ($admin->get_post('field'.$field_id) == "0")) { // added Apr 2009 @@ -947,6 +947,18 @@ function eval_form($section_id) { } } $mpform_fields["$field_id"] = $curr_field; + // execute private function in private.php, if available + if (function_exists('private_function_for_field')) { + $field_errmsg + = private_function_for_field( + $field_id, + $post_field + ); + if(!empty($field_errmsg)){ + $fer[]=$field_id; + $err_txt[$field_id] = $field_errmsg; + } + } } // end of field loop } @@ -969,7 +981,7 @@ function eval_form($section_id) { } $mpform_fields = $tmp_mpform_fields; // Check if the user forgot to enter values into all the required fields - if($fer != array()) { + if(!empty($fer)) { // paint form again: include_once(WB_PATH .'/modules/mpform/paintform.php'); paint_form($section_id, $fer, $err_txt, false); diff --git a/export.php b/export.php index c472006..ce5bdf6 100644 --- a/export.php +++ b/export.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/export_submissions.php b/export_submissions.php index 3b23337..662e9d4 100644 --- a/export_submissions.php +++ b/export_submissions.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/functions.php b/functions.php index 76d44c7..d6bb586 100644 --- a/functions.php +++ b/functions.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/help.php b/help.php index 843ce93..5f8e9d9 100644 --- a/help.php +++ b/help.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/htt/index.php b/htt/index.php index 01ac3e4..20f816e 100644 --- a/htt/index.php +++ b/htt/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/images/index.php b/images/index.php index 01ac3e4..20f816e 100644 --- a/images/index.php +++ b/images/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/import.php b/import.php index 5d9ba0e..fd46c88 100644 --- a/import.php +++ b/import.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/index.php b/index.php index 3a50a70..9a17489 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/info.php b/info.php index 24dbab9..438b8e8 100644 --- a/info.php +++ b/info.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform @@ -20,7 +20,7 @@ $module_directory = 'mpform'; $module_name = 'mpForm'; $module_function = 'page'; -$module_version = '1.3.30'; +$module_version = '1.3.31'; $module_platform = '2.8.x'; $module_status = 'stable'; $module_author = 'Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others'; diff --git a/install.php b/install.php index 51fd9f2..0a68967 100644 --- a/install.php +++ b/install.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/jscalendar.php b/jscalendar.php index b51702a..eefa188 100644 --- a/jscalendar.php +++ b/jscalendar.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/languages/DE.php b/languages/DE.php index cae87ae..b012fc7 100644 --- a/languages/DE.php +++ b/languages/DE.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/languages/EN.php b/languages/EN.php index ffa1f7a..067b3fb 100644 --- a/languages/EN.php +++ b/languages/EN.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/languages/FR.php b/languages/FR.php index 524f9be..ae76e01 100644 --- a/languages/FR.php +++ b/languages/FR.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/languages/IT.php b/languages/IT.php index 897d603..be3e702 100644 --- a/languages/IT.php +++ b/languages/IT.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/languages/NL.php b/languages/NL.php index 039387e..7eb7cb0 100644 --- a/languages/NL.php +++ b/languages/NL.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/languages/NO.php b/languages/NO.php index 7768873..40b6963 100644 --- a/languages/NO.php +++ b/languages/NO.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/languages/index.php b/languages/index.php index 01ac3e4..20f816e 100644 --- a/languages/index.php +++ b/languages/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/modify.php b/modify.php index 9b84104..6727e8e 100644 --- a/modify.php +++ b/modify.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/modify_adv_settings.php b/modify_adv_settings.php index b81a5b6..9df7516 100644 --- a/modify_adv_settings.php +++ b/modify_adv_settings.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/modify_field.php b/modify_field.php index efd8213..c7e004a 100644 --- a/modify_field.php +++ b/modify_field.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/modify_settings.php b/modify_settings.php index 265a98e..cf6ea92 100644 --- a/modify_settings.php +++ b/modify_settings.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/move_down.php b/move_down.php index d5a6587..53729e2 100644 --- a/move_down.php +++ b/move_down.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/move_up.php b/move_up.php index 970713b..7491418 100644 --- a/move_up.php +++ b/move_up.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/paintform.php b/paintform.php index 0761a7f..062b566 100644 --- a/paintform.php +++ b/paintform.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform @@ -362,6 +362,10 @@ function paint_form( $iSID /*section_id*/, $aMissing = array(), . ' type="hidden"' . ' name="submission_id"' . ' value="'. $sValueAttr .'" />'.PHP_EOL; + echo ''.PHP_EOL; if(ENABLED_ASP) { echo draw_asp_honeypots($iSID); @@ -466,7 +470,7 @@ function paint_form( $iSID /*section_id*/, $aMissing = array(), = '*'; $classes .= ' '.MPFORM_CLASS_PREFIX.'required'; - $required = ' required="required"'; + $required = MPFORM_REQUIRED_ATTRIBUTE; } // mark read only fields: diff --git a/pear/FixPHP5PEARWarnings.php b/pear/FixPHP5PEARWarnings.php index 2d5958b..5306837 100644 --- a/pear/FixPHP5PEARWarnings.php +++ b/pear/FixPHP5PEARWarnings.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/pear/index.php b/pear/index.php index 96ec95e..beaffc8 100644 --- a/pear/index.php +++ b/pear/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/pear/languages/DE.php b/pear/languages/DE.php index 03bd9ea..77d73b1 100644 --- a/pear/languages/DE.php +++ b/pear/languages/DE.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/pear/languages/EN.php b/pear/languages/EN.php index 75d48cc..4fb301d 100644 --- a/pear/languages/EN.php +++ b/pear/languages/EN.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/pear/languages/FR.php b/pear/languages/FR.php index 7da22c6..bb70ef4 100644 --- a/pear/languages/FR.php +++ b/pear/languages/FR.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/pear/languages/IT.php b/pear/languages/IT.php index 9bc1e3b..a2fb1f1 100644 --- a/pear/languages/IT.php +++ b/pear/languages/IT.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/pear/languages/index.php b/pear/languages/index.php index 6c13b0e..6830871 100644 --- a/pear/languages/index.php +++ b/pear/languages/index.php @@ -7,7 +7,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/private.default.php b/private.default.php index 075ee44..82f4bc7 100644 --- a/private.default.php +++ b/private.default.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform @@ -44,6 +44,24 @@ function private_function_before_new_form($section_id) { return true; } + +function private_function_for_field( + $field_id, + $post_field + ) { +/* + // example how to use: for a specific section verify that the value is in the proper range + if ($field_id == 3269) { + if((intval($post_field)<0) or (intval($post_field)>10)) + return "pleaseenter a value between 0 and 10"; + } + // ... checks for other fields - this function is called separately for each field +*/ + return ""; +} + + + function private_function_before_email( $section_id, &$html_data_user, @@ -143,3 +161,4 @@ function private_function_on_success($section_id) { */ return true; } + diff --git a/save_adv_settings.php b/save_adv_settings.php index c5e1df9..9311e3e 100644 --- a/save_adv_settings.php +++ b/save_adv_settings.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/save_field.php b/save_field.php index 48c7ff6..ce746cb 100644 --- a/save_field.php +++ b/save_field.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/save_settings.php b/save_settings.php index c1366dd..49cacf8 100644 --- a/save_settings.php +++ b/save_settings.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/uninstall.php b/uninstall.php index c2dbd72..8aab073 100644 --- a/uninstall.php +++ b/uninstall.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/upgrade.php b/upgrade.php index 829881d..ff81ca5 100644 --- a/upgrade.php +++ b/upgrade.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform diff --git a/view.php b/view.php index 2674df5..c300162 100644 --- a/view.php +++ b/view.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform @@ -31,6 +31,9 @@ // include the module language file depending on the backend language of the current user if (!include(get_module_language_file($mod_dir))) return; +if(isset($_POST['section_id']) && intval($_POST['section_id']) != $section_id) return; + + // check if frontend.css file needs to be included into the of view.php if((!function_exists('register_frontend_modfiles') && !defined('MOD_FRONTEND_CSS_REGISTERED')) @@ -63,7 +66,7 @@ } // Work-out if the form has been submitted or not -if ($_POST != array()) { +if ($_POST != array()){ // some form has been submitted: include_once(WB_PATH .'/modules/mpform/evalform.php'); eval_form($section_id); diff --git a/view_submission.php b/view_submission.php index 468e896..170f1d7 100644 --- a/view_submission.php +++ b/view_submission.php @@ -6,7 +6,7 @@ * * @category page * @module mpform - * @version 1.3.30 + * @version 1.3.31 * @authors Frank Heyne, NorHei(heimsath.org), Christian M. Stefan (Stefek), Martin Hecht (mrbaseman) and others * @copyright (c) 2009 - 2019, Website Baker Org. e.V. * @url https://github.com/WebsiteBaker-modules/mpform