Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1560)
+++ branches/2.8.x/CHANGELOG	(revision 1561)
@@ -11,6 +11,8 @@
 ! = Update/Change
 
 =========================== add small Features 2.8.2 ==========================
+05 Jan-2012 Build 1561 Dietmar Woellbrink (Luisehahne)
+# secureForm Fix for hosting with load balancing
 04 Jan-2012 Build 1560 Dietmar Woellbrink (Luisehahne)
 ! upgrade script start automatically after uploading a new version and login to the backend
 04 Jan-2012 Build 1559 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/admin/start/index.php
===================================================================
--- branches/2.8.x/wb/admin/start/index.php	(revision 1560)
+++ branches/2.8.x/wb/admin/start/index.php	(revision 1561)
@@ -52,18 +52,22 @@
 	if($database->query($sql)) { }
 }
 // ---------------------------------------
+
 // check if it is neccessary to start the uograde-script
-$sql = 'SELECT `value` FROM `'.TABLE_PREFIX.'settings` WHERE `name`=\'wb_revision\'';
-if($wb_revision=$database->get_one($sql)) {
-	if (version_compare($wb_revision, REVISION ) < 0) {
-		if(!headers_sent()) {
-			header('Location: '.WB_URL.'/upgrade-script.php');
-		    exit;
-		} else {
-		    echo "<p style=\"text-align:center;\"> The <strong>upgrade script</strong> could not be start automatically.\n" .
-		         "Please click <a style=\"font-weight:bold;\" " .
-		         "href=\"".WB_URL."/upgrade-script.php\">on this link</a> to start the script!</p>\n";
-		    exit;
+if(file_exists(WB_PATH.'/upgrade-script.php')) {
+	// check if it is neccessary to start the uograde-script
+	$sql = 'SELECT `value` FROM `'.TABLE_PREFIX.'settings` WHERE `name`=\'wb_revision\'';
+	if($wb_revision=$database->get_one($sql)) {
+		if (version_compare($wb_revision, REVISION ) < 0) {
+			if(!headers_sent()) {
+				header('Location: '.WB_URL.'/upgrade-script.php');
+			    exit;
+			} else {
+			    echo "<p style=\"text-align:center;\"> The <strong>upgrade script</strong> could not be start automatically.\n" .
+			         "Please click <a style=\"font-weight:bold;\" " .
+			         "href=\"".WB_URL."/upgrade-script.php\">on this link</a> to start the script!</p>\n";
+			    exit;
+			}
 		}
 	}
 }
@@ -114,7 +118,7 @@
 }
 
 $msg = (file_exists(WB_PATH.'/install/')) ?  $MESSAGE['START']['INSTALL_DIR_EXISTS'] : '';
-$msg .= (file_exists(WB_PATH.'/upgrade-script.php')) ? '<br />'.$MESSAGE['START_UPGRADE_SCRIPT_EXISTS'] : '';
+$msg .= (file_exists(WB_PATH.'/upgrade-script.php') ? '<br />'.$MESSAGE['START_UPGRADE_SCRIPT_EXISTS'] : '');
 
 // Check if installation directory still exists
 if(file_exists(WB_PATH.'/install/') || file_exists(WB_PATH.'/upgrade-script.php') ) {
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1560)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1561)
@@ -52,5 +52,5 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.2');
-if(!defined('REVISION')) define('REVISION', '1560');
+if(!defined('REVISION')) define('REVISION', '1561');
 if(!defined('SP')) define('SP', 'SP2');
Index: branches/2.8.x/wb/framework/SecureForm.mtab.php
===================================================================
--- branches/2.8.x/wb/framework/SecureForm.mtab.php	(revision 1560)
+++ branches/2.8.x/wb/framework/SecureForm.mtab.php	(revision 1561)
@@ -173,10 +173,19 @@
 
 	private function _generate_serverdata(){
 
-	 	$serverdata  = ( isset($_SERVER['SERVER_SIGNATURE']) ) ? $_SERVER['SERVER_SIGNATURE'] : '2';
+		$usedOctets = ( defined('FINGERPRINT_WITH_IP_OCTETS') ) ? (intval(FINGERPRINT_WITH_IP_OCTETS) % 5) : 2;
+		$serverdata  = '';
+	 	$serverdata .= ( isset($_SERVER['SERVER_SIGNATURE']) ) ? $_SERVER['SERVER_SIGNATURE'] : '2';
 		$serverdata .= ( isset($_SERVER['SERVER_SOFTWARE']) ) ? $_SERVER['SERVER_SOFTWARE'] : '3';
 		$serverdata .= ( isset($_SERVER['SERVER_NAME']) ) ? $_SERVER['SERVER_NAME'] : '5';
-		$serverdata .= ( isset($_SERVER['SERVER_ADDR']) ) ? $_SERVER['SERVER_ADDR'] : '7';
+		$serverIp = ( isset($_SERVER['SERVER_ADDR']) ) ? $_SERVER['SERVER_ADDR'] : '';
+		if(($serverIp != '') && ($usedOctets > 0)){
+			$ip = explode('.', $serverIp);
+			while(sizeof($ip) > $usedOctets) { array_pop($ip); }
+			$serverdata .= implode('.', $ip);
+		}else {
+			$serverdata .= '7';
+		}
 		$serverdata .= ( isset($_SERVER['SERVER_PORT']) ) ? $_SERVER['SERVER_PORT'] : '11';
 		$serverdata .= ( isset($_SERVER['SERVER_ADMIN']) ) ? $_SERVER['SERVER_ADMIN'] : '13';
 		$serverdata .= PHP_VERSION;
Index: branches/2.8.x/wb/framework/SecureForm.php
===================================================================
--- branches/2.8.x/wb/framework/SecureForm.php	(revision 1560)
+++ branches/2.8.x/wb/framework/SecureForm.php	(revision 1561)
@@ -83,11 +83,20 @@
 
 	private function _generate_fingerprint()
 	{
+		$usedOctets = ( defined('FINGERPRINT_WITH_IP_OCTETS') ) ? (intval(FINGERPRINT_WITH_IP_OCTETS) % 5) : 2;
 		// server depending values
-		$fingerprint  = ( isset($_SERVER['SERVER_SIGNATURE']) ) ? $_SERVER['SERVER_SIGNATURE'] : '2';
+		$fingerprint  = '';
+		$fingerprint .= ( isset($_SERVER['SERVER_SIGNATURE']) ) ? $_SERVER['SERVER_SIGNATURE'] : '2';
 		$fingerprint .= ( isset($_SERVER['SERVER_SOFTWARE']) ) ? $_SERVER['SERVER_SOFTWARE'] : '3';
 		$fingerprint .= ( isset($_SERVER['SERVER_NAME']) ) ? $_SERVER['SERVER_NAME'] : '5';
-		$fingerprint .= ( isset($_SERVER['SERVER_ADDR']) ) ? $_SERVER['SERVER_ADDR'] : '7';
+		$serverIp = ( isset($_SERVER['SERVER_ADDR']) ) ? $_SERVER['SERVER_ADDR'] : '';
+		if(($serverIp != '') && ($usedOctets > 0)){
+			$ip = explode('.', $serverIp);
+			while(sizeof($ip) > $usedOctets) { array_pop($ip); }
+			$fingerprint .= implode('.', $ip);
+		}else {
+			$fingerprint .= '7';
+		}
 		$fingerprint .= ( isset($_SERVER['SERVER_PORT']) ) ? $_SERVER['SERVER_PORT'] : '11';
 		$fingerprint .= ( isset($_SERVER['SERVER_ADMIN']) ) ? $_SERVER['SERVER_ADMIN'] : '13';
 		$fingerprint .= __FILE__;
@@ -94,7 +103,7 @@
 		$fingerprint .= PHP_VERSION;
 		// client depending values
 		$fingerprint .= ( isset($_SERVER['HTTP_USER_AGENT']) ) ? $_SERVER['HTTP_USER_AGENT'] : '19';
-		$usedOctets = ( defined('FINGERPRINT_WITH_IP_OCTETS') ) ? (intval(FINGERPRINT_WITH_IP_OCTETS) % 5) : 2;
+		// $usedOctets = ( defined('FINGERPRINT_WITH_IP_OCTETS') ) ? (intval(FINGERPRINT_WITH_IP_OCTETS) % 5) : 2;
 		$clientIp = ( isset($_SERVER['REMOTE_ADDR'])  ? $_SERVER['REMOTE_ADDR'] : '' );
 		if(($clientIp != '') && ($usedOctets > 0)){
 			$ip = explode('.', $clientIp);
