]> git.mxchange.org Git - ctracker.git/commitdiff
Missing form elements handled
authorRoland Haeder <roland@mxchange.org>
Tue, 11 May 2010 09:19:49 +0000 (09:19 +0000)
committerRoland Haeder <roland@mxchange.org>
Tue, 11 May 2010 09:19:49 +0000 (09:19 +0000)
libs/language/de.php
libs/language/en.php
libs/lib_detector.php
libs/templates/add_ticket.tpl.php
libs/templates/de/add_ticket_missing.tpl.php [new file with mode: 0644]
libs/templates/en/add_ticket_missing.tpl.php [new file with mode: 0644]

index 7b2057d495632bea40c2283d73da0f7b61dc5a99..b409ae29c9ceb0f4f5660b224f5f77af2cf1278d 100644 (file)
@@ -26,6 +26,8 @@
 $GLOBALS['ctracker_localized']['ctracker_page_header'] = 'Verd&auml;chtiger/B&ouml;sartiger Traffic Von Ihrer IP-Nummer erkannt';
 $GLOBALS['ctracker_localized']['user_add_ticket_subject'] = 'Ihr ausgef&uuml;lltes Support-Ticket';
 $GLOBALS['ctracker_localized']['webmaster_add_ticket_subject'] = 'Ausgef&uuml;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]
 ?>
index b0dfa20212f4e923b21ff251e71ed11bc7fb6553..7ef63db44fa45e548e9609560c8b172384be9336 100644 (file)
@@ -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]
 ?>
index 187a28a97b4e98b0baa50701b3d11888cee46a22..c9ea38d027f9cf18741a341e9d65a2c4b89b436e 100644 (file)
@@ -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);
 
index 235f3bae6639dc2595735932c595a4d9c1fcee2b..f70b6fa9d707e8722b172092fc43fb946ae157da 100644 (file)
 // 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 (file)
index 0000000..990011b
--- /dev/null
@@ -0,0 +1,24 @@
+<?php /* Required for my editor... :-( */ ?>
+<div class="ctracker_error_header">
+       Es fehlen noch Formularfelder!
+</div>
+
+<div>
+<?php
+// Field 'name not filled out?
+if (empty($_POST['name'])) {
+       // Output message
+       print '<div class="ctracker_form_missing">';
+       crackerTrackerOutputLocalized('add_ticket_name_missing');
+       print '</div>';
+} // END - if
+
+// Field 'name not filled out?
+if (empty($_POST['name'])) {
+       // Output message
+       print '<div class="ctracker_form_missing">';
+       crackerTrackerOutputLocalized('add_ticket_email_missing');
+       print '</div>';
+} // END - if
+?>
+</div>
diff --git a/libs/templates/en/add_ticket_missing.tpl.php b/libs/templates/en/add_ticket_missing.tpl.php
new file mode 100644 (file)
index 0000000..6dd0b43
--- /dev/null
@@ -0,0 +1,24 @@
+<?php /* Required for my editor... :-( */ ?>
+<div class="ctracker_error_header">
+       Some form elements are missing!
+</div>
+
+<div>
+<?php
+// Field 'name not filled out?
+if (empty($_POST['name'])) {
+       // Output message
+       print '<div class="ctracker_form_missing">';
+       crackerTrackerOutputLocalized('add_ticket_name_missing');
+       print '<pre>';
+} // END - if
+
+// Field 'name not filled out?
+if (empty($_POST['name'])) {
+       // Output message
+       print '<div class="ctracker_form_missing">';
+       crackerTrackerOutputLocalized('add_ticket_email_missing');
+       print '<pre>';
+} // END - if
+?>
+</div>