Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1559)
+++ branches/2.8.x/CHANGELOG	(revision 1560)
@@ -11,8 +11,10 @@
 ! = Update/Change
 
 =========================== add small Features 2.8.2 ==========================
+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)
-! change quickSkin to alpha status, ATTANTION rename folder to quickSkin_alpha 
+! change quickSkin to alpha status, ATTENTION rename folder to quickSkin_alpha 
 02 Jan-2012 Build 1558 Dietmar Woellbrink (Luisehahne)
 # remove backslash in $_CONFIG['extensions_dir']
 ! update editor.css for allcssand round  (Tks to Ruebenwurzel)
Index: branches/2.8.x/wb/admin/start/index.php
===================================================================
--- branches/2.8.x/wb/admin/start/index.php	(revision 1559)
+++ branches/2.8.x/wb/admin/start/index.php	(revision 1560)
@@ -19,6 +19,7 @@
 require_once(WB_PATH.'/framework/class.admin.php');
 $admin = new admin('Start','start');
 // ---------------------------------------
+
 if(defined('FINALIZE_SETUP')) {
 	require_once(WB_PATH.'/framework/functions.php');
 	$dirs = array( 'modules'   => WB_PATH.'/modules/',
@@ -48,9 +49,25 @@
 		}
 	}
 	$sql = 'DELETE FROM `'.TABLE_PREFIX.'settings` WHERE `name`=\'FINALIZE_SETUP\'';
-	$database->query($sql);
+	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;
+		}
+	}
+}
+
 // Setup template object, parse vars to it, then parse it
 $ThemePath = realpath(WB_PATH.$admin->correct_theme_source('start.htt'));
 // Create new template object
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1559)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1560)
@@ -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', '1559');
+if(!defined('REVISION')) define('REVISION', '1560');
 if(!defined('SP')) define('SP', 'SP2');
