Index: access.php
===================================================================
--- access.php	(revision 22202)
+++ access.php	(working copy)
@@ -282,7 +282,7 @@
  \return the \a $access parameter.
 */
 
-function changeAccess( $access )
+function changeAccess( $access, $prependExtensionSiteAccesses = true )
 {
     $ini = eZINI::instance();
 
@@ -298,12 +298,15 @@
 
     if ( file_exists( "settings/siteaccess/$name" ) )
     {
-        $ini->prependOverrideDir( "siteaccess/$name", false, 'siteaccess' );
+        $ini->prependOverrideDir( "siteaccess/$name", false, 'siteaccess', 'siteaccess' );
     }
 
     /* Make sure extension siteaccesses are prepended */
     //include_once( 'lib/ezutils/classes/ezextension.php' );
-    eZExtension::prependExtensionSiteAccesses( $name );
+    if ( $prependExtensionSiteAccesses )
+    {
+        eZExtension::prependExtensionSiteAccesses( $name );
+    }
 
     $ini->loadCache();
 
@@ -316,6 +319,43 @@
     return $access;
 }
 
+/* Load siteaccess settings (when you already know the siteaccess name)
+ * Simplifiyes changing siteaccess settings, lets you load the siteaccess
+ * setting locally on a ini variable by passing the ini object as second param.
+ * If so make sure you have used $useLocaleOveride param on the ini instance
+ * returns the site.ini instance used in the prosess
+ */
+
+function loadAccessSettings( $siteaccess, $ini = null )
+{
+    if ( !$ini instanceof eZINI )
+    {
+        $ini = eZINI::instance();
+    }
+
+    // load regular site.ini file with localOverride dirs, and clear the override dir list
+    $tempSiteIni = eZINI::instance( 'site.ini', 'settings', null, null, true);
+    $tempSiteIni->setOverrideDirs( eZINI::defaultOverrideDirs() );
+
+    // activate default extensions + extension siteaccess since we already know it
+    eZExtension::activateExtensions( 'default', $tempSiteIni, $siteaccess );
+
+    // load siteaccess
+    if( file_exists( "settings/siteaccess/$siteaccess" ) )
+    {
+            $tempSiteIni->prependOverrideDir( "siteaccess/$siteaccess", false, 'siteaccess', 'siteaccess' );
+            $tempSiteIni->loadCache();
+    }
+
+    // activate all extension now that siteaccess settings are loaded
+    eZExtension::activateExtensions( false, $tempSiteIni, $siteaccess );
+
+    // set the created override dirs to the ini variable
+    $ini->setOverrideDirs( $tempSiteIni->overrideDirs( false ) );
+    $ini->loadCache();
+    return $tempSiteIni;
+}
+
 function accessMatchRegexp( &$text, $reg, $num )
 {
     $reg = preg_replace( "#/#", "\\/", $reg );
Index: index.php
===================================================================
--- index.php	(revision 22202)
+++ index.php	(working copy)
@@ -372,8 +372,8 @@
 // Check for activating Debug by user ID (Final checking. The first was in eZDebug::updateSettings())
 eZDebug::checkDebugByUser();
 
-// Check for siteaccess extension
-eZExtension::activateExtensions( 'access' );
+// Check for new extension loaded by siteaccess
+eZExtension::activateExtensions( );
 // Siteaccess extension check end
 
 // Make sure template.ini reloads its cache incase
Index: index_treemenu.php
===================================================================
--- index_treemenu.php	(revision 22202)
+++ index_treemenu.php	(working copy)
@@ -108,6 +108,9 @@
 $access = changeAccess( $access );
 $GLOBALS['eZCurrentAccess'] = $access;
 
+// Check for new extension loaded by siteaccess
+eZExtension::activateExtensions( );
+
 $db = eZDB::instance();
 if ( $db->isConnected() )
 {
Index: kernel/classes/ezcache.php
===================================================================
--- kernel/classes/ezcache.php	(revision 22202)
+++ kernel/classes/ezcache.php	(working copy)
@@ -86,6 +86,12 @@
                                        'tag' => array( 'codepage' ),
                                        'enabled' => true,
                                        'path' => 'codepages' ),
+                                array( 'name' => ezi18n( 'kernel/cache', 'Extension dir cache' ),
+                                       'id' => 'extension_dirs',
+                                       'tag' => array( 'extension_dirs' ),
+                                       'enabled' => true,
+                                       'path' => false,
+                                       'function' => array( 'eZCache', 'clearExtensionDirs' ) ),
 /* Entry is disabled since it does not make sense to remove it, it is not a cache file.
                                 array( 'name' => ezi18n( 'kernel/cache', 'Expiry cache' ),
                                        'id' => 'expiry',
@@ -459,6 +465,23 @@
     /*!
      \private
      \static
+     Clears all ini and module directory cache from var/cache.
+    */
+    static function clearExtensionDirs( $cacheItem )
+    {
+        $cachePath = eZSys::cacheDirectory();
+
+        // VS-DBFILE
+
+        require_once( 'kernel/classes/ezclusterfilehandler.php' );
+        $fileHandler = eZClusterFileHandler::instance();
+        $fileHandler->fileDelete( $cachePath, 'extension_dirs' );
+    }
+    
+    
+    /*!
+     \private
+     \static
      Clears all content class identifier cache files from var/cache.
     */
     static function clearClassID( $cacheItem )
Index: kernel/classes/ezcontentcachemanager.php
===================================================================
--- kernel/classes/ezcontentcachemanager.php	(revision 22202)
+++ kernel/classes/ezcontentcachemanager.php	(working copy)
@@ -783,7 +783,7 @@
 
                 // Get the sitedesign and cached view preferences for this siteaccess
                 $siteini = eZINI::instance( 'site.ini', 'settings', null, null, false );
-                $siteini->prependOverrideDir( "siteaccess/$changeToSiteAccess", false, 'siteaccess' );
+                $siteini->prependOverrideDir( "siteaccess/$changeToSiteAccess", false, 'siteaccess', 'siteaccess' );
                 $siteini->loadCache();
                 $designSetting = $siteini->variable( "DesignSettings", "SiteDesign" );
                 $cachedViewPreferences = $siteini->variable( 'ContentSettings', 'CachedViewPreferences' );
Index: kernel/classes/ezscript.php
===================================================================
--- kernel/classes/ezscript.php	(revision 22202)
+++ kernel/classes/ezscript.php	(working copy)
@@ -269,8 +269,8 @@
 
         if ( $this->UseExtensions )
         {
-            // Check for siteaccess extension
-            eZExtension::activateExtensions( 'access' );
+            // Check for new extension loaded by siteaccess
+            eZExtension::activateExtensions( );
             // Extension check end
         }
 
Index: kernel/classes/packagehandlers/ezcontentobject/ezcontentobjectpackagehandler.php
===================================================================
--- kernel/classes/packagehandlers/ezcontentobject/ezcontentobjectpackagehandler.php	(revision 22202)
+++ kernel/classes/packagehandlers/ezcontentobject/ezcontentobjectpackagehandler.php	(working copy)
@@ -439,7 +439,7 @@
         foreach( array_keys( $this->TemplateFileArray ) as $siteAccess )
         {
             $aliasINI = eZINI::instance( 'fetchalias.ini', 'settings', null, null, true );
-            $aliasINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+            $aliasINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
             $aliasINI->loadCache();
 
             foreach ( $this->TemplateFileArray[$siteAccess] as $filename )
@@ -603,7 +603,7 @@
         foreach ( $siteAccessArray as $siteAccess )
         {
             $overrideINI = eZINI::instance( 'override.ini', 'settings', null, null, true );
-            $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+            $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
             $overrideINI->loadCache();
 
             $matchBlock = false;
@@ -1234,7 +1234,7 @@
             if ( !isset( $siteAccessDesignPathArray[$newSiteAccess] ) )
             {
                 $ini = eZINI::instance( 'site.ini', 'settings', null, null, true );
-                $ini->prependOverrideDir( "siteaccess/$newSiteAccess", false, 'siteaccess' );
+                $ini->prependOverrideDir( "siteaccess/$newSiteAccess", false, 'siteaccess', 'siteaccess' );
                 $ini->loadCache();
 
                 if ( isset( $installParameters['design_map'] ) )
Index: kernel/classes/packagehandlers/eziniaddon/eziniaddonpackagehandler.php
===================================================================
--- kernel/classes/packagehandlers/eziniaddon/eziniaddonpackagehandler.php	(revision 22202)
+++ kernel/classes/packagehandlers/eziniaddon/eziniaddonpackagehandler.php	(working copy)
@@ -76,7 +76,7 @@
 
         //include_once( 'lib/ezutils/classes/ezini.php' );
         $ini = eZINI::instance( $filename, 'settings', null, null, true );
-        $ini->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+        $ini->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
         $ini->loadCache();
 
         $blocks =& $content->elementByName( 'blocks' );
Index: kernel/common/eztemplatedesignresource.php
===================================================================
--- kernel/common/eztemplatedesignresource.php	(revision 22202)
+++ kernel/common/eztemplatedesignresource.php	(working copy)
@@ -584,12 +584,12 @@
         {
             // Get the design resources
             $ini = eZINI::instance( 'site.ini', 'settings', null, null, true );
-            $ini->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+            $ini->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
             eZExtension::prependExtensionSiteAccesses( $siteAccess, $ini, false, 'siteaccess' );
             $ini->loadCache();
 
             $overrideINI = eZINI::instance( 'override.ini', 'settings', null, null, true );
-            $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+            $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
             eZExtension::prependExtensionSiteAccesses( $siteAccess, $overrideINI, false, 'siteaccess', false );
             $overrideINI->loadCache();
 
@@ -605,8 +605,8 @@
             if ( $this->OverrideSiteAccess != false )
             {
                 $overrideINI = eZINI::instance( 'override.ini', 'settings', null, null, true );
-                eZExtension::prependExtensionSiteAccesses( $siteAccess, $overrideINI, false, 'siteaccess' );
-                $overrideINI->prependOverrideDir( "siteaccess/$this->OverrideSiteAccess", false, 'siteaccess', false );
+                $overrideINI->prependOverrideDir( "siteaccess/$this->OverrideSiteAccess", false, 'siteaccess', 'siteaccess' );
+                eZExtension::prependExtensionSiteAccesses( $this->OverrideSiteAccess, $overrideINI, false, 'siteaccess' );
                 $overrideINI->loadCache();
                 $keys[] = "siteaccess/$this->OverrideSiteAccess";
             }
@@ -679,7 +679,7 @@
             }
 
             $ini = eZINI::instance( 'site.ini', 'settings', null, null, true );
-            $ini->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+            $ini->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
             eZExtension::prependExtensionSiteAccesses( $siteAccess, $ini, false, 'siteaccess' );
             $ini->loadCache();
 
@@ -779,7 +779,7 @@
         if ( $siteAccess )
         {
             $overrideINI = eZINI::instance( 'override.ini', 'settings', null, null, true );
-            $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+            $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
             eZExtension::prependExtensionSiteAccesses( $siteAccess, $overrideINI, false, 'siteaccess', false );
             $overrideINI->loadCache();
         }
Index: kernel/content/versionview.php
===================================================================
--- kernel/content/versionview.php	(revision 22202)
+++ kernel/content/versionview.php	(working copy)
@@ -44,8 +44,6 @@
 // incase the user decides to continue editing.
 $FromLanguage = $Params['FromLanguage'];
 
-$ini = eZINI::instance();
-
 $contentObject = eZContentObject::fetch( $ObjectID );
 if ( $contentObject === null )
     return $Module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
@@ -129,8 +127,6 @@
     }
 }
 
-$contentINI = eZINI::instance( 'content.ini' );
-
 if ( $Module->isCurrentAction( 'ChangeSettings' ) )
 {
     if ( $Module->hasActionParameter( 'Language' ) )
@@ -242,9 +238,9 @@
     return;
 }
 
-$contentINI = eZINI::instance( 'content.ini' );
 if ( !$siteAccess )
 {
+    $contentINI = eZINI::instance( 'content.ini' );
     if ( $contentINI->hasVariable( 'VersionView', 'DefaultPreviewDesign' ) )
     {
         $siteAccess = $contentINI->variable( 'VersionView', 'DefaultPreviewDesign' );
@@ -255,17 +251,21 @@
     }
 }
 
-$access = $GLOBALS['eZCurrentAccess'];
-$access['name'] = $siteAccess;
+// change siteaccess if different then current
+if ( $GLOBALS['eZCurrentAccess']['name'] !== $siteAccess )
+{
+    // load settings globally
+    loadAccessSettings( $siteAccess );
 
-if ( $access['type'] == EZ_ACCESS_TYPE_URI )
-{
-    eZSys::clearAccessPath();
+    // change siteaccess
+    $access = $GLOBALS['eZCurrentAccess'];
+    $access['name'] = $siteAccess;
+    if ( $access['type'] == EZ_ACCESS_TYPE_URI )
+    {
+        eZSys::clearAccessPath();
+    }
+    changeAccess( $access, false );
 }
-changeAccess( $access );
-
-// Load the siteaccess extensions
-eZExtension::activateExtensions( 'access' );
 
 // Change content object default language
 $GLOBALS['eZContentObjectDefaultLanguage'] = $LanguageCode;
@@ -298,7 +298,7 @@
 //include_once( 'kernel/classes/eznodeviewfunctions.php' );
 
 unset( $contentObject );
-$contentObject = $node->attribute( 'object' ); // do not remove &
+$contentObject = $node->attribute( 'object' );
 
 $Result = eZNodeviewfunctions::generateNodeView( $tpl, $node, $contentObject, $LanguageCode, 'full', 0,
                                                  false, false, false );
Index: kernel/settings/edit.php
===================================================================
--- kernel/settings/edit.php	(revision 22202)
+++ kernel/settings/edit.php	(working copy)
@@ -202,12 +202,12 @@
     return $result;
 }
 
-$ini = eZINI::instance( $iniFile, 'settings', null, null, false );
+$ini = eZINI::instance( $iniFile, 'settings', null, null, true );
 
-if ( isset( $settingPlacement ) and $settingPlacement == 'siteaccess' )
+// If a different siteaccess is selected, then we need to load override dirs for that siteaccess
+if ( $GLOBALS['eZCurrentAccess']['name'] != $siteAccess )
 {
-    $ini->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
-    $ini->loadCache();
+    $tempSiteIni = loadAccessSettings( $siteAccess, $ini );
 }
 
 $value = $settingName != '' ? $ini->variable( $block, $settingName ) : '';
@@ -220,17 +220,15 @@
     {
         $value = parseArrayToStr( $value, "\n" );
     }
+}
 
-}
 // Init value from ini (default\override\extensions\siteaccess)
 $values = array();
 $values['default'] = getVariable( $block, $settingName, $iniFile, 'settings/' );
 $values['siteaccess'] = getVariable( $block, $settingName, $iniFile, "settings/siteaccess/$siteAccess" );
 $values['override'] = getVariable( $block, $settingName, $iniFile, "settings/override/" );
