Index: access.php
===================================================================
--- access.php	(revision 22528)
+++ access.php	(working copy)
@@ -284,7 +284,7 @@
  \return the \a $access parameter.
 */
 
-function changeAccess( $access )
+function changeAccess( $access, $prependExtensionSiteAccesses = true )
 {
     $ini = eZINI::instance();
 
@@ -299,11 +299,14 @@
 
     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 */
-    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 22528)
+++ index.php	(working copy)
@@ -373,8 +373,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 22528)
+++ index_treemenu.php	(working copy)
@@ -105,6 +105,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 22528)
+++ kernel/classes/ezcache.php	(working copy)
@@ -84,6 +84,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',
@@ -456,6 +462,23 @@
     /*!
      \private
      \static
+     Clears all ini and module directory cache from var/cache.
+    */
+    static function clearExtensionDirs( $cacheItem )
+    {
+        $cachePath = eZSys::cacheDirectory();
+
+        // VS-DBFILE
+
+        $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 22528)
+++ kernel/classes/ezcontentcachemanager.php	(working copy)
@@ -791,7 +791,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 22528)
+++ kernel/classes/ezscript.php	(working copy)
@@ -261,8 +261,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 22528)
+++ kernel/classes/packagehandlers/ezcontentobject/ezcontentobjectpackagehandler.php	(working copy)
@@ -434,7 +434,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 )
@@ -596,7 +596,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;
@@ -1233,7 +1233,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 22528)
+++ kernel/classes/packagehandlers/eziniaddon/eziniaddonpackagehandler.php	(working copy)
@@ -72,7 +72,7 @@
         $filename = $content->getAttribute( 'filename' );
 
         $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 22528)
+++ kernel/common/eztemplatedesignresource.php	(working copy)
@@ -580,12 +580,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();
 
@@ -601,8 +601,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";
             }
@@ -674,7 +674,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();
 
@@ -774,7 +774,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 22528)
+++ kernel/content/versionview.php	(working copy)
@@ -38,8 +38,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' );
@@ -123,8 +121,6 @@
     }
 }
 
-$contentINI = eZINI::instance( 'content.ini' );
-
 if ( $Module->isCurrentAction( 'ChangeSettings' ) )
 {
     if ( $Module->hasActionParameter( 'Language' ) )
@@ -235,9 +231,9 @@
     return;
 }
 
-$contentINI = eZINI::instance( 'content.ini' );
 if ( !$siteAccess )
 {
+    $contentINI = eZINI::instance( 'content.ini' );
     if ( $contentINI->hasVariable( 'VersionView', 'DefaultPreviewDesign' ) )
     {
         $siteAccess = $contentINI->variable( 'VersionView', 'DefaultPreviewDesign' );
@@ -248,18 +244,22 @@
     }
 }
 
-$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;
 eZContentObject::clearCache();
@@ -289,7 +289,7 @@
 $res->setKeys( $designKeys );
 
 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 22528)
+++ kernel/settings/edit.php	(working copy)
@@ -199,12 +199,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 ) : '';
@@ -217,17 +217,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 22528)
+++ kernel/settings/view.php	(working copy)
@@ -56,7 +56,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();
     }
 
