Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1483)
+++ branches/2.8.x/CHANGELOG	(revision 1484)
@@ -11,6 +11,12 @@
 ! = Update/Change
 
 =============================== FEATURES FREEZE ================================
+------------------------------------- 2.8.3 ------------------------------------
+31 Jul-2011 Build 1484 Dietmar Woellbrink (Luisehahne)
+! move fixes 2.8.2 to 2.8.3
+! fixes will be shown in an extra readme
+! an package with the fixed files will be created
+! for all users who downloaded the 2.8.2 before 29 Jul-2011
 ------------------------------------- 2.8.2 ------------------------------------
 25 Jul-2011 Build 1480 Dietmar Woellbrink (Luisehahne)
 ! Changed version to 2.8.2
Index: branches/2.8.x/wb/config.php
===================================================================
--- branches/2.8.x/wb/config.php	(revision 1483)
+++ branches/2.8.x/wb/config.php	(nonexistent)
@@ -1 +0,0 @@
-<?php

Property changes on: branches/2.8.x/wb/config.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: branches/2.8.x/wb/upgrade-script.php
===================================================================
--- branches/2.8.x/wb/upgrade-script.php	(revision 1483)
+++ branches/2.8.x/wb/upgrade-script.php	(revision 1484)
@@ -18,10 +18,23 @@
 
 @require_once('config.php');
 
-// this function checks the basic configurations of an existing WB intallation
-function status_msg($message, $class='check', $element='span') {
+require_once(WB_PATH.'/framework/functions.php');
+require_once(WB_PATH.'/framework/class.admin.php');
+$admin = new admin('Addons', 'modules', false, false);
+
+/* display a status message on the screen **************************************
+ * @param string $message: the message to show
+ * @param string $class:   kind of message as a css-class
+ * @param string $element: witch HTML-tag use to cover the message
+ * @return void
+ */
+function status_msg($message, $class='check', $element='span')
+{
 	// returns a status message
-	echo '<'.$element .' class="' .$class .'">' .$message .'</' .$element.'>';
+	$msg  = '<'.$element.' class="'.$class.'">';
+	$msg .= '<strong>'.strtoupper(strtok($class, ' ')).'</strong><br />';
+	$msg .= $message.'</'.$element.'>';
+	echo $msg;
 }
 
 // database tables including in WB package
@@ -33,6 +46,24 @@
     'mod_output_filter','mod_wrapper','mod_wysiwyg'
 );
 
+$OK            = ' <span class="ok">OK</span> ';
+$FAIL          = ' <span class="error">FAILED</span> ';
+$DEFAULT_THEME = 'wb_theme';
+
+$files2remove = array(
+
+			'[ADMIN]/preferences/details.php',
+			'[ADMIN]/preferences/email.php',
+			'[ADMIN]/preferences/password.php',
+/*
+			'[TEMPLATE]/allcss/',
+			'[TEMPLATE]/blank/',
+			'[TEMPLATE]/round/',
+			'[TEMPLATE]/simple/',
+*/
+		 );
+
+
 // analyze/check database tables
 function mysqlCheckTables( $dbName )
 {
@@ -63,14 +94,9 @@
             $x++;
         }
     }
-
-
-
-
     return $data;
 }
 
-
 // check existings tables for upgrade or install
 function check_wb_tables()
 {
@@ -99,17 +125,6 @@
 // check existing tables
 $all_tables = check_wb_tables();
 
-// only for array tests
-function show_array($array=array())
-{
-    print '<pre>';
-    print_r ($array);
-    print '</pre>';
-}
-
-require_once(WB_PATH.'/framework/functions.php');
-require_once(WB_PATH.'/framework/class.admin.php');
-$admin = new admin('Addons', 'modules', false, false);
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
@@ -218,8 +233,6 @@
 	exit();
 }
 echo '<h2>Step 2: Updating database entries</h2>';