-// Get values from extensions
-$ini = eZINI::instance();
-$extensions = $ini->hasVariable( 'ExtensionSettings','ActiveExtensions' ) ? $ini->variable( 'ExtensionSettings','ActiveExtensions' ) : array();
-$extensionDir = $ini->hasVariable( 'ExtensionSettings','ExtensionDirectory' ) ? $ini->variable( 'ExtensionSettings','ExtensionDirectory' ) : 'extension';
+$extensions = $tempSiteIni->hasVariable( 'ExtensionSettings','ActiveExtensions' ) ? $tempSiteIni->variable( 'ExtensionSettings','ActiveExtensions' ) : array();
+$extensionDir = $tempSiteIni->hasVariable( 'ExtensionSettings','ExtensionDirectory' ) ? $tempSiteIni->variable( 'ExtensionSettings','ExtensionDirectory' ) : 'extension';
 foreach ( $extensions as $extension )
 {
     $extValue = getVariable( $block, $settingName, $iniFile, "$extensionDir/$extension/settings" );
Index: kernel/settings/view.php
===================================================================
--- kernel/settings/view.php	(revision 22202)
+++ kernel/settings/view.php	(working copy)
@@ -57,7 +57,7 @@
     if ( isset( $settingFile ) )
     {
         $ini = eZINI::create( $settingFile, 'settings', null, null, false );
-        $ini->prependOverrideDir( "siteaccess/$currentSiteAccess", false, 'siteaccess' );
+        $ini->prependOverrideDir( "siteaccess/$currentSiteAccess", false, 'siteaccess', 'siteaccess' );
         $ini->loadCache();
     }
 
@@ -103,32 +103,16 @@
     }
 }
 
