From: helge Date: Tue, 2 Aug 2005 09:46:31 +0000 (+0000) Subject: added Google as a known user agent X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=711621ed4da75600e6cac8f3c15abad7143a29f6;p=sope added Google as a known user agent minor code cleanups git-svn-id: http://svn.opengroupware.org/SOPE/trunk@958 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index 49528f74..ed60d7ea 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,3 +1,14 @@ +2005-08-02 Helge Hess + + * v4.5.180 + + * WEClientCapabilities.m: added Google as a known user-agent + + * WOResourceManager.m, SoObjects/SoProductClassInfo.m: minor code + cleanup + + * SoObjects/SoProductResourceManager.m: improved an error log + 2005-07-23 Sebastian Reitenbach * GNUmakefile.preamble: added OpenBSD linking flags (v4.5.179) diff --git a/sope-appserver/NGObjWeb/SoObjects/SoProductClassInfo.m b/sope-appserver/NGObjWeb/SoObjects/SoProductClassInfo.m index d72ced18..9b014f98 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoProductClassInfo.m +++ b/sope-appserver/NGObjWeb/SoObjects/SoProductClassInfo.m @@ -110,15 +110,15 @@ static int loadDebugOn = 0; [_security declareObjectProtected:self->protectedBy]; } - if (self->defaultAccess) + if (self->defaultAccess != nil) [_security setDefaultAccess:self->defaultAccess]; - if (self->roleInfo) { + if (self->roleInfo != nil) { NSEnumerator *perms; NSString *perm; perms = [self->roleInfo keyEnumerator]; - while ((perm = [perms nextObject])) { + while ((perm = [perms nextObject]) != nil) { NSString *role = [self->roleInfo objectForKey:perm]; [_security declareRole:role asDefaultForPermission:perm]; diff --git a/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m b/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m index 3ac49bf9..45e7ed4a 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m +++ b/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m @@ -323,7 +323,8 @@ static BOOL debugOn = NO; p = [[self fallbackResourceManager] pathToComponentNamed:_name inFramework:_fwname languages:_langs]; - [self logWithFormat:@" PARENT SAID: %@", p]; + [self logWithFormat:@" PARENT (%@) SAID: %@", + [self fallbackResourceManager], p]; } return p; } diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 9cc49c99..5546ff2e 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=179 +SUBMINOR_VERSION:=180 # v4.5.122 requires libNGExtensions v4.5.153 # v4.5.91 requires libNGExtensions v4.5.134 diff --git a/sope-appserver/NGObjWeb/WEClientCapabilities.m b/sope-appserver/NGObjWeb/WEClientCapabilities.m index 15ed9098..a17f44ca 100644 --- a/sope-appserver/NGObjWeb/WEClientCapabilities.m +++ b/sope-appserver/NGObjWeb/WEClientCapabilities.m @@ -69,6 +69,7 @@ #define WEUA_NewsFire 39 #define WEUA_Goliath 40 #define WEUA_PerlHTTPDAV 41 +#define WEUA_Google 42 #define WEOS_UNKNOWN 0 #define WEOS_WINDOWS 1 @@ -345,6 +346,9 @@ else if (strstr(ua, "SOPE/")) { self->browser = WEUA_SOPE; } + else if (strstr(ua, "Mediapartners-Google/")) { + self->browser = WEUA_Google; + } else { /* unknown browser */ self->browser = WEUA_UNKNOWN; @@ -437,6 +441,7 @@ case WEUA_NewsFire: return @"NewsFire"; case WEUA_Goliath: return @"Goliath"; case WEUA_PerlHTTPDAV: return @"PerlHTTPDAV"; + case WEUA_Google: return @"Google"; default: return @"unknown"; } } @@ -574,6 +579,7 @@ if (self->browser == WEUA_Wget) return YES; if (self->browser == WEUA_JavaSDK) return YES; if (self->browser == WEUA_PythonURLLIB) return YES; + if (self->browser == WEUA_Google) return YES; return NO; } - (BOOL)isDAVClient { @@ -1048,4 +1054,7 @@ static NSString *WEClientDetectorFormName = @"WEClientDetect"; PERL HTTP::DAV 'DAV.pm/v0.31' + + Google Ads + 'Mediapartners-Google/2.1' */ diff --git a/sope-appserver/NGObjWeb/WOResourceManager.m b/sope-appserver/NGObjWeb/WOResourceManager.m index f6a8bc0d..ec67480a 100644 --- a/sope-appserver/NGObjWeb/WOResourceManager.m +++ b/sope-appserver/NGObjWeb/WOResourceManager.m @@ -1097,19 +1097,6 @@ _pathExists(WOResourceManager *self, NSFileManager *fm, NSString *path) return [component autorelease]; } -/* description */ - -- (NSString *)description { - NSMutableString *ms; - - ms = [NSMutableString stringWithCapacity:32]; - [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; - if ([self->base length] > 0) - [ms appendFormat:@" path='%@'", self->base]; - [ms appendString:@">"]; - return ms; -} - /* KeyedData */ - (void)setData:(NSData *)_data @@ -1178,4 +1165,17 @@ _pathExists(WOResourceManager *self, NSFileManager *fm, NSString *path) [self unlock]; } +/* description */ + +- (NSString *)description { + NSMutableString *ms; + + ms = [NSMutableString stringWithCapacity:32]; + [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; + if ([self->base length] > 0) + [ms appendFormat:@" path='%@'", self->base]; + [ms appendString:@">"]; + return ms; +} + @end /* WOResourceManager */ diff --git a/sope-appserver/WEExtensions/WEResourceManager.m b/sope-appserver/WEExtensions/WEResourceManager.m index d5f7ea3e..9e0e9900 100644 --- a/sope-appserver/WEExtensions/WEResourceManager.m +++ b/sope-appserver/WEExtensions/WEResourceManager.m @@ -84,6 +84,7 @@ static NSString *themesDirName = @"Themes"; + (NSArray *)findResourceDirectoryPathesWithName:(NSString *)_name fhsName:(NSString *)_fhs { + /* find directories which might contain resources */ NSEnumerator *e; NSFileManager *fm; NSMutableArray *ma; @@ -117,6 +118,7 @@ static NSString *themesDirName = @"Themes"; tmp = [tmp stringByAppendingString:[[self class] shareSubpath]]; tmp = [tmp stringByAppendingString:_fhs]; if ([ma containsObject:tmp]) continue; + if (debugOn) [self logWithFormat:@"CHECK: %@", tmp]; if (![fm fileExistsAtPath:tmp isDirectory:&isDir]) continue;