Index: access.php
===================================================================
--- access.php	(revision 23928)
+++ access.php	(working copy)
@@ -170,7 +170,7 @@
                         {
                             $matchMapHost = $matchMapItem[0];
                             $matchMapAccess = $matchMapItem[1];
-                            if ( $matchMapHost == $host )
+                            if ( strpos( $host, $matchMapHost ) )
                             {
                                 $access['name'] = $matchMapAccess;
                                 $access['type'] = $type;
@@ -227,6 +227,94 @@
                 else
                     continue;
             } break;
+
+            /*
+            # patch start: combination from host and uri matching
+            # uses the hostname + 1 element of uri
+            # similar uri or host Matching - type = map
+            #
+            # MatchOrder=host_uri
+            # HostURIMatchMapItems[]
+            # HostURIMatchMapItems[]=www.example.com;de;siteaccess_user_de
+            # HostURIMatchMapItems[]=www.example.com;en;siteaccess_en
+            #
+            # DefaultHostURIMatchMapItems[]
+            # DefaultHostURIMatchMapItems[]=www.example.com;de;siteaccess_user_de
+            #
+            # http://www.example.com/de/content/view/full/2 =>  sitaccess_user_de
+            # http://www.example.com/en/content/view/full/2 =>  sitaccess_en
+            # http://www.example.com => siteaccess_user_de (default)
+            */
+            case 'host_uri':
+            {
+                $match_type = 'map';
+
+                if ( $match_type == 'map' )
+                {
+                    if ( $ini->hasVariable( 'SiteAccessSettings', 'HostURIMatchMapItems' ) )
+                    {
+                        $match_item = $uri->element( 0 );
+                        $matchMapItems = $ini->variableArray( 'SiteAccessSettings', 'HostURIMatchMapItems' );
+
+                        // if uri param set
+                        if( $match_item != '' )
+                        {
+                            foreach ( $matchMapItems as $matchMapItem )
+                            {
+                                $matchMapHost = $matchMapItem[0];
+                                $matchMapURI = $matchMapItem[1];
+                                $matchMapAccess = $matchMapItem[2];
+
+                                // check hostname + sitaccess
+                                //  (host)www.example.com.jac400.fw.lokal => beginsWith => www.example.com
+                                if ( strpos( $host, $matchMapHost ) and
+                                     $matchMapURI == $match_item )
+                                {
+
+                                    $type = EZ_ACCESS_TYPE_URI;
+
+                                    $uri->increase( 1 );
+                                    $uri->dropBase();
+                                    $access['name'] = $matchMapAccess;
+                                    $access['type'] = $type;
+                                    $access['access_alias'] = $matchMapURI;
+
+                                    eZDebug::writeDebug('Host ('.$matchMapHost.'/'.$matchMapURI.') => Siteaccess ('.$matchMapAccess.')', '1. access.php - site.ini [SiteAccessSettings] MatchOrder = host_uri , HostMatchType = map' );
+
+                                    return $access;
+                                }
+
+                                unset( $matchMapHost, $matchMapURI, $matchMapAccess );
+                            }
+                        }
+
+                        $defaultMatchMapItems = $ini->variableArray( 'SiteAccessSettings', 'DefaultHostURIMatchMapItems' );
+
+                        // default access
+                       foreach ( $defaultMatchMapItems as $matchMapItem )
+                       {
+
+                            $matchMapHost = $matchMapItem[0];
+                            $matchMapURI = $matchMapItem[1];
+                            $matchMapAccess = $matchMapItem[2];
+
+                             // check hostname + siteaccess
+                            if ( strpos( $host, $matchMapHost ) )
+                            {
+                                $type = EZ_ACCESS_TYPE_URI;
+
+                                $access['name'] = $matchMapAccess;
+                                $access['type'] = $type;
+                                $access['access_alias'] = $matchMapURI;
+                                eZDebug::writeDebug('Host ('.$matchMapHost.'/'.$matchMapURI.') => Siteaccess ('.$matchMapAccess.')', '2. default - access.php - site.ini [SiteAccessSettings] MatchOrder = host_uri , HostMatchType = map');
+
+                                return $access;
+                            }
+                        }
+                    }
+                }
+            } break;
+
             default:
             {
                 eZDebug::writeError( "Unknown access match: $match", "access" );