-
 if ( $http->hasPostVariable( 'ChangeINIFile' ) or
      ( $Params['SiteAccess'] and $Params['INIFile'] ) )
 {
-    $ini = eZINI::create( $settingFile, 'settings', null, null, false );
-    if ( file_exists( "settings/siteaccess/$currentSiteAccess" ) )
-    {
-        $ini->prependOverrideDir( "siteaccess/$currentSiteAccess", false, 'siteaccess' );
-    }
-    else
+    $ini = eZINI::instance( $settingFile, 'settings', null, false, true);
+
+    // If a different siteaccess is selected, then we need to load override dirs for that siteaccess
+    if ( $GLOBALS['eZCurrentAccess']['name'] != $currentSiteAccess )
     {
-        $extensionDirectory = $ini->variable( 'ExtensionSettings', 'ExtensionDirectory' );
-        $activeExtensions = $ini->variable( 'ExtensionSettings', 'ActiveExtensions' );
-        foreach ( $activeExtensions as $extensionName )
-        {
-            $possibleExtensionPath = $extensionDirectory . '/' . $extensionName . '/settings/siteaccess/' .
-                                     $currentSiteAccess;
-            if ( file_exists( $possibleExtensionPath ) )
-            {
-                $ini->prependOverrideDir( $extensionDirectory . '/' . $extensionName . '/settings/siteaccess/' .
-                                          $currentSiteAccess, true, 'siteaccess' );
-                break;
-            }
-        }
+        loadAccessSettings( $currentSiteAccess, $ini );
     }
-    $ini->loadCache();
 
     $blocks = $ini->groups();
     $placements = $ini->groupPlacements();
@@ -141,7 +125,7 @@
         $settingsCount = 0;
         $blockRemoveable = false;
         $blockEditable = true;
-        foreach( $key as $setting=>$settingKey )
+        foreach( $key as $setting => $settingKey )
         {
             $hasSetPlacement = false;
             $type = $ini->settingType( $settingKey );
@@ -153,7 +137,7 @@
                     if ( count( $settingKey ) == 0 )
                         $settings[$block]['content'][$setting]['content'] = array();
 
-                    foreach( $settingKey as $settingElementKey=>$settingElementValue )
+                    foreach( $settingKey as $settingElementKey => $settingElementValue )
                     {
                         $settingPlacement = $ini->findSettingPlacement( $placements[$block][$setting][$settingElementKey] );
                         if ( $settingElementValue != null )
@@ -232,10 +216,11 @@
 }
 
 $rootDir = 'settings';
+$iniFiles = eZDir::recursiveFindRelative( $rootDir, '', '.ini' );
 
-$iniFiles = eZDir::recursiveFindRelative( $rootDir, '', '.ini' );
 $iniFiles = str_replace('/', '', $iniFiles );
 sort( $iniFiles );
+$iniFiles = array_unique( $iniFiles  );
 
 $tpl->setVariable( 'ini_files', $iniFiles );
 $tpl->setVariable( 'siteaccess_list', $siteAccessList );
Index: kernel/visual/menuconfig.php
===================================================================
--- kernel/visual/menuconfig.php	(revision 22202)
+++ kernel/visual/menuconfig.php	(working copy)
@@ -66,7 +66,7 @@
 // Get path to specified site access.
 $pathToSiteAccess = eZSiteAccess::findPathToSiteAccess( $siteAccess );
 $menuINI = eZINI::instance( "menu.ini", "", null, null, true );
-$menuINI->prependOverrideDir( $pathToSiteAccess, true, 'siteaccess' );
+$menuINI->prependOverrideDir( $pathToSiteAccess, true, 'siteaccess', 'siteaccess' );
 $menuINI->loadCache();
 
 /*$iniPath = "settings/siteaccess/$siteAccess";
Index: kernel/visual/templatecreate.php
===================================================================
--- kernel/visual/templatecreate.php	(revision 22202)
+++ kernel/visual/templatecreate.php	(working copy)
@@ -51,7 +51,7 @@
 $siteBase = $siteAccess;
 
 $siteINI = eZINI::instance( 'site.ini', 'settings', null, null, true );
-$siteINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+$siteINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
 $siteINI->loadCache();
 $siteDesign = $siteINI->variable( "DesignSettings", "SiteDesign" );
 
@@ -153,7 +153,7 @@
 
             // Store override.ini.append file
             $overrideINI = eZINI::instance( 'override.ini', 'settings', null, null, true );
-            $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+            $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
             $overrideINI->loadCache();
 
             $templateFile = preg_replace( "#^/(.*)$#", "\\1", $template );
Index: kernel/visual/templateview.php
===================================================================
--- kernel/visual/templateview.php	(revision 22202)
+++ kernel/visual/templateview.php	(working copy)
@@ -81,7 +81,7 @@
 
         // Load override.ini for the current siteaccess
         $overrideINI = eZINI::instance( 'override.ini', 'settings', null, null, true );
-        $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+        $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
         $overrideINI->loadCache();
 
         asort( $priorityArray );
@@ -117,11 +117,11 @@
 
         // Load override.ini for the current siteaccess
         $overrideINI = eZINI::instance( 'override.ini', 'settings', null, null, true );
-        $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+        $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
         $overrideINI->loadCache();
 
         $siteINI = eZINI::instance( 'site.ini', 'settings', null, null, true );
-        $siteINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
+        $siteINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess', 'siteaccess' );
         $siteINI->loadCache();
         $siteBase = $siteINI->variable( 'DesignSettings', 'SiteDesign' );
 
Index: kernel/visual/toolbar.php
===================================================================
--- kernel/visual/toolbar.php	(revision 22202)
+++ kernel/visual/toolbar.php	(working copy)
@@ -364,7 +364,7 @@
 }
 
 $toolbarIni = eZINI::instance( "toolbar.ini", 'settings', null, false, true, false );
-$toolbarIni->prependOverrideDir( "siteaccess/$currentSiteAccess", false, 'siteaccess' );
+$toolbarIni->prependOverrideDir( "siteaccess/$currentSiteAccess", false, 'siteaccess', 'siteaccess' );
 $toolbarIni->parse();
 
 if ( $toolbarIni->hasVariable( "Tool", "AvailableToolArray" ) )
Index: kernel/visual/toolbarlist.php
===================================================================
--- kernel/visual/toolbarlist.php	(revision 22202)
+++ kernel/visual/toolbarlist.php	(working copy)
@@ -59,7 +59,7 @@
 }
 
 $toolbarIni = eZINI::instance( "toolbar.ini", null, null, null, true );
-$toolbarIni->prependOverrideDir( "siteaccess/$currentSiteAccess", false, 'siteaccess' );
+$toolbarIni->prependOverrideDir( "siteaccess/$currentSiteAccess", false, 'siteaccess', 'siteaccess' );
 $toolbarIni->loadCache();
 
 if ( $toolbarIni->hasVariable( "Toolbar", "AvailableToolBarArray" ) )
Index: lib/ezutils/classes/ezextension.php
===================================================================
--- lib/ezutils/classes/ezextension.php	(revision 22202)
+++ lib/ezutils/classes/ezextension.php	(working copy)
@@ -54,9 +54,12 @@
     */
     static function baseDirectory()
     {
-        $ini = eZINI::instance();
-        $extensionDirectory = $ini->variable( 'ExtensionSettings', 'ExtensionDirectory' );
-        return $extensionDirectory;
+        if ( self::$extensionBaseDirectory === null )
+        {
+            $ini = eZINI::instance();
+            self::$extensionBaseDirectory = $ini->variable( 'ExtensionSettings', 'ExtensionDirectory' );
+        }
+        return self::$extensionBaseDirectory;
     }
 
     /*!
@@ -70,24 +73,22 @@
      Default extensions are those who are loaded before a siteaccess are determined while access extensions
      are loaded after siteaccess is set.
     */
-    static function activeExtensions( $extensionType = false )
+    static function activeExtensions( $extensionType = false, $siteINI = false  )
     {
-        $ini = eZINI::instance();
+        if ( !$siteINI instanceof eZINI )
+        {
+            $siteINI = eZINI::instance();
+        }
         $activeExtensions = array();
-        if ( !$extensionType or
-             $extensionType == 'default' )
+        if ( $extensionType === false or
+             $extensionType === 'default' )
             $activeExtensions = array_merge( $activeExtensions,
-                                             $ini->variable( 'ExtensionSettings', 'ActiveExtensions' ) );
-        if ( !$extensionType or
-             $extensionType == 'access' )
+                                             $siteINI->variable( 'ExtensionSettings', 'ActiveExtensions' ) );
+        if ( $extensionType === false or
+             $extensionType === 'access' )
             $activeExtensions = array_merge( $activeExtensions,
-                                             $ini->variable( 'ExtensionSettings', 'ActiveAccessExtensions' ) );
-        $globalActiveExtensions =& $GLOBALS['eZActiveExtensions'];
-        if ( isset( $globalActiveExtensions ) )
-        {
-            $activeExtensions = array_merge( $activeExtensions,
-                                             $globalActiveExtensions );
-        }
+                                             $siteINI->variable( 'ExtensionSettings', 'ActiveAccessExtensions' ) );
+
         $activeExtensions = array_unique( $activeExtensions );
         return $activeExtensions;
     }
