Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1840)
+++ branches/2.8.x/CHANGELOG	(revision 1841)
@@ -12,6 +12,8 @@
 ===============================================================================
 
 
+23 Dez-2012 Build 1841 Dietmar Woellbrink (Luisehahne)
+# fixed index depth in access files
 23 Dez-2012 Build 1840 Dietmar Woellbrink (Luisehahne)
 ! settings move website_signature to mailer settings
 ! fix html validate error in pages sections
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1840)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1841)
@@ -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', '1840');
+if(!defined('REVISION')) define('REVISION', '1841');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/framework/functions.php
===================================================================
--- branches/2.8.x/wb/framework/functions.php	(revision 1840)
+++ branches/2.8.x/wb/framework/functions.php	(revision 1841)
@@ -5,12 +5,12 @@
  * @package         framework
  * @author          Ryan Djurovich,WebsiteBaker Project
  * @copyright       2009-2012, WebsiteBaker Org. e.V.
- * @link			http://www.websitebaker2.org/
+ * @link            http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
  * @requirements    PHP 5.2.2 and higher
  * @version         $Id$
- * @filesource		$HeadURL$
+ * @filesource      $HeadURL$
  * @lastmodified    $Date$
  *
 */
@@ -747,22 +747,21 @@
 			$parents .= '/'.$parent_folder;
 			$acces_file = WB_PATH.PAGES_DIRECTORY.$parents;
 			// can only be dirs
-			if(!file_exists($acces_file)) {
+			if(!is_readable($acces_file)) {
 				if(!make_dir($acces_file)) {
-//					$admin->print_error($MESSAGE['PAGES_CANNOT_CREATE_ACCESS_FILE_FOLDER']);
+					$retVal[] = $MESSAGE['PAGES_CANNOT_CREATE_ACCESS_FILE_FOLDER'];
                     $retVal[] = $MESSAGE['MEDIA_DIR_ACCESS_DENIED'];
 				}
 			}
 		}
 	}
+
 	// The depth of the page directory in the directory hierarchy
-	// '/pages' is at depth 1
-	$pages_dir_depth = count(explode('/',PAGES_DIRECTORY))-1;
+	// '/pages' is at depth 2
+	$bPagesDirectorySet = (sizeof(explode('/',PAGES_DIRECTORY))==1);
 	// Work-out how many ../'s we need to get to the index page
-	$index_location = '';
-	for($i = 0; $i < $level + $pages_dir_depth; $i++) {
-		$index_location .= '../';
-	}
+	$pages_dir_depth = sizeof($parent_folders)-intval($bPagesDirectorySet);
+	$index_location = str_repeat ( '../' , $pages_dir_depth );
 	$content =
 		'<?php'."\n".
 		'// *** This file is generated by WebsiteBaker Ver.'.VERSION."\n".