-$OK   = '<span class="ok">OK</span>';
-$FAIL = '<span class="error">FAILED</span>';
 
 // function to add a var/value-pair into settings-table
 function db_add_key_value($key, $value) {
@@ -267,14 +280,15 @@
  *  - Adding field default_theme to settings table
  */
 echo "<br />Adding default_theme to settings table<br />";
+db_update_key_value('settings', 'default_theme', $DEFAULT_THEME);
+/*
 $cfg = array(
 	'default_theme' => 'wb_theme'
 );
-
 foreach($cfg as $key=>$value) {
 	db_add_key_value($key, $value);
 }
-
+*/
 /**********************************************************
  *  - install droplets
  */
@@ -351,8 +365,10 @@
 echo "<br />Adding mediasettings to settings table<br />";
 $cfg = array(
 	'mediasettings' => '',
-	'rename_files_on_upload' => 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx'
+	'rename_files_on_upload' => 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js'
 );
+db_update_key_value('settings', 'rename_files_on_upload', $cfg['rename_files_on_upload']);
+
 foreach($cfg as $key=>$value) {
 	db_add_key_value($key, $value);
 }
@@ -505,12 +521,12 @@
  * upgrade media folder index protect files
  */
 $dir = (WB_PATH.MEDIA_DIRECTORY);
-echo '<h4>Upgrade '.MEDIA_DIRECTORY.'/ index.php protect files</h4>';
+echo '<h4>Upgrade '.MEDIA_DIRECTORY.'/ index.php protect files</h4><br />';
 $array = rebuildFolderProtectFile($dir);
 if( sizeof( $array ) ){
-	print 'Upgrade '.MEDIA_DIRECTORY.'/ index.php protect files'." $OK<br />";
+	print '<br /><strong>Upgrade '.sizeof( $array ).' '.MEDIA_DIRECTORY.'/ protect files</strong>'." $OK<br />";
 } else {
-	print 'Upgrade '.MEDIA_DIRECTORY.'/ index.php protect files'." $FAIL!<br />";
+	print '<br /><strong>Upgrade '.MEDIA_DIRECTORY.'/ protect files</strong>'." $FAIL!<br />";
 	print implode ('<br />',$array);
 }
 
@@ -531,8 +547,50 @@
  *  - Set Version to new Version
  */
 echo '<br />Update database version number to '.VERSION.' : ';
-echo ($database->query("UPDATE `".TABLE_PREFIX."settings` SET `value`='".VERSION."' WHERE `name` = 'wb_version'")) ? " $OK<br />" : " $FAIL<br />";
+// echo ($database->query("UPDATE `".TABLE_PREFIX."settings` SET `value`='".VERSION."' WHERE `name` = 'wb_version'")) ? " $OK<br />" : " $FAIL<br />";
+db_update_key_value('settings', 'wb_version', VERSION);
 
+/* *****************************************************************************
+ * - check for deprecated / never needed files
+ */
+?>
+<h2>Step 3: Remove deprecated and old files</h2>
+<?php
+
+	$searches = array(
+		'[ADMIN]',
+		'[MEDIA]',
+		'[PAGES]'
+	);
+	$replacements = array(
+		substr(ADMIN_PATH, strlen(WB_PATH)),
+		MEDIA_DIRECTORY,
+		PAGES_DIRECTORY
+	);
+
+	$msg = '';
+	foreach( $files2remove as $file )
+	{
+		$file = str_replace($searches, $replacements, $file);
+		$file = WB_PATH.'/'.$file;
+		if( file_exists( $file ))
+		{ // try to unlink file
+			if(!unlink($file))
+			{ // save in err-list, if failed
+				$msg .= $file.'<br />';
+			}
+		}
+	}
+
+	if($msg != '')
+	{
+		$msg = 'Following files are deprecated, outdated or a security risk and
+			    can not be removed automatically.<br /><br />Please delete them
+				using FTP and restart upgrade-script!<br /><br />'.$msg;
+        status_msg($msg, 'error warning', 'div');
+		echo '<br /><br /></div></body></html>';
+		exit();
+	}
 /**********************************************************
  *  - Reload all addons
  */
@@ -544,7 +602,7 @@
 	while(false !== ($file = readdir($handle))) {
 		if($file != '' AND substr($file, 0, 1) != '.' AND $file != 'admin.php' AND $file != 'index.php') {
 			load_module(WB_PATH.'/modules/'.$file );
-			upgrade_module($file, true);
+		   // 	upgrade_module($file, true);
 		}
 	}
 	closedir($handle);
@@ -584,7 +642,7 @@
 
 // require(WB_PATH.'/framework/initialize.php');
 
-if(!defined('DEFAULT_THEME')) { define('DEFAULT_THEME', 'wb_theme'); }
+if(!defined('DEFAULT_THEME')) { define('DEFAULT_THEME', $DEFAULT_THEME); }
 if(!defined('THEME_PATH')) { define('THEME_PATH', WB_PATH.'/templates/'.DEFAULT_THEME);}
 
 echo '<p style="font-size:120%;"><strong>Congratulations: The upgrade script is finished ...</strong></p>';
Index: branches/2.8.x/wb/config.php.bak
===================================================================
--- branches/2.8.x/wb/config.php.bak	(nonexistent)
+++ branches/2.8.x/wb/config.php.bak	(revision 1484)
@@ -0,0 +1 @@
+<?php

Property changes on: branches/2.8.x/wb/config.php.bak
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: branches/2.8.x/wb/admin/media/upload.php
===================================================================
--- branches/2.8.x/wb/admin/media/upload.php	(revision 1483)
+++ branches/2.8.x/wb/admin/media/upload.php	(revision 1484)
@@ -86,7 +86,7 @@
 		$info = pathinfo($filename);
 		$ext = isset($info['extension']) ? $info['extension'] : '';
 
-		if ( ($filename != '') && !preg_match("/\." . $forbidden_file_types . "$/i", $ext) )
+		if ( ($filename != '') && !preg_match("/" . $forbidden_file_types . "$/i", $ext) )
 		{
 			// Move to relative path (in media folder)
 			if(file_exists($relative.$filename) AND $overwrite == true) {
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1483)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1484)
@@ -52,4 +52,4 @@
 
 // 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', '1480');
+if(!defined('REVISION')) define('REVISION', '1484');
Index: branches/2.8.x/wb/admin/users/index.php
===================================================================
--- branches/2.8.x/wb/admin/users/index.php	(revision 1483)
+++ branches/2.8.x/wb/admin/users/index.php	(revision 1484)
@@ -30,7 +30,7 @@
 
 // Get existing value from database
 // $database = new database();
-$query = "SELECT user_id, username, display_name FROM ".TABLE_PREFIX."users WHERE user_id != '1' ORDER BY display_name,username";
+$query = "SELECT user_id, username, display_name, active FROM ".TABLE_PREFIX."users WHERE user_id != '1' ORDER BY display_name,username";
 $results = $database->query($query);
 if($database->is_error()) {
 	$admin->print_error($database->get_error(), 'index.php');
@@ -42,6 +42,7 @@
 	// Insert first value to say please select
 	$template->set_var('VALUE', '');
 	$template->set_var('NAME', $TEXT['PLEASE_SELECT'].'...');
+	$template->set_var('STATUS', 'text-decoration :none;' );
 	$template->parse('list', 'list_block', true);
 	// Loop through users
 	while($user = $results->fetchRow()) {
Index: branches/2.8.x/wb/framework/functions.php
===================================================================
--- branches/2.8.x/wb/framework/functions.php	(revision 1483)
+++ branches/2.8.x/wb/framework/functions.php	(revision 1484)
@@ -707,7 +707,8 @@
 {
 	global $admin, $MESSAGE;
 	$retVal = array();
-    if( ($sAbsDir=='') || ($sAbsDir == WB_PATH) ) { return $retVal;}
+	$wb_path = rtrim(str_replace('\/\\', '/', WB_PATH), '/');
+    if( ($sAbsDir=='') || ($sAbsDir == $wb_path) ) { return $retVal;}
 
 	if ( $make_dir==true ) {
 		// Check to see if the folder already exists
@@ -727,7 +728,7 @@
 	{
         // if(file_exists($sAbsDir.'/index.php')) { unlink($sAbsDir.'/index.php'); }
 	    // Create default "index.php" file
-		$rel_pages_dir = str_replace(WB_PATH, '', dirname($sAbsDir) );
+		$rel_pages_dir = str_replace($wb_path, '', dirname($sAbsDir) );
 		$step_back = str_repeat( '../', substr_count($rel_pages_dir, '/')+1 );
 
 		$sResponse  = $_SERVER['SERVER_PROTOCOL'].' 301 Moved Permanently';
@@ -742,41 +743,39 @@
 			"\t".'header(\'Location: '.WB_URL.'/index.php\');'."\n".
 			'// *************************************************'."\n";
 		$filename = $sAbsDir.'/index.php';
+
 		// write content into file
-		if ($handle = fopen($filename, 'w')) {
-			fwrite($handle, $content);
-			fclose($handle);
-			change_mode($filename, 'file');
+		if(is_writable($filename)) {
+		    if(file_put_contents($filename, $content)) {
+				print 'create => '.str_replace( $wb_path,'',$filename).'<br />';
+		        change_mode($filename, 'file');
+		    }
 		}
-		// $admin->print_success($MESSAGE['MEDIA']['DIR_MADE']);
 	} else {
-		// $admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS']);
 			$retVal[] = $MESSAGE['GENERIC_BAD_PERMISSIONS'];
 	}
 	return $retVal;
 }
 
-// Rebuild new protected files in the given directory and subs
 function rebuildFolderProtectFile($dir='')
 {
-	$retVal = array();
+ $retVal = array();
+ $dir = rtrim(str_replace('\/\\', '/', $dir), '/');
     try {
-		$iterator = new RecursiveDirectoryIterator($dir);
-		foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::SELF_FIRST) as $file)
-		{
-		  if ($file->isDir()) {
-		     $protect_file = ($file->getPathname());
-		     $retVal[] = createFolderProtectFile($protect_file,false);
-		  } else {
-		     // print ($file->getPathname())."<br />";
-		  }
-		}
-	} catch ( Exception $e ) {
-		$retVal[] = $MESSAGE['MEDIA_DIR_ACCESS_DENIED'];
-	}
-
-    $retVal = array_merge($retVal);
-	return $retVal;
+  $files = array();
+  $files[] = $dir;
+  foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)) as $fileInfo){
+   $files[] = $fileInfo->getPath();
+  }
+  $files = array_unique($files);
+  foreach( $files as $file){
+   $protect_file = rtrim(str_replace('\/\\', '/', $file), '/');
+   $retVal[] = createFolderProtectFile($protect_file,false);
+  }
+ } catch ( Exception $e ) {
+  $retVal[] = $MESSAGE['MEDIA_DIR_ACCESS_DENIED'];
+ }
+ return $retVal;
 }
 
 // Create a new file in the pages directory