@@ -97,32 +98,69 @@
      Will make sure that all extensions that has settings directories
      are added to the eZINI override list.
     */
-    static function activateExtensions( $extensionType = false )
+    static function activateExtensions( $extensionType = false, $siteINI = false, $accessName = false, $loadedExtension = array() )
     {
         $extensionDirectory = eZExtension::baseDirectory();
-        $activeExtensions = eZExtension::activeExtensions( $extensionType );
-        $hasExtensions = false;
-        $ini = eZINI::instance();
-        foreach ( $activeExtensions as $activeExtension )
+        $extensionSettingsPaths = eZExtension::getCachedPaths('settings');
+        if ( !$siteINI instanceof eZINI )
         {
-            if ( !file_exists( $extensionDirectory . '/' . $activeExtension ) )
-            {
-                eZDebug::writeWarning( "Extension '$activeExtension' does not exist, looked for directory '" . $extensionDirectory . '/' . $activeExtension . "'" );
-            }
-            $extensionSettingsPath = $extensionDirectory . '/' . $activeExtension . '/settings';
-            if ( file_exists( $extensionSettingsPath ) )
+            $siteINI = eZINI::instance();
+        }
+        if ( $accessName === false && isset( $GLOBALS['eZCurrentAccess'] ) )
+        {
+            $accessName = $GLOBALS['eZCurrentAccess']['name'];
+        }
+        do
+        {
+            $newExtensionsLoaded = false;
+            $activeExtensions = eZExtension::activeExtensions( $extensionType, $siteINI );
+            foreach ( $activeExtensions as $activeExtension )
             {
-                $ini->prependOverrideDir( $extensionSettingsPath, true );
-
-                if ( isset( $GLOBALS['eZCurrentAccess'] ) )
+                // check if extension is already loaded
+                if ( isset( $loadedExtension[$activeExtension] ) )
+                {
+                    continue;
+                }
+                // check if settings folder exist
+                $extensionSettingsPath = $extensionDirectory . '/' . $activeExtension . '/settings';
+                if ( in_array( $extensionSettingsPath, $extensionSettingsPaths ) )
+                {
+                    // prepend settings folder
+                    if ( $siteINI->prependOverrideDir( $extensionSettingsPath, true, 'extension:' . $activeExtension, 'extension' ) )
+                    {
+                        // set to true if this dir whern't already loaded
+                        $newExtensionsLoaded = true;
+                    }
+                    // prepend extenion/settings/siteaccess if accessName is set
+                    if ( $accessName !== false )
+                    {
+                        eZExtension::prependSiteAccess( $activeExtension, $accessName, $siteINI, true, 'ext-siteaccess:'. $activeExtension );
+                    }
+                    // prepend extenion/settings/override if it exists
+                    if ( in_array( $extensionSettingsPath . '/override', $extensionSettingsPaths ) )
+                    {
+                         $siteINI->prependOverrideDir( $extensionSettingsPath . '/override', true, 'ext-override:' . $activeExtension, 'extension-override' );
+                    }
+                }
+                // check if extenion exist, if not write a warning
+                else if ( !file_exists( $extensionDirectory . '/' . $activeExtension ) )
                 {
-                    eZExtension::prependSiteAccess( $activeExtension );
+                    eZDebug::writeWarning( "Extension '$activeExtension' does not exist, looked for directory '" . $extensionDirectory . '/' . $activeExtension . "'" );
                 }
-                $hasExtensions = true;
+                else
+                {
+                    eZDebug::writeWarning( "Extension '$activeExtension' does exist, but is not loaded because extension dir cache is not cleared." );
+                }
+                // mark extenion as loaded to avoid the code above if extension is defined several places
+                $loadedExtension[$activeExtension] = true;
             }
-        }
-        if ( $hasExtensions )
-            $ini->loadCache();
+            // re load ini cache if any new extenions where loaded
+            if ( $newExtensionsLoaded )
+            {
+                $siteINI->loadCache();
+            }
+        } while ( $newExtensionsLoaded );
+        return $loadedExtension;
     }
 
     /*!
@@ -143,7 +181,7 @@
 
         foreach( $extensionList as $extension )
         {
-            eZExtension::prependSiteAccess( $extension, $accessName, $ini, $globalDir, $identifier );
+            eZExtension::prependSiteAccess( $extension, $accessName, $ini, $globalDir, 'ext-siteaccess:'. $extension );
         }
     }
 
@@ -162,14 +200,19 @@
         }
 
         $extensionSettingsPath = eZExtension::baseDirectory() . '/' . $extension;
+        $dirList = eZExtension::getCachedPaths('settings');
 
-        if ( file_exists ( $extensionSettingsPath . '/settings/siteaccess/' . $accessName ) )
+        if ( in_array( $extensionSettingsPath . '/settings/siteaccess/' . $accessName, $dirList ) )
         {
-            if ( !$ini )
+            if ( !$ini instanceof eZINI )
             {
                 $ini = eZINI::instance();
             }
-            $ini->prependOverrideDir( $extensionSettingsPath . '/settings/siteaccess/' . $accessName, $globalDir );
+            if ( in_array( $extensionSettingsPath . '/settings/siteaccess-override', $dirList ) )
+            {
+                $ini->prependOverrideDir( $extensionSettingsPath . '/settings/siteaccess-override', $globalDir, 'ext-siteaccess-override:' . $extension, 'extension-siteaccess-override' );
+            }
+            $ini->prependOverrideDir( $extensionSettingsPath . '/settings/siteaccess/' . $accessName, $globalDir, $identifier, 'extension-siteaccess' );
         }
     }
 
@@ -278,12 +321,13 @@
                 $repositoryDirectory .= '/' . $subdir;
             $repositoryDirectoryList[] = $repositoryDirectory;
         }
+        $extensionHandlerPaths = eZExtension::getCachedPaths( 'handlers' );
         foreach ( $extensionDirectories as $extensionDirectory )
         {
             $extensionPath = $baseDirectory . '/' . $extensionDirectory;
             if ( $extensionSubdir != '' )
                 $extensionPath .= '/' . $extensionSubdir;
-            if ( file_exists( $extensionPath ) )
+            if ( in_array( $extensionPath, $extensionHandlerPaths ) || file_exists( $extensionPath ) )
             {
                 $repositoryDirectoryList[] = $extensionPath;
             }
@@ -384,6 +428,45 @@
             return false;
     }
 
+    static function getCachedPaths( $type = false )
+    {
+        if ( self::$extensionDirPaths === null )
+        {
+            //include_once( 'lib/ezutils/classes/ezphpcreator.php' );
+            $cacheDir = eZSys::cacheDirectory();
+            $phpCache = new eZPHPCreator( $cacheDir, 'extension_dirs.php' );
+        
+            if ( $phpCache->canRestore() )
+            {
+                $var = $phpCache->restore( array( 'directoryList' => 'directoryList' ) );
+                self::$extensionDirPaths = $var['directoryList'];
+            }
+            else
+            {
+                // get extension dirs using glob    
+                self::$extensionDirPaths = array();
+                self::$extensionDirPaths['modules'] = glob( 'extension/*/modules', GLOB_ONLYDIR );
+                self::$extensionDirPaths['modules'] = array_merge( self::$extensionDirPaths['modules'], glob( 'extension/*/modules/*', GLOB_ONLYDIR ) );
+                self::$extensionDirPaths['modules'] = array_merge( self::$extensionDirPaths['modules'], glob( 'extension/*/modules/*/module.php' ) );
+                self::$extensionDirPaths['handlers'] = glob( 'extension/*/*', GLOB_ONLYDIR );
+                self::$extensionDirPaths['settings'] = glob( 'extension/*/settings', GLOB_ONLYDIR );
+                self::$extensionDirPaths['settings'] = array_merge( self::$extensionDirPaths['settings'], glob( 'extension/*/settings/override', GLOB_ONLYDIR ) );
+                self::$extensionDirPaths['settings'] = array_merge( self::$extensionDirPaths['settings'], glob( 'extension/*/settings/siteaccess/*', GLOB_ONLYDIR ) );
+                self::$extensionDirPaths['settings'] = array_merge( self::$extensionDirPaths['settings'], glob( 'extension/*/settings/siteaccess-override', GLOB_ONLYDIR ) );
+        
+                // Store array to cache file
+                $phpCache->addVariable( 'directoryList', self::$extensionDirPaths );
+                $phpCache->store();
+            }
+        }
+        if ( $type === false )
+            return self::$extensionDirPaths;
+        return self::$extensionDirPaths[ $type ];
+    }
+    
+    static protected $extensionDirPaths = null;
+    static protected $extensionBaseDirectory = null;
+
 }
 
 ?>