@@ -105,68 +105,14 @@
 if ( $http->hasPostVariable( 'ChangeINIFile' ) or
      ( $Params['SiteAccess'] and $Params['INIFile'] ) )
 {
-    /*
-        To get the right INIOverrideDirList we have do do something
+    $ini = eZINI::instance( $settingFile, 'settings', null, false, true);
 
-        1. We delete all entry how are related to the admin siteaccess which want to diplay an ini setting from another siteaccess
-        2. We load the new site.ini to get all extensionNames for the choosen siteaccess
-        3. We add all this extensions to the overrideDirList
-        4. create ini for displaying
-    */
-    // $currentSiteAccess = choosen sitaccess to display selected ini
+    // If a different siteaccess is selected, then we need to load override dirs for that siteaccess
     if ( $GLOBALS['eZCurrentAccess']['name'] != $currentSiteAccess )
     {
-        // 1. delete all entry which are related to the old siteaccess
-        $newINIOverrideDirList = array();
-        foreach ( array_reverse( $GLOBALS['eZINIOverrideDirList'] ) as $dir )
-        {
-            $path = $dir[0];
-            if ( strpos( $path, 'siteaccess' ) !== false )
-            {
-                break;
-            }
-            else
-            {
-                $newINIOverrideDirList[] = $dir;
-            }
-        }
-        $iniOverrideDirListWithoutSiteaccess = array_reverse( $newINIOverrideDirList );
-
-        $GLOBALS['eZINIOverrideDirList'] = $iniOverrideDirListWithoutSiteaccess;
-
-        // normal siteaccess
-        if( file_exists( "settings/siteaccess/$currentSiteAccess" ) )
-        {
-            $GLOBALS['eZINIOverrideDirList'] = array_merge( array( array( "siteaccess/$currentSiteAccess", false, 'siteaccess' ) ) , $GLOBALS['eZINIOverrideDirList'] );
-        }
-        // extension sitaccess
-        else
-        {
-            eZExtension::prependExtensionSiteAccesses( $currentSiteAccess, false, true, 'siteaccess' );
-        }
-
-        // 2. create site.ini for the new siteaccess
-        $newSiteIni = eZINI::create( 'site.ini', 'settings', null, null, false );
-
-        // 3. load all extension which are activated in the sitaccess
-        $newActiveAccessExtensions = $newSiteIni->variable( 'ExtensionSettings', 'ActiveAccessExtensions' );
-        $activeExtensionOverrideDirList = array();
-        foreach ( array_reverse( $newActiveAccessExtensions ) as $extensionName )
-        {
-            $activeExtensionOverrideDirList[] = array( "extension/$extensionName/settings" , true, false );
-        }
-        $siteAccessOverrideDirListSetting = array_shift( $GLOBALS['eZINIOverrideDirList'] );
-
-        array_push( $activeExtensionOverrideDirList, $siteAccessOverrideDirListSetting );
-        $GLOBALS['eZINIOverrideDirList'] = array_merge( $activeExtensionOverrideDirList, $GLOBALS['eZINIOverrideDirList'] );
-
-        // now we have the right order for the overideDirList :-)
+        loadAccessSettings( $currentSiteAccess, $ini );
     }
 
-    // 4. create ini for displaying
-    // create ini data with empty array definition so that count( placement array ) = count( ini files )
-    $ini = new eZINI( $settingFile,'settings', null, false, null, false, true );
-
     $blocks = $ini->groups();
     $placements = $ini->groupPlacements();
     $settings = array();
@@ -178,7 +124,7 @@
         $settingsCount = 0;
         $blockRemoveable = false;
         $blockEditable = true;
-        foreach( $key as $setting=>$settingKey )
+        foreach( $key as $setting => $settingKey )
         {
             $hasSetPlacement = false;
             $type = $ini->settingType( $settingKey );
@@ -190,7 +136,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 )
@@ -271,8 +217,11 @@
 $rootDir = 'settings';
 $iniFiles = eZDir::recursiveFindRelative( $rootDir, '', '.ini' );
 
+if ( !isset( $ini ) )
+    $ini = eZINI::instance();
+
 // find all .ini files in active extensions
-foreach ( $GLOBALS['eZINIOverrideDirList'] as $iniDataSet )
+foreach ( $ini->overrideDirs() as $iniDataSet )
 {
     $rootDir = $iniDataSet[0];
     $iniFiles = array_merge( $iniFiles, eZDir::recursiveFindRelative( $rootDir, '', '.ini' ) );
@@ -281,6 +230,7 @@
 // extract all .ini files without path
 $iniFiles = preg_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 22528)
+++ kernel/visual/menuconfig.php	(working copy)
@@ -62,7 +62,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 22528)
+++ kernel/visual/templatecreate.php	(working copy)
@@ -47,7 +47,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" );
 