Index: branches/2.8.x/wb/favicon.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: branches/2.8.x/wb/favicon.ico
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: branches/2.8.x/wb/modules/SecureFormSwitcher/upgrade.php
===================================================================
--- branches/2.8.x/wb/modules/SecureFormSwitcher/upgrade.php	(revision 1483)
+++ branches/2.8.x/wb/modules/SecureFormSwitcher/upgrade.php	(revision 1484)
@@ -3,8 +3,7 @@
  *
  * @category        modules
  * @package         SecureFormSwitcher
- * @author          WebsiteBaker Project
- * @copyright       2004-2009, Ryan Djurovich
+ * @author          Luisehahne
  * @copyright       2009-2011, Website Baker Org. e.V.
  * @link            http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
@@ -18,24 +17,3 @@
 
 // Must include code to stop this file being access directly
 if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
-global $i;
-// load module language file
-$mod_path = (dirname(__FILE__));
-require_once( $mod_path.'/language_load.php' );
-$i = (!isset($i) ? 1 : $i);
-print "<div style=\"margin:1em auto;font-size:1.1em;\">";
-print "<h4>Step $i: Updating SecureForm Switcher</h4>\n";
-$i++;
-$OK   = "<span class=\"ok\">OK</span>";
-$FAIL = "<span class=\"error\">FAILED</span>";
-$target = $mod_path.'/files/SecureForm.mtab.php';
-$dest = WB_PATH.'/framework/SecureForm.mtab.php';
-
-if(is_writeable(WB_PATH.'/framework')) {
-	if((copy($target,$dest) && change_mode($dest)) || file_exists($target)) {
-		print "<br /><strong>Updating secure_form_module</strong> $OK<br />\n";
-	} else {
-		print "<br /><strong>Updating secure_form_module</strong> $FAIL<br />\n";
-	}
-}
-print "</div>";
Index: branches/2.8.x/wb/modules/edit_module_files.php
===================================================================
--- branches/2.8.x/wb/modules/edit_module_files.php	(revision 1483)
+++ branches/2.8.x/wb/modules/edit_module_files.php	(revision 1484)
@@ -104,7 +104,7 @@
 		<input type="hidden" name="edit_file" value="<?php echo $css_file; ?>" />
 	  	<input type="hidden" name="action" value="save" />
 		<textarea id="code_area" name="css_data" cols="100" rows="25" wrap="VIRTUAL" style="margin:2px;width:100%;">
