From f39e7336a03f545810e41e2a3e94143dbc37bf32 Mon Sep 17 00:00:00 2001 From: znek Date: Fri, 8 Jul 2005 13:29:26 +0000 Subject: [PATCH] Fixed 'only organizer can edit appointments' once and for all, moved some functionality git-svn-id: http://svn.opengroupware.org/SOGo/trunk@705 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/UI/SOGoUI/ChangeLog | 5 +++++ SOGo/UI/SOGoUI/UIxComponent.m | 10 ---------- SOGo/UI/SOGoUI/Version | 2 +- SOGo/UI/Scheduler/ChangeLog | 14 ++++++++++++++ SOGo/UI/Scheduler/UIxAppointmentEditor.m | 10 ++++++++++ SOGo/UI/Scheduler/UIxAppointmentView.m | 1 + SOGo/UI/Scheduler/UIxComponent+Agenor.h | 7 ++++--- SOGo/UI/Scheduler/UIxComponent+Agenor.m | 5 +++++ SOGo/UI/Scheduler/Version | 2 +- SOGo/UI/Templates/ChangeLog | 5 +++++ SOGo/UI/Templates/UIxAppointmentEditor.wox | 12 +++++------- 11 files changed, 51 insertions(+), 22 deletions(-) diff --git a/SOGo/UI/SOGoUI/ChangeLog b/SOGo/UI/SOGoUI/ChangeLog index 8393312a..d9bd8878 100644 --- a/SOGo/UI/SOGoUI/ChangeLog +++ b/SOGo/UI/SOGoUI/ChangeLog @@ -1,3 +1,8 @@ +2005-07-08 Marcus Mueller + + * UIxComponent.m: moved -isAccessRestricted method to + UIxComponent+Agenor (v0.9.28) + 2005-07-07 Marcus Mueller * v0.9.27 diff --git a/SOGo/UI/SOGoUI/UIxComponent.m b/SOGo/UI/SOGoUI/UIxComponent.m index 8434265c..ce4cd228 100644 --- a/SOGo/UI/SOGoUI/UIxComponent.m +++ b/SOGo/UI/SOGoUI/UIxComponent.m @@ -435,16 +435,6 @@ static BOOL uixDebugEnabled = NO; return [[self context] valueForKey:@"locale"]; } -/* Access is in several ways restricted if request is not coming from the - * Intranet - */ - -- (BOOL)isAccessRestricted { - NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - - return [ud boolForKey:@"SOGoAccessIsRestricted"]; -} - /* debugging */ - (BOOL)isUIxDebugEnabled { diff --git a/SOGo/UI/SOGoUI/Version b/SOGo/UI/SOGoUI/Version index e67137c3..6b91cf1a 100644 --- a/SOGo/UI/SOGoUI/Version +++ b/SOGo/UI/SOGoUI/Version @@ -1,5 +1,5 @@ # version file -SUBMINOR_VERSION:=27 +SUBMINOR_VERSION:=28 # v0.9.18 requires NGExtensions v4.5.136 diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index 85ba43f4..7b80d28c 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,17 @@ +2005-07-08 Marcus Mueller + + * v0.9.126 + + * UIxComponent+Agenor.[hm]: new method -isAccessRestricted, uses the + implementation from WOContext+Agenor in libSOGo. + + * UIxAppointmentView.m: allow editing of appointments that have no + organizer set. + + * UIxAppointmentEditor.m: allow editing of appointments that have no + organizer set. Redirect to 'view' URI in case editor is not the + organizer. Fixed a bug where the organizer got accidentaly deleted. + 2005-07-07 Marcus Mueller * v0.9.125 diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index 945711d7..e971ea0c 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -784,7 +784,12 @@ [_appointment setAccessClass:[self accessClass]]; [_appointment setTransparency:[self transparency]]; +#if 0 + /* bad, bad, bad! + * Organizer is no form value, thus we MUST NOT change it + */ [_appointment setOrganizer:self->organizer]; +#endif attendees = [self participants]; lResources = [self resources]; if ([lResources count] > 0) { @@ -823,6 +828,7 @@ /* access */ - (BOOL)isMyApt { + if (!self->organizer) return YES; // assume this is safe to do, right? return [[self->organizer rfc822Email] isEqualToString:[self emailForUser]]; } @@ -952,6 +958,10 @@ [self setContentString:ical]; [self loadValuesFromContentString:ical]; + if (![self canEditApt]) { + /* TODO: we need proper ACLs */ + return [self redirectToLocation:[self _completeURIForMethod:@"../view"]]; + } return self; } diff --git a/SOGo/UI/Scheduler/UIxAppointmentView.m b/SOGo/UI/Scheduler/UIxAppointmentView.m index f53d5c4f..08028dec 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentView.m +++ b/SOGo/UI/Scheduler/UIxAppointmentView.m @@ -174,6 +174,7 @@ iCalPerson *organizer; organizer = [[self appointment] organizer]; + if (!organizer) return YES; // assume this is correct to do, right? return [[organizer rfc822Email] isEqualToString:[self emailForUser]]; } diff --git a/SOGo/UI/Scheduler/UIxComponent+Agenor.h b/SOGo/UI/Scheduler/UIxComponent+Agenor.h index 9e4c2145..1a0232a8 100644 --- a/SOGo/UI/Scheduler/UIxComponent+Agenor.h +++ b/SOGo/UI/Scheduler/UIxComponent+Agenor.h @@ -24,14 +24,15 @@ #ifndef __UIxComponent_Agenor_H_ #define __UIxComponent_Agenor_H_ - -#import - +#include @interface UIxComponent (Agenor) /* email, cn */ - (NSString *)emailForUser; - (NSString *)cnForUser; + +/* restrictions */ +- (BOOL)isAccessRestricted; @end #endif /* __UIxComponent_Agenor_H_ */ diff --git a/SOGo/UI/Scheduler/UIxComponent+Agenor.m b/SOGo/UI/Scheduler/UIxComponent+Agenor.m index e5831d67..9e3ae273 100644 --- a/SOGo/UI/Scheduler/UIxComponent+Agenor.m +++ b/SOGo/UI/Scheduler/UIxComponent+Agenor.m @@ -21,6 +21,7 @@ #include "UIxComponent+Agenor.h" #include +#include #include "common.h" @implementation UIxComponent(Agenor) @@ -39,4 +40,8 @@ return [[AgenorUserManager sharedUserManager] getCNForUID:uid]; } +- (BOOL)isAccessRestricted { + return [[self context] isAccessFromIntranet] ? NO : YES; +} + @end /* UIxComponent(Agenor) */ diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index 9532d649..05f29d4d 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,6 +1,6 @@ # Version file -SUBMINOR_VERSION:=125 +SUBMINOR_VERSION:=126 # v0.9.123 requires Appointments v0.9.35 # v0.9.123 requires SOGoUI v0.9.24 diff --git a/SOGo/UI/Templates/ChangeLog b/SOGo/UI/Templates/ChangeLog index 40019ba1..7e7065b0 100644 --- a/SOGo/UI/Templates/ChangeLog +++ b/SOGo/UI/Templates/ChangeLog @@ -1,3 +1,8 @@ +2005-07-08 Marcus Mueller + + * UIxAppointmentEditor.wox: removed conditionals from UI as they were + wrongly placed in the template, component does now deal with it + 2005-07-07 Marcus Mueller * UIxPageFrame.wox: added 'Home' and 'Administration' hyperlink diff --git a/SOGo/UI/Templates/UIxAppointmentEditor.wox b/SOGo/UI/Templates/UIxAppointmentEditor.wox index 5e630af9..a99719bc 100644 --- a/SOGo/UI/Templates/UIxAppointmentEditor.wox +++ b/SOGo/UI/Templates/UIxAppointmentEditor.wox @@ -7,8 +7,7 @@ className="UIxPageFrame" title="name" > - -
+ @@ -330,12 +329,11 @@ - - -
-
- + + + -- 2.39.2