Index: lib/ezutils/classes/ezini.php
===================================================================
--- lib/ezutils/classes/ezini.php	(revision 22202)
+++ lib/ezutils/classes/ezini.php	(working copy)
@@ -107,9 +107,14 @@
         $this->UseLocalOverrides = $useLocalOverrides;
         $this->AddArrayDefinition = $addArrayDefinition;
 
+        if ( self::$GlobalOverrideDirArray === null )
+        {
+            self::$GlobalOverrideDirArray = self::defaultOverrideDirs();
+        }
+
         if ( $this->UseLocalOverrides == true )
         {
-            $this->LocalOverrideDirArray = $GLOBALS["eZINIOverrideDirList"];
+            $this->LocalOverrideDirArray = self::$GlobalOverrideDirArray;
         }
 
         $this->load();
@@ -939,24 +944,77 @@
     to the eZ Publish root directory.
     The third value of the array will contain the identifier of the override, if it exists.
     Identifiers are useful if you want to overwrite the current override setting.
+    
+    /param $scope lets you get a specific part of the override dirs, or all as raw data if $scope === false
+     see defaultOverrideDirs() for how the raw data look like
+    */
+    function overrideDirs( $scope = null )
+    {
+        if ( $this->UseLocalOverrides == true )
+            $dirs = $this->LocalOverrideDirArray;
+        else
+            $dirs = self::$GlobalOverrideDirArray;
+
+        if ( $scope !== null )
+        {
+            if ( $scope === false )
+                return $dirs;
+            if ( isset( $dirs[$scope] ) )
+                return $dirs[$scope];
+            eZDebug::writeWarning( "Undefined override dir scope: '$scope'", 'eZINI::overrideDirs' );
+        }
+
+        return array_merge( $dirs['prepended'], $dirs['extension'], $dirs['extension-siteaccess'], $dirs['siteaccess'], $dirs['extension-siteaccess-override'], $dirs['extension-override'], $dirs['override']  );
+    }
+
+    /*!
+     \set the override directories witch raw override dir data, or within a scope if $scope is set
+     see defaultOverrideDirs() for how the raw data look like
     */
