Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1948)
+++ branches/2.8.x/CHANGELOG	(revision 1949)
@@ -11,6 +11,8 @@
 ! = Update/Change
 ===============================================================================
 
+09 Aug-2013 Build 1949 M.v.d.Decken(DarkViper)
+! some corrections in class AccessFile
 04 Aug-2013 Build 1948 M.v.d.Decken(DarkViper)
 + added $page_id compatibility to /index.php
 # solved escaping problems on save to database in modules/droplets
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1948)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1949)
@@ -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', '1948');
+if(!defined('REVISION')) define('REVISION', '1949');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/framework/AccessFile.php
===================================================================
--- branches/2.8.x/wb/framework/AccessFile.php	(revision 1948)
+++ branches/2.8.x/wb/framework/AccessFile.php	(revision 1949)
@@ -131,7 +131,7 @@
 
 	/**
 	 * Rename an existing Accessfile
-	 * @param string the new filename without path and without extension
+	 * @param  string  $sNewName the new filename without path and without extension
 	 * @return boolean
 	 * @throws AccessFileInvalidFilenameException
 	 * @throws AccessFileAlreadyExistsException
@@ -140,48 +140,41 @@
 	public function rename($sNewName)
 	{
 		// sanitize new filename
-		if (!preg_match('/[^\.\\\/]*/si', $sNewName)) {
-			throw new AccessFileInvalidFilenameException('invalid filename [' . $sNewName . ']');
+		if (!preg_match('/[^\.\\ \/]*/si', $sNewName)) {
+			throw new AccessFileInvalidFilenameException('invalid filename [' . str_replace($this->_oReg->AppPath, '', $sNewName) . ']');
 		}
 		// prepare old/new file-/dirname
-		$sOldFilename = $this->_sFileName;
+		$sOldFilename   = $this->_sFileName;
 		$sOldSubDirname = dirname($sOldFilename) . '/';
+		$sBaseDirname   = dirname($sOldSubDirname) . '/';
 		$sPattern = '/^(' . preg_quote($sOldSubDirname, '/') . ')([^\/\.]+?)(\.[a-z0-9]+)$/siU';
 		$sNewFilename = preg_replace($sPattern, '\1' . $sNewName . '\3', $sOldFilename);
 		$sNewSubDirname = dirname($sNewFilename) . '/';
 		if (file_exists($sNewFilename) || file_exists($sNewSubDirname)) {
-			// check if new filename already exists
-			throw new AccessFileAlreadyExistsException('new file/dirname already exists [' . $sNewName . ']');
+			// if new filename or directory already exists
+			throw new AccessFileAlreadyExistsException('new file/dirname already exists [' . str_replace($this->_oReg->AppPath, '', $sNewName) . ']');
 		}