-		<?php echo htmlspecialchars($css_content); ?>
+<?php echo htmlspecialchars($css_content); ?>
 		</textarea>
   			<table cellpadding="0" cellspacing="0" border="0" width="100%">
   			<tr>
Index: branches/2.8.x/wb/modules/output_filter/install.php
===================================================================
--- branches/2.8.x/wb/modules/output_filter/install.php	(revision 1483)
+++ branches/2.8.x/wb/modules/output_filter/install.php	(revision 1484)
@@ -33,4 +33,4 @@
 
 // add default values to the module table
 $database->query("INSERT INTO ".TABLE_PREFIX
-	."mod_output_filter (sys_rel,email_filter, mailto_filter, at_replacement, dot_replacement) VALUES ('1','1', '1', '(at)', '(dot)')");
+	."mod_output_filter (sys_rel,email_filter, mailto_filter, at_replacement, dot_replacement) VALUES ('0','1', '1', '(at)', '(dot)')");
Index: branches/2.8.x/wb/modules/news/rss.php
===================================================================
--- branches/2.8.x/wb/modules/news/rss.php	(revision 1483)
+++ branches/2.8.x/wb/modules/news/rss.php	(revision 1484)
@@ -60,8 +60,8 @@
 ?>
 		<language><?php echo strtolower(DEFAULT_LANGUAGE); ?></language>
 		<copyright><?php $thedate = date('Y'); $websitetitle = WEBSITE_TITLE; echo "Copyright {$thedate}, {$websitetitle}"; ?></copyright>
