Don't continue if the cookie has been set + ticket has created. 'unknown' was found...
authorRoland Haeder <roland@mxchange.org>
Sat, 1 Nov 2014 10:30:26 +0000 (11:30 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 1 Nov 2014 10:30:26 +0000 (11:30 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
.gitattributes [deleted file]
libs/lib_detector.php
libs/lib_general.php

diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644 (file)
index e8b6c64..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-* text=auto !eol
-config/.htaccess -text
-config/db_config.php.dist -text
-/ctracker.php svneol=native#text/plain
-docs/COPYING -text
-docs/Incompatible.txt -text
-docs/NEWS -text
-docs/README -text
-docs/THANKS -text
-docs/TODO -text
-docs/TODOs.txt -text svneol=unset#text/plain
-install/install.sql -text
-libs/.htaccess -text
-libs/language/.htaccess -text
-libs/language/.php svneol=native#text/plain
-libs/language/de.php svneol=native#text/plain
-libs/language/en.php svneol=native#text/plain
-libs/lib_ -text svneol=unset#text/plain
-libs/lib_connect.php -text svneol=unset#text/plain
-libs/lib_detector.php -text svneol=unset#text/plain
-libs/lib_general.php -text svneol=unset#text/plain
-libs/lib_updates.php svneol=native#text/plain
-libs/mails/.htaccess -text
-libs/mails/de/.htaccess -text
-libs/mails/de/header.tpl svneol=native#text/plain
-libs/mails/de/user_add_ticket.tpl svneol=native#text/plain
-libs/mails/de/webmaster_add_ticket.tpl svneol=native#text/plain
-libs/mails/en/.htaccess -text
-libs/mails/en/header.tpl svneol=native#text/plain
-libs/mails/en/user_add_ticket.tpl svneol=native#text/plain
-libs/mails/en/webmaster_add_ticket.tpl svneol=native#text/plain
-libs/templates/.htaccess -text
-libs/templates/add_ticket.tpl.php svneol=native#text/plain
-libs/templates/add_ticket_thanks.tpl.php svneol=native#text/plain
-libs/templates/de/.htaccess -text
-libs/templates/de/add_ticket_form.tpl.php svneol=native#text/plain
-libs/templates/de/add_ticket_missing.tpl.php svneol=native#text/plain
-libs/templates/de/add_ticket_success.tpl.php svneol=native#text/plain
-libs/templates/de/body_header.tpl.php svneol=native#text/plain
-libs/templates/en/.htaccess -text
-libs/templates/en/add_ticket_form.tpl.php svneol=native#text/plain
-libs/templates/en/add_ticket_missing.tpl.php svneol=native#text/plain
-libs/templates/en/add_ticket_success.tpl.php svneol=native#text/plain
-libs/templates/en/body_header.tpl.php svneol=native#text/plain
-libs/templates/page_footer.tpl.php svneol=native#text/plain
-libs/templates/page_header.tpl.php svneol=native#text/plain
index 3511de9896a5d03023dd82d99a9ffc08765c17bb..5c5a70b50c4b4324317209ad0ec68ac7c2a0013e 100644 (file)
@@ -348,20 +348,8 @@ function crackerTrackerAlertCurrentUser () {
        if (isset($GLOBALS['ctracker_last_suspicious_entry'])) {
                // Does the user have a ticket?
                if (ifCrackerTrackerIpHasTicket()) {
-                       // Should we continue?
-                       if (isset($_POST['ctracker_continue'])) {
-                               // Set cookie
-                               sendCrackerTrackerCookie();
-
-                               // And redirect to same URL
-                               crackerTrackerRedirectSameUrl();
-                       } elseif (ifCrackerTrackerCookieIsSet()) {
-                               // Return here to normal program
-                               return;
-                       } else {
-                               // Load "Thank you" template
-                               crackerTrackerLoadTemplate('add_ticket_thanks');
-                       }
+                       // Load "Thank you" template
+                       crackerTrackerLoadTemplate('add_ticket_thanks');
                } elseif ((isset($_POST['ctracker_add_ticket'])) && (!empty($_POST['name'])) && (!empty($_POST['email']))) {
                        // Add the ticket
                        addCrackerTrackerTicket($_POST);
index 84dd1bf0f7818a73db7c5189da467e2dc74f3260..62062d7b2586bf4d094520b762cd11d0ac40ef6a 100644 (file)
@@ -87,20 +87,23 @@ function determineCrackerTrackerRealRemoteAddress () {
        // Is a proxy in use?
        if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
                // Proxy was used
-               $address = $_SERVER['HTTP_X_FORWARDED_FOR'];
+               $address = trim($_SERVER['HTTP_X_FORWARDED_FOR']);
        } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
                // Yet, another proxy
-               $address = $_SERVER['HTTP_CLIENT_IP'];
+               $address = trim($_SERVER['HTTP_CLIENT_IP']);
        } elseif (isset($_SERVER['REMOTE_ADDR'])) {
                // The regular address when no proxy was used
-               $address = getenv('REMOTE_ADDR');
+               $address = trim(getenv('REMOTE_ADDR'));
        }
 
-       // This strips out the real address from proxy output
-       if (strstr($address, ',')) {
+       if ($address == 'unknown') {
+               // Invalid IP somehow given
+               $address = '0.0.0.0';
+       elseif (strstr($address, ',')) {
+               // This strips out the real address from proxy output
                $addressArray = explode(',', $address);
                $address = $addressArray[0];
-       } // END - if
+       }
 
        // Return the result
        return $address;