From: znek Date: Fri, 8 Jul 2005 10:03:07 +0000 (+0000) Subject: Added new 'X-mineqProvenance' functionality to WOContext. This MUST be used by certai... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3239d4b2e0889ea02a59aa2c2e219944caad682;p=scalable-opengroupware.org Added new 'X-mineqProvenance' functionality to WOContext. This MUST be used by certain SoObjects (AppointmentGroupFolders) and also several components. git-svn-id: http://svn.opengroupware.org/SOGo/trunk@696 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/Main/ChangeLog b/SOGo/Main/ChangeLog index 560b1bba..e11f6fd3 100644 --- a/SOGo/Main/ChangeLog +++ b/SOGo/Main/ChangeLog @@ -1,7 +1,15 @@ +2005-07-08 Marcus Mueller + + * README: updated for new default 'SOGoAllowsUnrestrictedAccess' + 2005-07-05 Marcus Mueller + * v0.9.29 + + * README: updated defaults documentation + * SOGo.m: added new default 'SOGoEnableDoubleReleaseCheck' for - debugging of NSAutoreleasePool issues (v0.9.29) + debugging of NSAutoreleasePool issues 2005-03-28 Helge Hess diff --git a/SOGo/Main/README b/SOGo/Main/README index 82a80b35..501226bb 100644 --- a/SOGo/Main/README +++ b/SOGo/Main/README @@ -18,6 +18,9 @@ Defaults SOGoEnableDoubleReleaseCheck - bool - call +[NSAutoreleasePool enableDoubleReleaseCheck:YES] upon start => useful for debugging + SOGoAllowsUnrestrictedAccess - bool - allow or disallow unrestricted access + in the absence of a proxy inserting the X-mineqProvenance header field + => useful for testing What it does ============ diff --git a/SOGo/SoObjects/SOGo/ChangeLog b/SOGo/SoObjects/SOGo/ChangeLog index c868afe2..ed0dd7bf 100644 --- a/SOGo/SoObjects/SOGo/ChangeLog +++ b/SOGo/SoObjects/SOGo/ChangeLog @@ -1,3 +1,8 @@ +2005-07-08 Marcus Mueller + + * WOContext+Agenor.[hm]: new category for discovering if the current + context is via access from the intranet. (v0.9.40) + 2005-07-07 Helge Hess * added agenor_shares4uid tool to check whether the uid=>shared mailbox diff --git a/SOGo/SoObjects/SOGo/GNUmakefile b/SOGo/SoObjects/SOGo/GNUmakefile index e60ad52c..e6b00c7c 100644 --- a/SOGo/SoObjects/SOGo/GNUmakefile +++ b/SOGo/SoObjects/SOGo/GNUmakefile @@ -27,6 +27,7 @@ libSOGo_HEADER_FILES = \ SOGoLRUCache.h \ NSString+iCal.h \ NSObject+AptComparison.h \ + WOContext+Agenor.h \ libSOGo_OBJC_FILES = \ SOGoObject.m \ @@ -42,6 +43,7 @@ libSOGo_OBJC_FILES = \ SOGoLRUCache.m \ AgenorUserManager.m \ NSObject+AptComparison.m \ + WOContext+Agenor.m \ # tools diff --git a/SOGo/SoObjects/SOGo/Version b/SOGo/SoObjects/SOGo/Version index 7638e783..b5f44a7a 100644 --- a/SOGo/SoObjects/SOGo/Version +++ b/SOGo/SoObjects/SOGo/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=39 +SUBMINOR_VERSION:=40 # v0.9.34 requires libGDLContentStore v4.5.26 # v0.9.26 requires libOGoContentStore v0.9.13 diff --git a/SOGo/SoObjects/SOGo/WOContext+Agenor.h b/SOGo/SoObjects/SOGo/WOContext+Agenor.h new file mode 100644 index 00000000..759e3fc9 --- /dev/null +++ b/SOGo/SoObjects/SOGo/WOContext+Agenor.h @@ -0,0 +1,33 @@ +/* + Copyright (C) 2000-2005 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef __SOGo_WOContext_Agenor_H_ +#define __SOGo_WOContext_Agenor_H_ + +#include + +@interface WOContext (Agenor) + +- (BOOL)isAccessFromIntranet; + +@end + +#endif /* __SOGo_WOContext_Agenor_H_ */ diff --git a/SOGo/SoObjects/SOGo/WOContext+Agenor.m b/SOGo/SoObjects/SOGo/WOContext+Agenor.m new file mode 100644 index 00000000..81bb3939 --- /dev/null +++ b/SOGo/SoObjects/SOGo/WOContext+Agenor.m @@ -0,0 +1,53 @@ +/* + Copyright (C) 2000-2005 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#include "WOContext+Agenor.h" +#include "common.h" + +@implementation WOContext (Agenor) + +- (BOOL)isAccessFromIntranet { + NSNumber *bv; + + bv = [self valueForKey:@"_agenorUnrestricedAccess"]; + if (!bv) { + NSString *mineqProvenance; + + /* See Agenor technical specification, Section 2 */ + mineqProvenance = [[self request] formValueForKey:@"X-mineqProvenance"]; + if ([mineqProvenance hasPrefix:@"intranet"]) { + bv = [NSNumber numberWithBool:YES]; + } + else { + /* fallback for testing */ + NSUserDefaults *ud; + BOOL allowed; + + ud = [NSUserDefaults standardUserDefaults]; + allowed = [ud boolForKey:@"SOGoAllowsUnrestrictedAccess"]; + bv = [NSNumber numberWithBool:allowed]; + } + [self takeValue:bv forKey:@"_agenorUnrestricedAccess"]; + } + return [bv boolValue]; +} + +@end