-		<managingEditor><?php echo SERVER_EMAIL; ?></managingEditor>
-		<webMaster><?php echo SERVER_EMAIL; ?></webMaster>
+		<managingEditor><?php echo 'info@wdsnet.de'; ?></managingEditor>
+		<webMaster><?php echo 'info@wdsnet.de'; ?></webMaster>
 		<category><?php echo WEBSITE_TITLE; ?></category>
 		<generator>WebsiteBaker Content Management System</generator>
 <?php
@@ -77,13 +77,18 @@
 $result = $database->query($query);
 
 //Generating the news items
-while($item = $result->fetchRow()){ ?>
-		<item>
-			<title><![CDATA[<?php echo stripslashes($item["title"]); ?>]]></title>
-			<description><![CDATA[<?php echo stripslashes($item["content_short"]); ?>]]></description>
-			<guid><?php echo WB_URL.PAGES_DIRECTORY.$item["link"].PAGE_EXTENSION; ?></guid>
-			<link><?php echo WB_URL.PAGES_DIRECTORY.$item["link"].PAGE_EXTENSION; ?></link>
-		</item>
+while($item = $result->fetchRow()){
+	$description = stripslashes($item["content_short"]);
+	// wb->preprocess() -- replace all [wblink123] with real, internal links
+	$wb->preprocess($description);
+?>
+	<item>
+		<title><![CDATA[<?php echo stripslashes($item["title"]); ?>]]></title>
+		<description><![CDATA[<?php echo $description; ?>]]></description>
+		<link><?php echo WB_URL.PAGES_DIRECTORY.$item["link"].PAGE_EXTENSION; ?></link>
+		<pubDate><?PHP echo date("D, d M Y", $item["published_when"]); ?></pubDate>
+		<guid><?php echo WB_URL.PAGES_DIRECTORY.$item["link"].PAGE_EXTENSION; ?></guid>
+	</item>
 <?php } ?>
 	</channel>
 </rss>
\ No newline at end of file
