Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1769)
+++ branches/2.8.x/CHANGELOG	(revision 1770)
@@ -13,6 +13,13 @@
 
 
 
+24 Sep-2012 Build 1770 Dietmar Woellbrink (Luisehahne)
+# fixed issues with database names
+  WbDatabase::getTableEngine() changed SQL statement to strikt.
+! remove empty warning box if you aren't sysadmin
+! change order errorhandling in installation save.php
+# typofix in news/upgrade.php $MESSAGE
+! Framework/frontend.functions.php change file_exists to is_readable
 23 Sep-2012 Build 1769 Dietmar Woellbrink (Luisehahne)
 # typofix in upgrade-script, fixed wrong count for language and modules folder
 23 Sep-2012 Build 1768 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/admin/start/index.php
===================================================================
--- branches/2.8.x/wb/admin/start/index.php	(revision 1769)
+++ branches/2.8.x/wb/admin/start/index.php	(revision 1770)
@@ -85,8 +85,7 @@
 // workout to upgrade the groups system_permissions
 // ---------------------------------------
 if( ($admin->get_user_id()==1) &&
-	file_exists(ADMIN_PATH.'/groups/upgradePermissions.php') &&
-	!defined('GROUPS_UPDATED') )
+	file_exists(ADMIN_PATH.'/groups/upgradePermissions.php') && !defined('GROUPS_UPDATED') )
 {
 	// check if it is neccessary to start the uograde-script
 	$sql = 'SELECT `value` FROM `'.TABLE_PREFIX.'settings` WHERE `name`=\'wb_revision\'';
@@ -235,7 +234,7 @@
 // Check if installation directory still exists
 if(file_exists(WB_PATH.'/install/') || file_exists(WB_PATH.'/upgrade-script.php') ) {
 	// Check if user is part of Adminstrators group
-	if(in_array(1, $admin->get_groups_id()))
+	if($admin->get_user_id()==1)
     {
 		$oTpl->set_var('WARNING', $msg );
 	} else {
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1769)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1770)
@@ -51,5 +51,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.3');
-if(!defined('REVISION')) define('REVISION', '1769');
+if(!defined('REVISION')) define('REVISION', '1770');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/framework/WbDatabase.php
===================================================================
--- branches/2.8.x/wb/framework/WbDatabase.php	(revision 1769)
+++ branches/2.8.x/wb/framework/WbDatabase.php	(revision 1770)
@@ -396,7 +396,7 @@
 		$retVal = false;
 		$mysqlVersion = mysql_get_server_info($this->_db_handle);
 		$engineValue = (version_compare($mysqlVersion, '5.0') < 0) ? 'Type' : 'Engine';
-		$sql = "SHOW TABLE STATUS FROM " . $this->_db_name . " LIKE '" . $table . "'";
+		$sql = 'SHOW TABLE STATUS FROM `' . $this->_db_name . '` LIKE \'' . $table . '\'';
 		if(($result = $this->query($sql, $this->_db_handle))) {
 			if(($row = $result->fetchRow(MYSQL_ASSOC))) {
 				$retVal = $row[$engineValue];
Index: branches/2.8.x/wb/framework/frontend.functions.php
===================================================================
--- branches/2.8.x/wb/framework/frontend.functions.php	(revision 1769)
+++ branches/2.8.x/wb/framework/frontend.functions.php	(revision 1770)
@@ -39,21 +39,22 @@
 	if(($resSnippets = $database->query($sql))) {
 		while($recSnippet = $resSnippets->fetchRow()) {
 			$module_dir = $recSnippet['directory'];
-			if (file_exists(WB_PATH.'/modules/'.$module_dir.'/include.php')) {
+			if (is_readable(WB_PATH.'/modules/'.$module_dir.'/include.php')) {
 				include(WB_PATH.'/modules/'.$module_dir.'/include.php');
 			// check if frontend.css file needs to be included into the <head></head> of index.php
-				if( file_exists(WB_PATH .'/modules/'.$module_dir.'/frontend.css')) {
+
+				if( is_readable(WB_PATH .'/modules/'.$module_dir.'/frontend.css')) {
 					$include_head_link_css .= '<link href="'.WB_URL.'/modules/'.$module_dir.'/frontend.css"';
 					$include_head_link_css .= ' rel="stylesheet" type="text/css" media="screen" />'."\n";
 					$include_head_file = 'frontend.css';
 				}
 			// check if frontend.js file needs to be included into the <body></body> of index.php
-				if(file_exists(WB_PATH .'/modules/'.$module_dir.'/frontend.js')) {
+				if(is_readable(WB_PATH .'/modules/'.$module_dir.'/frontend.js')) {
 					$include_head_links .= '<script src="'.WB_URL.'/modules/'.$module_dir.'/frontend.js" type="text/javascript"></script>'."\n";
 					$include_head_file = 'frontend.js';
 				}
 			// check if frontend_body.js file needs to be included into the <body></body> of index.php
-				if(file_exists(WB_PATH .'/modules/'.$module_dir.'/frontend_body.js')) {
+				if(is_readable(WB_PATH .'/modules/'.$module_dir.'/frontend_body.js')) {
 					$include_body_links .= '<script src="'.WB_URL.'/modules/'.$module_dir.'/frontend_body.js" type="text/javascript"></script>'."\n";
 					$include_body_file = 'frontend_body.js';
 				}
@@ -468,12 +469,12 @@
 			$jquery_links .= '<script src="'.WB_URL.'/include/jquery/jquery-include.js" type="text/javascript"></script>'."\n";
             /* workout to insert ui.css and theme */
             $jquery_theme =  WB_PATH.'/modules/jquery/jquery_theme.js';
-			$jquery_links .=  file_exists($jquery_theme)
+			$jquery_links .=  is_readable($jquery_theme)
                 ? '<script src="'.WB_URL.'/modules/jquery/jquery_theme.js" type="text/javascript"></script>'."\n"
                 : '<script src="'.WB_URL.'/include/jquery/jquery_theme.js" type="text/javascript"></script>'."\n";
             /* workout to insert plugins functions, set in templatedir */
             $jquery_frontend_file = TEMPLATE_DIR.'/jquery_frontend.js';
-			$jquery_links .= file_exists(str_replace( WB_URL, WB_PATH, $jquery_frontend_file))
+			$jquery_links .= is_readable(str_replace( WB_URL, WB_PATH, $jquery_frontend_file))
                 ? '<script src="'.$jquery_frontend_file.'" type="text/javascript"></script>'."\n"
                 : '';
 		}
@@ -525,7 +526,7 @@
 	    		while($row = $query_modules->fetchRow())
 	            {
 	    			// check if page module directory contains a frontend_body.js file
-	    			if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file"))
+	    			if(is_readable(WB_PATH ."/modules/" .$row['module'] ."/$base_file"))
 	                {
 	    			// create link with frontend_body.js source for the current module
 	    				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
@@ -603,7 +604,7 @@
 	    		while($row = $query_modules->fetchRow())
 	            {
 	    			// check if page module directory contains a frontend.js or frontend.css file
-	    			if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file"))
+	    			if(is_readable(WB_PATH ."/modules/" .$row['module'] ."/$base_file"))
 	                {
 	    			// create link with frontend.js or frontend.css source for the current module
 	    				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
@@ -637,25 +638,3 @@
         print $head_links;
     }
 }
-/*
-	function moveCssToHead($content) {
-		// move css definitions into head section
-		$pattern1 = '/(?:<body.*?)(<link[^>]*?\"text\/css\".*?\/>)/si';
-		$pattern2 = '/(?:<body.*?)(<style[^>]*?\"text\/css\"[^>]* ?>.*?<\/style>)/si';
-		while(preg_match($pattern1, $content, $matches)==1) {
-		// loop through all linked CSS
-			$insert = $matches[1];
-			$content = str_replace($insert, '', $content);
-			$insert = "\n".$insert."\n</head>\n<body";
-			$content = preg_replace('/<\/head>.*?<body/si', $insert, $content);
-		}
-		while(preg_match($pattern2, $content, $matches)==1) {
-		// loop through all inline CSS
-			$insert = $matches[1];
-			$content = str_replace($insert, '', $content);
-			$insert = "\n".$insert."\n</head>\n<body";
-			$content = preg_replace('/<\/head>.*?<body/si', $insert, $content);
-		}
-		return $content;
-	}
-*/
\ No newline at end of file
Index: branches/2.8.x/wb/install/save.php
===================================================================
--- branches/2.8.x/wb/install/save.php	(revision 1769)
+++ branches/2.8.x/wb/install/save.php	(revision 1770)
@@ -201,25 +201,13 @@
 	set_error('Please enter a database host name', 'database_host');
 } else {
 	$database_host = $_POST['database_host'];
-}
-// Check if user has entered a database username
-if(!isset($_POST['database_username']) OR $_POST['database_username'] == '') {
-	set_error('Please enter a database username','database_username');
-} else {
-	$database_username = $_POST['database_username'];
-}
-// Check if user has entered a database password
-if(!isset($_POST['database_password'])) {
-	set_error('Please enter a database password', 'database_password');
-} else {
-	$database_password = $_POST['database_password'];
-}
+ }
 // Check if user has entered a database name
 if(!isset($_POST['database_name']) OR $_POST['database_name'] == '') {
 	set_error('Please enter a database name', 'database_name');
 } else {
 	// make sure only allowed characters are specified
-	if(preg_match('/[^a-z0-9_-]+/i', $_POST['database_name'])) {
+	if(!preg_match('/^[a-z0-9_-]*$/i', $_POST['database_name'])) {
 		// contains invalid characters (only a-z, A-Z, 0-9 and _ allowed to avoid problems with table/field names)
 		set_error('Only characters a-z, A-Z, 0-9, - and _ allowed in database name.', 'database_name');
 	}
@@ -226,7 +214,7 @@
 	$database_name = $_POST['database_name'];
 }
 // Get table prefix
-if(preg_match('/[^a-z0-9_]+/i', $_POST['table_prefix'])) {
+if(!preg_match('/^[a-z0-9_]*$/i', $_POST['table_prefix'])) {
 	// contains invalid characters (only a-z, A-Z, 0-9 and _ allowed to avoid problems with table/field names)
 	set_error('Only characters a-z, A-Z, 0-9 and _ allowed in table_prefix.', 'table_prefix');
 } else {
@@ -233,6 +221,19 @@
 	$table_prefix = $_POST['table_prefix'];
 }
 
+// Check if user has entered a database username
+if(!isset($_POST['database_username']) OR $_POST['database_username'] == '') {
+	set_error('Please enter a database username','database_username');
+} else {
+	$database_username = $_POST['database_username'];
+}
+// Check if user has entered a database password
+if(!isset($_POST['database_password'])) {
+	set_error('Please enter a database password', 'database_password');
+} else {
+	$database_password = $_POST['database_password'];
+}
+
 // Find out if the user wants to install tables and data
 $install_tables = ((isset($_POST['install_tables']) AND $_POST['install_tables'] == 'true'));
 // End database details code
Index: branches/2.8.x/wb/modules/news/upgrade.php
===================================================================
--- branches/2.8.x/wb/modules/news/upgrade.php	(revision 1769)
+++ branches/2.8.x/wb/modules/news/upgrade.php	(revision 1770)
@@ -82,7 +82,7 @@
 					return;
 				} else {
 //					$admin->print_error($MESSAGE['RECORD_MODIFIED_FAILED']);
-					$msg[] = $$MESSAGE['RECORD_MODIFIED_FAILED'];
+					$msg[] = $MESSAGE['RECORD_MODIFIED_FAILED'];
 					return $msg;
 				}
 			}
@@ -100,7 +100,7 @@
 					return;
 				}else {
 //					$admin->print_error($MESSAGE['RECORD_MODIFIED_FAILED']);
-					$msg[] = $$MESSAGE['RECORD_MODIFIED_FAILED'];
+					$msg[] = $MESSAGE['RECORD_MODIFIED_FAILED'];
 					return $msg;
 				}
 			}