-		// try to rename a depending subdirectory
-		$bSubdirRenamed = false;
-		$bRetval = true;
-		if (file_exists($sOldSubDirname))
-		{
-			// old subdir exists but is it writeable?
-			if (($bRetval = is_writable($sOldSubDirname)))
+		if(!is_writeable($sOldFilename)) {
+			throw new AccessFileRenameException('unable to rename file or file not exists [' . str_replace($this->_oReg->AppPath, '', $sOldFilename) . ']');
+		}
+		$bSubdirRenamed = false; // set default value
+		if(file_exists($sOldSubDirname))
+		{ //
+			if(is_writeable($sOldSubDirname))
 			{
-				if (rename($sOldSubDirname, $sNewSubDirname)) {
-					$bRetval = $bSubdirRenamed = true;
+				if(!( $bSubdirRenamed = rename($sOldSubDirname, $sNewSubDirname))) {
+					throw new AccessFileRenameException('unable to rename directory [' . str_replace($this->_oReg->AppPath, '', $sOldSubDirname) . ']');
 				}
+			} else {
+				throw new AccessFileRenameException('directory is not writeable [' . str_replace($this->_oReg->AppPath, '', $sOldSubDirname) . ']');
 			}
 		}
-		if (!$bRetval) {
-			// if old subdir exists and renaming failed
-			throw new AccessFileRenameException('unable to rename directory [' . $sOldSubDirname . ']');
+		// try to rename accessfile
+		if(!rename($sOldFilename, $sNewFilename)) {
+			if($bSubdirRenamed) { rename($sNewSubDirname, $sOldSubDirname); }
+			throw new AccessFileRenameException('unable to rename file [' . str_replace($this->_oReg->AppPath, '', $sOldFilename) . ']');
 		}
-		if (($bRetval = is_writeable($this->_sFileName))) {
-			// try to rename accessfile
-			$bRetval = rename($sOldFilename, $sNewFilename);
-		}
-		if (!$bRetval)
-		{
-			if ($bSubdirRenamed) {
-				// on error undo renaming of subdir
-				rename($sNewSubDirname, $sOldSubDirname);
-			}
-			throw new AccessFileRenameException('unable to rename file [' . $sOldFilename . ']');
-		}
+		return true;
 	}
 
 	/**
@@ -337,23 +330,27 @@
 	{
 		$sFileContent
 				= '<?php' . "\n"
-				. '// *** This file is generated by ' . $this->_oReg->AppName
-				. ' Ver.' . $this->_oReg->AppVersion
-				. ($this->_oReg->AppServicePack != '' ? $this->_oReg->AppServicePack : '')
+				. '// *** This file was created automatically by ' ."\n"
+				. '// *** ' . $this->_oReg->AppName	. ' Ver.' . $this->_oReg->AppVersion
+				. ($this->_oReg->AppServicePack != '' ? ' '.$this->_oReg->AppServicePack : '')
 				. ' Rev.' . $this->_oReg->AppRevision . "\n"
-				. '// *** Creation date: ' . date('c') . "\n"
-				. '// *** Do not modify this file manually' . "\n"
-				. '// *** This file will be rebuild from time to time!!' . "\n"
-				. '// *** Then all manual changes will get lost!! ' . "\n"
-				. '// *************************************************' . "\n";
+				. '// *** on ' . date('c') . "\n"
+				. '//' . "\n"
+				. '// *** Warning *************************************' . "\n"
+				. '// *** Please do not manually change this file!' . "\n"
+				. '// *** It will be recreated from time to time and' . "\n"
+				. '// *** then all manual changes will get lost!!' . "\n"
+				. '// *************************************************' . "\n"
+				. '//' . "\n";
 		foreach ($this->_aVars as $sKey => $sVar) {
 			$sFileContent .= "\t" . '$' . $sKey . ' = ' . $sVar . ';' . "\n";
 		}
 		foreach ($this->_aConsts as $sKey => $sVar) {
-			$sFileContent .= "\t" . 'define(\'' . $sKey . '\', ' . $sVar . '); // *deprecated command*' . "\n";
+			$sFileContent .= "\t" . 'define(\'' . $sKey . '\', ' . $sVar . '); // ** deprecated command **' . "\n";
 		}
 		$sFileContent
-				.= "\t" . 'require(\'' . $sIndexFile . '\');' . "\n"
+				.="\t" . 'require(\'' . $sIndexFile . '\');' . "\n"
+				. "\t" . 'exit(0);' . "\n"
 				. '// *************************************************' . "\n"
 				. '// end of file' . "\n";
 
@@ -381,8 +378,10 @@
 class AccessFileException extends Exception { }
 class AccessFileConstForbiddenException extends AccessFileException { }
 class AccessFileInvalidFilePathException extends AccessFileException { }
+class AccessFileInvalidFilenameException extends AccessFileException { }
 class AccessFileAlreadyExistsException extends AccessFileException { }
 class AccessFileNotWriteableException extends AccessFileException { }
 class AccessFileIsInvalidFilenameException extends AccessFileException { }
 class AccessFileIsNoAccessfileException extends AccessFileException { }
 class AccessFileInvalidStructureException extends AccessFileException { }
+class AccessFileRenameException extends AccessFileException { }