@@ -147,7 +147,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 22528)
+++ kernel/visual/templateview.php	(working copy)
@@ -78,7 +78,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 );
@@ -114,11 +114,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 22528)
+++ kernel/visual/toolbar.php	(working copy)
@@ -360,7 +360,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 22528)
+++ kernel/visual/toolbarlist.php	(working copy)
@@ -57,7 +57,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 22528)
+++ lib/ezutils/classes/ezextension.php	(working copy)
@@ -52,9 +52,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;
     }
 
     /*!
@@ -68,24 +71,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;
     }
@@ -95,32 +96,67 @@
      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 )
+            $siteINI = eZINI::instance();
+
+        if ( $accessName === false && isset( $GLOBALS['eZCurrentAccess'] ) )
+            $accessName = $GLOBALS['eZCurrentAccess']['name'];
+
+        do
         {
-            $extensionSettingsPath = $extensionDirectory . '/' . $activeExtension . '/settings';
-            if ( file_exists( $extensionSettingsPath ) )
+            $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] ) )
                 {
-                    eZExtension::prependSiteAccess( $activeExtension );
+                    continue;
                 }
-                $hasExtensions = true;
+                // 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 ) )
+                {
+                    eZDebug::writeWarning( "Extension '$activeExtension' does not exist, looked for directory '" . $extensionDirectory . '/' . $activeExtension . "'" );
+                }
+                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;
             }
-            else if ( !file_exists( $extensionDirectory . '/' . $activeExtension ) )
+            // re load ini cache if any new extenions where loaded
+            if ( $newExtensionsLoaded )
             {
-                eZDebug::writeWarning( "Extension '$activeExtension' does not exist, looked for directory '" . $extensionDirectory . '/' . $activeExtension . "'" );
+                $siteINI->loadCache();
             }
-        }
-        if ( $hasExtensions )
-            $ini->loadCache();
+        } while ( $newExtensionsLoaded );
+        return $loadedExtension;
     }
 
     /*!
@@ -141,7 +177,7 @@
 
         foreach( $extensionList as $extension )
         {
-            eZExtension::prependSiteAccess( $extension, $accessName, $ini, $globalDir, $identifier );
+            eZExtension::prependSiteAccess( $extension, $accessName, $ini, $globalDir, 'ext-siteaccess:'. $extension );
         }
     }
 
@@ -160,14 +196,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' );
         }
     }
 
@@ -276,12 +317,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;
             }
@@ -380,6 +422,44 @@
             return false;
     }
 
+    static function getCachedPaths( $type = false )
+    {
+        if ( self::$extensionDirPaths === null )
+        {
+            $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 22528)
+++ lib/ezutils/classes/ezini.php	(working copy)
@@ -123,9 +123,14 @@
                 self::$checkFileMtime = true;
         }
 
+        if ( self::$GlobalOverrideDirArray === null )
+        {
+            self::$GlobalOverrideDirArray = self::defaultOverrideDirs();
+        }
+
         if ( $this->UseLocalOverrides == true )
         {
-            $this->LocalOverrideDirArray = $GLOBALS["eZINIOverrideDirList"];
+            $this->LocalOverrideDirArray = self::$GlobalOverrideDirArray;
         }
 
         if ( defined( 'EZP_INI_FILE_PERMISSION' ) )
@@ -972,24 +977,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()
+    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['siteaccess'], $dirs['extension'], $dirs['extension-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 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(),
+                'siteaccess' => array(),
+                'extension' => array(),
+                'extension-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
+     Prepends override dir to prepended scope if scope is not defined, meaning bellow anything else.
     */
-    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" );
@@ -997,36 +1055,41 @@
         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.
+     Appends override dir to override scope if scope is not defined, meaning above anything else.
     */
-    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" );
@@ -1034,29 +1097,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;
     }
 
     /*!
@@ -1278,14 +1345,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:
@@ -1501,6 +1577,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 22528)
+++ lib/ezutils/classes/ezmodule.php	(working copy)
@@ -1293,6 +1293,7 @@
             $extensionRepositories = $moduleINI->variable( 'ModuleSettings', 'ExtensionRepositories' );
             $extensionDirectory = eZExtension::baseDirectory();
             $activeExtensions = eZExtension::activeExtensions();
+            $extensionModulePaths = eZExtension::getCachedPaths('modules');
             $globalExtensionRepositories = array();
 
             foreach ( $extensionRepositories as $extensionRepository )
@@ -1305,9 +1306,14 @@
                                            "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 ) )
                 {
@@ -1401,6 +1407,7 @@
         if ( $searchPathList === null )
             $searchPathList = array();
         $searchPathList = array_merge( $searchPathList, $pathList );
+        $extensionModulePaths = eZExtension::getCachedPaths('modules');
         $triedList = array();
         $triedDirList = array();
         $foundADir = false;
@@ -1408,7 +1415,7 @@
         {
             $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, false );
@@ -1416,7 +1423,7 @@
                     $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 22528)
+++ soap.php	(working copy)
@@ -85,6 +85,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 22528)
+++ 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() )