-    function overrideDirs()
+    function setOverrideDirs( $newDir, $scope = false )
     {
         if ( $this->UseLocalOverrides == true )
             $dirs =& $this->LocalOverrideDirArray;
         else
-            $dirs =& $GLOBALS["eZINIOverrideDirList"];
+            $dirs =& self::$GlobalOverrideDirArray;
 
-        if ( !isset( $dirs ) or !is_array( $dirs ) )
-            $dirs = array( array( "override", false, false ) );
-        return $dirs;
+        if ( $scope === false )
+            $dirs = $newDir;
+        else if ( isset( $dirs[$scope] ) )
+            $dirs[$scope] = $newDir;
+        else
+            eZDebug::writeWarning( "Undefined override dir scope: '$scope'", 'eZINI::setOverrideDirs' );
+    }
+
+    /*!
+     \return the default override directories as raw array data
+    */
+    static public function defaultOverrideDirs( )
+    {
+        return array(
+                'prepended' => array(),
+                'extension' => array(),
+                'extension-siteaccess' => array(),
+                'siteaccess' => array(),
+                'extension-siteaccess-override' => array(),
+                'extension-override' => array(),
+                'override' => array( array( 'override', false, false ) )
+            );
+    }
+
+    /*!
+     \reset the global override directories with data from defaultOverrideDirs()
+    */
+    static public function resetGlobalOverrideDirs()
+    {
+        self::$GlobalOverrideDirArray = self::defaultOverrideDirs();
     }
 
     /*!
      Appends the override directory \a $dir to the override directory list.
      If global dir is set top
     */
