From: Roland Haeder Date: Tue, 11 May 2010 09:19:49 +0000 (+0000) Subject: Missing form elements handled X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1ed8cb7ce3d20a378bc4a345fc8854cb2b91c4b4;p=ctracker.git Missing form elements handled --- diff --git a/libs/language/de.php b/libs/language/de.php index 7b2057d..b409ae2 100644 --- a/libs/language/de.php +++ b/libs/language/de.php @@ -26,6 +26,8 @@ $GLOBALS['ctracker_localized']['ctracker_page_header'] = 'Verdächtiger/Bösartiger Traffic Von Ihrer IP-Nummer erkannt'; $GLOBALS['ctracker_localized']['user_add_ticket_subject'] = 'Ihr ausgefülltes Support-Ticket'; $GLOBALS['ctracker_localized']['webmaster_add_ticket_subject'] = 'Ausgefülltes Support-Ticket erhalten'; +$GLOBALS['ctracker_localized']['add_ticket_name_missing'] = 'Sie haben keinen Namen eingegeben.'; +$GLOBALS['ctracker_localized']['add_ticket_email_missing'] = 'Sie haben keine Email-Adresse eingegeben.'; // [EOF] ?> diff --git a/libs/language/en.php b/libs/language/en.php index b0dfa20..7ef63db 100644 --- a/libs/language/en.php +++ b/libs/language/en.php @@ -26,6 +26,8 @@ $GLOBALS['ctracker_localized']['ctracker_page_header'] = 'Suspicious/Malicious Traffic Detected From Your IP'; $GLOBALS['ctracker_localized']['user_add_ticket_subject'] = 'Your filled-out support ticket'; $GLOBALS['ctracker_localized']['webmaster_add_ticket_subject'] = 'Filled-out support ticket received'; +$GLOBALS['ctracker_localized']['add_ticket_name_missing'] = 'You have entered no name.'; +$GLOBALS['ctracker_localized']['add_ticket_email_missing'] = 'You have entered no email address.'; // [EOF] ?> diff --git a/libs/lib_detector.php b/libs/lib_detector.php index 187a28a..c9ea38d 100644 --- a/libs/lib_detector.php +++ b/libs/lib_detector.php @@ -277,7 +277,7 @@ function crackerTrackerAlertCurrentUser () { // Load "Thank you" template crackerTrackerLoadTemplate('add_ticket_thanks'); } - } elseif (isset($_POST['ctracker_add_ticket'])) { + } elseif ((isset($_POST['ctracker_add_ticket'])) && (!empty($_POST['name'])) && (!empty($_POST['email']))) { // Add the ticket addCrackerTrackerTicket($_POST); diff --git a/libs/templates/add_ticket.tpl.php b/libs/templates/add_ticket.tpl.php index 235f3ba..f70b6fa 100644 --- a/libs/templates/add_ticket.tpl.php +++ b/libs/templates/add_ticket.tpl.php @@ -25,6 +25,12 @@ // Load header crackerTrackerLoadTemplate('page_header'); +// Do we have an incomplete form? +if (isset($_POST['ctracker_add_ticket'])) { + // Output messages + crackerTrackerLoadLocalizedTemplate('add_ticket_missing'); +} // END - if + // Load form crackerTrackerLoadLocalizedTemplate('add_ticket_form'); diff --git a/libs/templates/de/add_ticket_missing.tpl.php b/libs/templates/de/add_ticket_missing.tpl.php new file mode 100644 index 0000000..990011b --- /dev/null +++ b/libs/templates/de/add_ticket_missing.tpl.php @@ -0,0 +1,24 @@ + +
+ Es fehlen noch Formularfelder! +
+ +
+'; + crackerTrackerOutputLocalized('add_ticket_name_missing'); + print '
'; +} // END - if + +// Field 'name not filled out? +if (empty($_POST['name'])) { + // Output message + print '
'; + crackerTrackerOutputLocalized('add_ticket_email_missing'); + print '
'; +} // END - if +?> + diff --git a/libs/templates/en/add_ticket_missing.tpl.php b/libs/templates/en/add_ticket_missing.tpl.php new file mode 100644 index 0000000..6dd0b43 --- /dev/null +++ b/libs/templates/en/add_ticket_missing.tpl.php @@ -0,0 +1,24 @@ + +
+ Some form elements are missing! +
+ +
+'; + crackerTrackerOutputLocalized('add_ticket_name_missing'); + print '
';
+} // END - if
+
+// Field 'name not filled out?
+if (empty($_POST['name'])) {
+	// Output message
+	print '
'; + crackerTrackerOutputLocalized('add_ticket_email_missing'); + print '
';
+} // END - if
+?>
+