-    function prependOverrideDir( $dir, $globalDir = false, $identifier = false )
+    function prependOverrideDir( $dir, $globalDir = false, $identifier = false, $scope = 'prepended' )
     {
         if ( eZINI::isDebugEnabled() )
             eZDebug::writeNotice( "Changing override dir to '$dir'", "eZINI" );
@@ -964,36 +1022,40 @@
         if ( $this->UseLocalOverrides == true )
             $dirs =& $this->LocalOverrideDirArray;
         else
-            $dirs =& $GLOBALS["eZINIOverrideDirList"];
+            $dirs =& self::$GlobalOverrideDirArray;
 
-        if ( !isset( $dirs ) or !is_array( $dirs ) )
-            $dirs = array( array( 'override', false, false ) );
+        if ( !isset( $dirs[$scope] ) )
+        {
+            eZDebug::writeWarning( "Undefined override dir scope: '$scope' with dir: '$dir'", 'eZINI::prependOverrideDir' );
+            $scope = 'prepended';
+        }
 
         // Check if the override with the current identifier already exists
         $overrideOverwritten = false;
         if ( $identifier !== false )
         {
-            foreach ( array_keys( $dirs ) as $dirKey )
+            foreach ( $dirs[$scope] as $dirKey => $dirValue )
             {
-                if ( $dirs[$dirKey][2] == $identifier )
+                if ( $dirs[$scope][$dirKey][2] === $identifier )
                 {
-                    $dirs[$dirKey][0] = $dir;
-                    $dirs[$dirKey][1] = $globalDir;
+                    $dirs[$scope][$dirKey][0] = $dir;
+                    $dirs[$scope][$dirKey][1] = $globalDir;
                     $overrideOverwritten = true;
                 }
             }
         }
 
-        if ( $overrideOverwritten == false )
-            $dirs = array_merge( array( array( $dir, $globalDir, $identifier ) ), $dirs );
+        if ( $overrideOverwritten === false )
+            $dirs[$scope] = array_merge( array( array( $dir, $globalDir, $identifier ) ), $dirs[$scope] );
 
         $this->CacheFile = false;
+        return $overrideOverwritten === false;
      }
 
     /*!
      Appends the override directory \a $dir to the override directory list.
     */
-    function appendOverrideDir( $dir, $globalDir = false, $identifier = false )
+    function appendOverrideDir( $dir, $globalDir = false, $identifier = false, $scope = 'override' )
     {
         if ( eZINI::isDebugEnabled() )
             eZDebug::writeNotice( "Changing override dir to '$dir'", "eZINI" );
@@ -1001,29 +1063,33 @@
         if ( $this->UseLocalOverrides == true )
             $dirs =& $this->LocalOverrideDirArray;
         else
-            $dirs =& $GLOBALS["eZINIOverrideDirList"];
+            $dirs =& self::$GlobalOverrideDirArray;
 
-        if ( !isset( $dirs ) or !is_array( $dirs ) )
-            $dirs = array( 'override', false, false );
+        if ( !isset( $dirs[$scope] ) )
+        {
+            eZDebug::writeWarning( "Undefined override dir scope: '$scope' with dir: '$dir'", 'eZINI::appendOverrideDir' );
+            $scope = 'override';
+        }
 
         // Check if the override with the current identifier already exists
         $overrideOverwritten = false;
         if ( $identifier !== false )
         {
-            foreach ( array_keys( $dirs ) as $dirKey )
+            foreach ( $dirs[$scope] as $dirKey => $dirValue )
             {
-                if ( $dirs[$dirKey][2] == $identifier )
+                if ( $dirs[$scope][$dirKey][2] === $identifier )
                 {
-                    $dirs[$dirKey][0] = $dir;
-                    $dirs[$dirKey][1] = $globalDir;
+                    $dirs[$scope][$dirKey][0] = $dir;
+                    $dirs[$scope][$dirKey][1] = $globalDir;
                     $overrideOverwritten = true;
                 }
             }
         }
 
-        if ( $overrideOverwritten == false )
-            $dirs[] = array( $dir, $globalDir, $identifier = false );
+        if ( $overrideOverwritten === false )
+            $dirs[$scope][] = array( $dir, $globalDir, $identifier );
         $this->CacheFile = false;
+        return $overrideOverwritten === false;
     }
 
     /*!
@@ -1245,14 +1311,23 @@
             break;
             case 4:
             {
-                $placement = 'siteaccess';
-                if ( $exploded[0] == 'extension' )
+                if ( $exploded[0] === 'extension' )
                     $placement = 'extension:' . $exploded[1];
+                else
+                    $placement = 'siteaccess';
+            }
+            break;
+            case 5:
+            {
+                if ( $exploded[3] === 'override' )
+                    $placement = 'ext-override:' . $exploded[1];
+                else
+                    $placement = 'ext-siteaccess-override:' . $exploded[1];
             }
             break;
             case 6:
             {
-                $placement = 'ext-siteaccess:' . $exploded[4];
+                $placement = 'ext-siteaccess:' . $exploded[1];
             }
             break;
             default:
@@ -1468,6 +1543,9 @@
     /// Contains the override dirs, if in local mode
     public $LocalOverrideDirArray;
 
+    /// Contains global override dirs
+    static protected $GlobalOverrideDirArray = null;
+
     /// If \c true then all file loads are done directly on the filename.
     public $DirectAccess;
 
Index: lib/ezutils/classes/ezmodule.php
===================================================================
--- lib/ezutils/classes/ezmodule.php	(revision 22202)
+++ lib/ezutils/classes/ezmodule.php	(working copy)
@@ -49,9 +49,9 @@
     const HOOK_STATUS_CANCEL_RUN = 1;
     const HOOK_STATUS_FAILED = 2;
 
-    function eZModule( $path, $file, $moduleName )
+    function eZModule( $path, $file, $moduleName, $checkExistence = true )
     {
-        $this->initialize( $path, $file, $moduleName );
+        $this->initialize( $path, $file, $moduleName, $checkExistence );
     }
 
     /*!
@@ -61,9 +61,9 @@
      of that file, it will then assume that some variables were set
      which defines the module and it's view/functions.
     */
-    function initialize( $path, $file, $moduleName )
+    function initialize( $path, $file, $moduleName, $checkExistence = true )
     {
-        if ( file_exists( $file ) )
+        if ( $checkExistence === false  || file_exists( $file ) )
         {
             unset( $FunctionList );
             unset( $Module );
@@ -1300,28 +1300,34 @@
             $extensionRepositories = $moduleINI->variable( 'ModuleSettings', 'ExtensionRepositories' );
             $extensionDirectory = eZExtension::baseDirectory();
             $activeExtensions = eZExtension::activeExtensions();
+            $extensionModulePaths = eZExtension::getCachedPaths('modules');
             $globalExtensionRepositories = array();
 
             foreach ( $extensionRepositories as $extensionRepository )
             {
                 $extPath = $extensionDirectory . '/' . $extensionRepository;
                 $modulePath = $extPath . '/modules';
-                if ( file_exists( $modulePath ) )
+                if ( !in_array( $extensionRepository, $activeExtensions ) )
+                {
+                    eZDebug::writeWarning( "Extension '$extensionRepository' was reported to have modules but has not yet been activated.\n" .
+                                           "Check the setting ModuleSettings/ExtensionRepositories in module.ini for your extensions\n" .
+                                           "or make sure it is activated in the setting ExtensionSettings/ActiveExtensions in site.ini." );
+                }
+                else if ( in_array( $modulePath, $extensionModulePaths ) )
                 {
                     $globalExtensionRepositories[] = $modulePath;
                 }
+                else if ( file_exists( $modulePath ) )
+                {
+                    $globalExtensionRepositories[] = $modulePath;
+                    eZDebug::writeWarning( 'Extension "' . $extensionRepository . ' where activated but extension dir cache does not seem to be cleared.' );
+                }
                 else if ( !file_exists( $extPath ) )
                 {
                     eZDebug::writeWarning( "Extension '$extensionRepository' was reported to have modules but the extension itself does not exist.\n" .
                                            "Check the setting ModuleSettings/ExtensionRepositories in module.ini for your extensions.\n" .
                                            "You should probably remove this extension from the list." );
                 }
-                else if ( !in_array( $extensionRepository, $activeExtensions ) )
-                {
-                    eZDebug::writeWarning( "Extension '$extensionRepository' was reported to have modules but has not yet been activated.\n" .
-                                           "Check the setting ModuleSettings/ExtensionRepositories in module.ini for your extensions\n" .
-                                           "or make sure it is activated in the setting ExtensionSettings/ActiveExtensions in site.ini." );
-                }
                 else
                 {
                     eZDebug::writeWarning( "Extension '$extensionRepository' does not have the subdirectory 'modules' allthough it reported it had modules.\n" .
@@ -1408,6 +1414,7 @@
         if ( $searchPathList === null )
             $searchPathList = array();
         $searchPathList = array_merge( $searchPathList, $pathList );
+        $extensionModulePaths = eZExtension::getCachedPaths('modules');
         $triedList = array();
         $triedDirList = array();
         $foundADir = false;
@@ -1415,15 +1422,15 @@
         {
             $dir = "$path/$moduleName";
             $file = "$dir/module.php";
-            if ( file_exists( $file ) )
+            if ( in_array( $file, $extensionModulePaths ) || ( $path === 'kernel' && file_exists( $file ) ) )
             {
                 if ( $module === null )
-                    $module = new eZModule( $path, $file, $moduleName );
+                    $module = new eZModule( $path, $file, $moduleName, false );
                 else
-                    $module->initialize( $path, $file, $moduleName );
+                    $module->initialize( $path, $file, $moduleName, false );
                 return $module;
             }
-            else if ( !file_exists( $dir ) )
+            else if (  !in_array( $dir, $extensionModulePaths ) || ( $path === 'kernel' && !file_exists( $dir ) ) )
             {
                 $triedDirList[] = $dir;
             }
Index: soap.php
===================================================================
--- soap.php	(revision 22202)
+++ soap.php	(working copy)
@@ -83,6 +83,9 @@
 // Check for activating Debug by user ID (Final checking. The first was in eZDebug::updateSettings())
 eZDebug::checkDebugByUser();
 
+// Check for new extension loaded by siteaccess
+eZExtension::activateExtensions( );
+
 /*!
  Reads settings from i18n.ini and passes them to eZTextCodec.
 */
Index: webdav.php
===================================================================
--- webdav.php	(revision 22202)
+++ webdav.php	(working copy)
@@ -163,6 +163,9 @@
         {
             $server->setCurrentSite( $currentSite );
 
+            // Check for new extension loaded by siteaccess
+            eZExtension::activateExtensions( );
+
             $loginUsername = "";
             // Get the username and the password.
             if ( eZHTTPTool::username() )
