From f2191c03094a37aa27514a86bf5cbcd38b0b6845 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Mon, 10 Sep 2007 17:46:35 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1169 d1b88da0-ebda-0310-925b-ed51d893ca5b --- Main/SOGo.m | 2 +- NEWS | 2 + .../Appointments/SOGoAppointmentObject.m | 31 +- .../SOGoAptMailEnglishDeletion.html | 2 +- SoObjects/Appointments/SOGoTaskObject.m | 12 +- SoObjects/Mailer/SOGoMailObject.m | 17 - SoObjects/SOGo/NSString+Utilities.m | 7 +- SoObjects/SOGo/SOGoUserFolder.m | 16 + SoObjects/SOGo/SOGoWebAuthenticator.m | 40 +- UI/MailPartViewers/UIxMailPartHTMLViewer.h | 3 + UI/MailPartViewers/UIxMailPartHTMLViewer.m | 88 +- UI/MailerUI/UIxMailActions.m | 63 +- UI/MailerUI/UIxMailListView.m | 51 +- UI/MailerUI/UIxMailView.m | 113 --- UI/MailerUI/product.plist | 766 +++++++++--------- UI/MainUI/English.lproj/Localizable.strings | 4 +- UI/MainUI/French.lproj/Localizable.strings | 4 +- UI/MainUI/German.lproj/Localizable.strings | 8 +- UI/MainUI/SOGoRootPage.h | 4 +- UI/MainUI/SOGoRootPage.m | 162 ++-- UI/MainUI/SOGoUserHomePage.m | 7 +- UI/MainUI/product.plist | 10 +- UI/SOGoUI/UIxComponent.m | 37 +- UI/Scheduler/UIxComponentEditor.m | 1 - UI/Templates/ContactsUI/UIxContactEditor.wox | 20 +- .../MailPartViewers/UIxMailPartHTMLViewer.wox | 11 +- UI/Templates/MainUI/SOGoRootPage.wox | 92 +-- UI/Templates/UIxPageFrame.wox | 69 +- .../JavascriptAPIExtensions.js | 8 +- UI/WebServerResources/MailerUI.js | 22 +- UI/WebServerResources/SOGoRootPage.css | 22 +- UI/WebServerResources/SOGoRootPage.js | 33 +- UI/WebServerResources/generic.js | 35 +- 33 files changed, 903 insertions(+), 859 deletions(-) diff --git a/Main/SOGo.m b/Main/SOGo.m index dc5065f7..3bc17f59 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -104,7 +104,7 @@ static BOOL debugObjectAllocation = NO; /* SoClass security declarations */ sInfo = [self soClassSecurityInfo]; /* require View permission to access the root (bound to authenticated ...) */ - [sInfo declareObjectProtected: SoPerm_View]; +// [sInfo declareObjectProtected: SoPerm_View]; /* to allow public access to all contained objects (subkeys) */ [sInfo setDefaultAccess: @"allow"]; diff --git a/NEWS b/NEWS index 9c7872c5..325e515b 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ - implemented cookie-based identification in the web interface; - fixed a bug where a false positive happening whenever a wrong user login was given during an indirect bind; +- deleting a message no longer expunges its parent folder; +- countless bugfixes; 0.9.0-20070824 -------------- diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 1058df10..33e14028 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -19,6 +19,8 @@ 02111-1307, USA. */ +#import + #import #import #import @@ -181,6 +183,14 @@ } /* "iCal multifolder saves" */ +- (BOOL) _aptIsStillRelevant: (iCalEvent *) appointment +{ + NSCalendarDate *now; + + now = [NSCalendarDate calendarDate]; + + return ([[appointment endDate] earlierDate: now] == now); +} - (NSException *) saveContentString: (NSString *) _iCal baseSequence: (int) _v @@ -321,9 +331,11 @@ if (delError != nil) return delError; /* email notifications */ - if ([self sendEMailNotifications]) + if ([self sendEMailNotifications] + && [self _aptIsStillRelevant: newApt]) { - attendees = [NSMutableArray arrayWithArray: [changes insertedAttendees]]; + attendees + = [NSMutableArray arrayWithArray: [changes insertedAttendees]]; [attendees removePerson: organizer]; [self sendEMailUsingTemplateNamed: @"Invitation" forOldObject: nil @@ -340,19 +352,20 @@ toAttendees: attendees]; } - attendees = [NSMutableArray arrayWithArray:[changes deletedAttendees]]; + attendees + = [NSMutableArray arrayWithArray: [changes deletedAttendees]]; [attendees removePerson: organizer]; if ([attendees count]) { - iCalEvent *canceledApt; + iCalEvent *cancelledApt; - canceledApt = [newApt copy]; - [(iCalCalendar *) [canceledApt parent] setMethod: @"cancel"]; + cancelledApt = [newApt copy]; + [(iCalCalendar *) [cancelledApt parent] setMethod: @"cancel"]; [self sendEMailUsingTemplateNamed: @"Removal" forOldObject: nil - andNewObject: canceledApt + andNewObject: cancelledApt toAttendees: attendees]; - [canceledApt release]; + [cancelledApt release]; } } @@ -398,7 +411,7 @@ attendees = [NSMutableArray arrayWithArray:[apt attendees]]; [attendees removePerson:[apt organizer]]; - /* flag appointment as being canceled */ + /* flag appointment as being cancelled */ [(iCalCalendar *) [apt parent] setMethod: @"cancel"]; [apt increaseSequence]; diff --git a/SoObjects/Appointments/SOGoAptMailEnglishDeletion.wo/SOGoAptMailEnglishDeletion.html b/SoObjects/Appointments/SOGoAptMailEnglishDeletion.wo/SOGoAptMailEnglishDeletion.html index cea93f0d..2353f8f3 100644 --- a/SoObjects/Appointments/SOGoAptMailEnglishDeletion.wo/SOGoAptMailEnglishDeletion.html +++ b/SoObjects/Appointments/SOGoAptMailEnglishDeletion.wo/SOGoAptMailEnglishDeletion.html @@ -1,4 +1,4 @@ -<#IsSubject>Appointment <#AptStartDate /> at <#AptStartTime /> has been canceled +<#IsSubject>Appointment <#AptStartDate /> at <#AptStartTime /> has been cancelled <#IsBody> The appointment at <#AptStartDate /> <#AptStartTime /> has been cancelled by <#Organizer />. \ No newline at end of file diff --git a/SoObjects/Appointments/SOGoTaskObject.m b/SoObjects/Appointments/SOGoTaskObject.m index ac3b241c..547d19e0 100644 --- a/SoObjects/Appointments/SOGoTaskObject.m +++ b/SoObjects/Appointments/SOGoTaskObject.m @@ -376,15 +376,15 @@ static NSString *mailTemplateDefaultLanguage = nil; // attendees = [NSMutableArray arrayWithArray:[changes deletedAttendees]]; // [attendees removePerson: organizer]; // if ([attendees count]) { -// iCalToDo *canceledApt; +// iCalToDo *cancelledApt; -// canceledApt = [newApt copy]; -// [(iCalCalendar *) [canceledApt parent] setMethod: @"cancel"]; +// cancelledApt = [newApt copy]; +// [(iCalCalendar *) [cancelledApt parent] setMethod: @"cancel"]; // [self sendEMailUsingTemplateNamed: @"Removal" // forOldObject: nil -// andNewObject: canceledApt +// andNewObject: cancelledApt // toAttendees: attendees]; -// [canceledApt release]; +// [cancelledApt release]; // } // } @@ -428,7 +428,7 @@ static NSString *mailTemplateDefaultLanguage = nil; attendees = [NSMutableArray arrayWithArray:[task attendees]]; [attendees removePerson:[task organizer]]; - /* flag task as being canceled */ + /* flag task as being cancelled */ [(iCalCalendar *) [task parent] setMethod: @"cancel"]; [task increaseSequence]; diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 0f152a4f..c0b4929f 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -883,10 +883,6 @@ static BOOL debugSoParts = NO; error = [[self imap4Connection] markURLDeleted: [self imap4URL]]; if (error != nil) return error; - /* c) expunge */ - - error = [[self imap4Connection] expungeAtURL:[[self container] imap4URL]]; - if (error != nil) return error; // TODO: unflag as deleted? [self flushMailCaches]; return nil; @@ -895,15 +891,6 @@ static BOOL debugSoParts = NO; - (NSException *) moveToFolderNamed: (NSString *) folderName inContext: (id)_ctx { - /* - Trashing is three actions: - a) copy to trash folder - b) mark mail as deleted - c) expunge folder - - In case b) or c) fails, we can't do anything because IMAP4 doesn't tell us - the ID used in the trash folder. - */ SOGoMailAccounts *destFolder; NSEnumerator *folders; NSString *currentFolderName, *reason; @@ -947,11 +934,7 @@ static BOOL debugSoParts = NO; error = [[self imap4Connection] markURLDeleted: [self imap4URL]]; if (error != nil) return error; - - /* c) expunge */ - error = [[self imap4Connection] expungeAtURL:[[self container] imap4URL]]; - if (error != nil) return error; // TODO: unflag as deleted? [self flushMailCaches]; return nil; diff --git a/SoObjects/SOGo/NSString+Utilities.m b/SoObjects/SOGo/NSString+Utilities.m index 3cab55fb..e5d67de7 100644 --- a/SoObjects/SOGo/NSString+Utilities.m +++ b/SoObjects/SOGo/NSString+Utilities.m @@ -144,15 +144,18 @@ static NSMutableCharacterSet *urlAfterEndingChars = nil; int start, length; NSRange workRange; +// [urlNonEndingChars addCharactersInString: @">&=,.:;\t \r\n"]; +// [urlAfterEndingChars addCharactersInString: @"()[]{}&;<\t \r\n"]; + if (!urlNonEndingChars) { urlNonEndingChars = [NSMutableCharacterSet new]; - [urlNonEndingChars addCharactersInString: @">&=,.:;\t \r\n"]; + [urlNonEndingChars addCharactersInString: @">=,.:;\t \r\n"]; } if (!urlAfterEndingChars) { urlAfterEndingChars = [NSMutableCharacterSet new]; - [urlAfterEndingChars addCharactersInString: @"()[]{}&;<\t \r\n"]; + [urlAfterEndingChars addCharactersInString: @"\t \r\n"]; } start = refRange.location; diff --git a/SoObjects/SOGo/SOGoUserFolder.m b/SoObjects/SOGo/SOGoUserFolder.m index 8db12b30..10194d27 100644 --- a/SoObjects/SOGo/SOGoUserFolder.m +++ b/SoObjects/SOGo/SOGoUserFolder.m @@ -23,6 +23,7 @@ #import #import +#import #import #import @@ -37,6 +38,21 @@ @implementation SOGoUserFolder ++ (void) initialize +{ + SoClassSecurityInfo *sInfo; + NSArray *basicRoles; + + sInfo = [self soClassSecurityInfo]; + [sInfo declareObjectProtected: SoPerm_View]; + + basicRoles = [NSArray arrayWithObject: SoRole_Authenticated]; + + /* require Authenticated role for View and WebDAV */ + [sInfo declareRoles: basicRoles asDefaultForPermission: SoPerm_View]; + [sInfo declareRoles: basicRoles asDefaultForPermission: SoPerm_WebDAVAccess]; +} + /* accessors */ - (NSString *) login diff --git a/SoObjects/SOGo/SOGoWebAuthenticator.m b/SoObjects/SOGo/SOGoWebAuthenticator.m index 9bd84e2a..36a96282 100644 --- a/SoObjects/SOGo/SOGoWebAuthenticator.m +++ b/SoObjects/SOGo/SOGoWebAuthenticator.m @@ -21,13 +21,17 @@ */ #import +#import #import #import +#import #import #import +#import #import #import +#import #import #import @@ -114,15 +118,47 @@ return [SOGoUser userWithLogin: login roles: roles]; } +- (WOResponse *) preprocessCredentialsInContext: (WOContext *) context +{ + /* + This is called by SoObjectRequestHandler prior doing any significant + processing to allow the authenticator to reject invalid requests. + */ + WOResponse *response; + NSString *auth; + + auth = [[context request] + cookieValueForKey: [self cookieNameInContext:context]]; + if ([auth isEqualToString: @"discard"]) + { + [context setObject: [NSArray arrayWithObject: SoRole_Anonymous] + forKey: @"SoAuthenticatedRoles"]; + response = nil; + } + else + response = [super preprocessCredentialsInContext: context]; + + return response; +} + - (void) setupAuthFailResponse: (WOResponse *) response withReason: (NSString *) reason inContext: (WOContext *) context { - id page; + WOComponent *page; + WOCookie *authCookie; + NSCalendarDate *date; page = [[WOApplication application] pageWithName: @"SOGoRootPage" forRequest: [context request]]; - [page appendToResponse: response inContext: context]; + [[SoDefaultRenderer sharedRenderer] renderObject: page + inContext: context]; + authCookie = [WOCookie cookieWithName: [self cookieNameInContext: context] + value: @"discard"]; + [authCookie setPath: @"/"]; + date = [NSCalendarDate calendarDate]; + [authCookie setExpires: [date yesterday]]; + [response addCookie: authCookie]; } @end /* SOGoWebAuthenticator */ diff --git a/UI/MailPartViewers/UIxMailPartHTMLViewer.h b/UI/MailPartViewers/UIxMailPartHTMLViewer.h index edc0143c..415152de 100644 --- a/UI/MailPartViewers/UIxMailPartHTMLViewer.h +++ b/UI/MailPartViewers/UIxMailPartHTMLViewer.h @@ -26,6 +26,9 @@ #import "UIxMailPartViewer.h" @interface UIxMailPartHTMLViewer : UIxMailPartViewer +{ + id handler; +} - (NSString *) flatContentAsString; diff --git a/UI/MailPartViewers/UIxMailPartHTMLViewer.m b/UI/MailPartViewers/UIxMailPartHTMLViewer.m index 2ea840eb..4dbda7c4 100644 --- a/UI/MailPartViewers/UIxMailPartHTMLViewer.m +++ b/UI/MailPartViewers/UIxMailPartHTMLViewer.m @@ -72,12 +72,9 @@ - (void) dealloc { - if (crumb) - [crumb release]; - if (result) - [result release]; - if (css) - [css release]; + [crumb release]; + [result release]; + [css release]; [super dealloc]; } @@ -88,12 +85,12 @@ - (NSString *) css { - return [[css copy] autorelease]; + return css; } - (NSString *) result { - return [[result copy] autorelease]; + return result; } /* SaxContentHandler */ @@ -101,16 +98,14 @@ { showWhoWeAre(); - if (crumb) - [crumb release]; - if (result) - [result release]; - if (css) - [css release]; + [crumb release]; + [css release]; + [result release]; result = [NSMutableString new]; css = [NSMutableString new]; crumb = [NSMutableArray new]; + inBody = NO; inStyle = NO; inScript = NO; @@ -245,6 +240,15 @@ } } +- (void) _finishCSS +{ + [css replaceString: @".SOGoHTMLMail-CSS-Delimiter body" + withString: @".SOGoHTMLMail-CSS-Delimiter"]; + [css replaceString: @";" withString: @" !important;"]; + [css replaceString: @"" withString: @""]; +} + - (void) endElement: (NSString *) _localName namespace: (NSString *) _ns rawName: (NSString *) _rawName @@ -264,7 +268,11 @@ else if (inBody) { if ([_localName caseInsensitiveCompare: @"body"] == NSOrderedSame) - inBody = NO; + { + inBody = NO; + if (css) + [self _finishCSS]; + } else [result appendFormat: @"", _localName]; } @@ -280,7 +288,7 @@ { if (inStyle) [self _appendStyle: _chars length: _len]; - if (inBody) + else if (inBody) { tmpString = [NSString stringWithCharacters: _chars length: _len]; [result appendString: [tmpString stringByEscapingHTMLString]]; @@ -386,6 +394,22 @@ @implementation UIxMailPartHTMLViewer +- (id) init +{ + if ((self = [super init])) + { + handler = nil; + } + + return self; +} + +- (void) dealloc +{ + [handler release]; + [super dealloc]; +} + - (void) _convertReferencesForPart: (NSDictionary *) part withCount: (unsigned int) count andBaseURL: (NSString *) url @@ -439,16 +463,11 @@ return attachmentIds; } -- (NSString *) flatContentAsString +- (void) _parseContent { id parser; - _UIxHTMLMailContentHandler *handler; - NSString *css; - NSMutableString *content; NSData *preparsedContent; - content = [NSMutableString string]; - preparsedContent = [super decodedFlatContent]; parser = [[SaxXMLReaderFactory standardXMLReaderFactory] createXMLReaderForMimeType: @"text/html"]; @@ -457,14 +476,31 @@ [handler setAttachmentIds: [self _attachmentIds]]; [parser setContentHandler: handler]; [parser parseFromSource: preparsedContent]; +} + +- (NSString *) cssContent +{ + NSString *cssContent, *css; + + if (!handler) + [self _parseContent]; css = [handler css]; if ([css length]) - [content appendFormat: @"", css]; - [content appendString: [handler result]]; - [handler release]; + cssContent = [NSString stringWithFormat: @"", + [handler css]]; + else + cssContent = @""; + + return cssContent; +} + +- (NSString *) flatContentAsString +{ + if (!handler) + [self _parseContent]; - return content; + return [handler result]; } @end diff --git a/UI/MailerUI/UIxMailActions.m b/UI/MailerUI/UIxMailActions.m index b8ca9cf9..42b5fa0e 100644 --- a/UI/MailerUI/UIxMailActions.m +++ b/UI/MailerUI/UIxMailActions.m @@ -25,6 +25,8 @@ #import #import #import +#import + #import #import #import @@ -36,7 +38,7 @@ @implementation UIxMailActions -- (WOResponse *) editAction +- (WOResponse *) replyToAll: (BOOL) toAll { SOGoMailAccount *account; SOGoMailObject *co; @@ -48,8 +50,7 @@ account = [co mailAccountFolder]; folder = [account draftsFolderInContext: context]; newMail = [folder newDraft]; - [newMail fetchMailForEditing: co]; - [newMail storeInfo]; + [newMail fetchMailForReplying: co toAll: toAll]; newLocation = [NSString stringWithFormat: @"%@/edit", [newMail baseURLInContext: context]]; @@ -57,7 +58,17 @@ return [self redirectToLocation: newLocation]; } -- (WOResponse *) replyToAll: (BOOL) toAll +- (WOResponse *) replyAction +{ + return [self replyToAll: NO]; +} + +- (WOResponse *) replyToAllAction +{ + return [self replyToAll: NO]; +} + +- (WOResponse *) forwardAction { SOGoMailAccount *account; SOGoMailObject *co; @@ -69,7 +80,7 @@ account = [co mailAccountFolder]; folder = [account draftsFolderInContext: context]; newMail = [folder newDraft]; - [newMail fetchMailForReplying: co toAll: toAll]; + [newMail fetchMailForForwarding: co]; newLocation = [NSString stringWithFormat: @"%@/edit", [newMail baseURLInContext: context]]; @@ -77,17 +88,45 @@ return [self redirectToLocation: newLocation]; } -- (WOResponse *) replyAction +- (id) trashAction { - return [self replyToAll: NO]; + id response; + + response = [[self clientObject] trashInContext: context]; + if (!response) + { + response = [context response]; + [response setStatus: 204]; + } + + return response; } -- (WOResponse *) replyToAllAction +- (id) moveAction { - return [self replyToAll: NO]; + NSString *destinationFolder; + id response; + + destinationFolder = [[context request] formValueForKey: @"tofolder"]; + if ([destinationFolder length] > 0) + { + response = [[self clientObject] moveToFolderNamed: destinationFolder + inContext: context]; + if (!response) + { + response = [context response]; + [response setStatus: 204]; + } + } + else + response = [NSException exceptionWithHTTPStatus: 500 /* Server Error */ + reason: @"No destination folder given"]; + + return response; } -- (WOResponse *) forwardAction +/* SOGoDraftObject */ +- (WOResponse *) editAction { SOGoMailAccount *account; SOGoMailObject *co; @@ -99,7 +138,8 @@ account = [co mailAccountFolder]; folder = [account draftsFolderInContext: context]; newMail = [folder newDraft]; - [newMail fetchMailForForwarding: co]; + [newMail fetchMailForEditing: co]; + [newMail storeInfo]; newLocation = [NSString stringWithFormat: @"%@/edit", [newMail baseURLInContext: context]]; @@ -107,7 +147,6 @@ return [self redirectToLocation: newLocation]; } -/* SOGoDraftObject */ - (id) deleteAction { SOGoDraftObject *draft; diff --git a/UI/MailerUI/UIxMailListView.m b/UI/MailerUI/UIxMailListView.m index ae275867..c80f48e6 100644 --- a/UI/MailerUI/UIxMailListView.m +++ b/UI/MailerUI/UIxMailListView.m @@ -457,32 +457,29 @@ static int attachmentFlagSize = 8096; - (void) _setQualifierForCriteria: (NSString *) criteria andValue: (NSString *) value { + NSMutableString *newQString; + [qualifier release]; - if ([criteria isEqualToString: @"subject"]) - qualifier = [EOQualifier qualifierWithQualifierFormat: - @"(subject doesContain: %@)", - value]; - else if ([criteria isEqualToString: @"sender"]) - qualifier = [EOQualifier qualifierWithQualifierFormat: - @"(from doesContain: %@)", - value]; - else if ([criteria isEqualToString: @"subject_or_sender"]) - qualifier = [EOQualifier qualifierWithQualifierFormat: - @"(subject doesContain: %@) OR " - @"(from doesContain: %@)", - value, value]; - else if ([criteria isEqualToString: @"to_or_cc"]) - qualifier = [EOQualifier qualifierWithQualifierFormat: - @"(to doesContain: %@) OR " - @"(cc doesContain: %@)", - value, value]; - else if ([criteria isEqualToString: @"entire_message"]) - qualifier = [EOQualifier qualifierWithQualifierFormat: - @"(message doesContain: %@)", - value]; - else - qualifier = nil; + newQString = [NSMutableString stringWithString: @"(NOT flags doesContain: deleted)"]; + if ([value length] > 0) + { + if ([criteria isEqualToString: @"subject"]) + [newQString appendFormat: @" AND (subject doesContain: %@)", value]; + else if ([criteria isEqualToString: @"sender"]) + [newQString appendFormat: @" AND (sender doesContain: %@)", value]; + else if ([criteria isEqualToString: @"subject_or_sender"]) + [newQString appendFormat: @" AND ((sender doesContain: %@)" + @" OR (from doesContain: %@))", + value, value]; + else if ([criteria isEqualToString: @"to_or_cc"]) + [newQString appendFormat: @" AND ((to doesContain: %@)" + @" OR (cc doesContain: %@))", + value, value]; + else if ([criteria isEqualToString: @"entire_message"]) + [newQString appendFormat: @" AND (message doesContain: %@)", value]; + } + qualifier = [EOQualifier qualifierWithQualifierFormat: newQString]; [qualifier retain]; } @@ -499,10 +496,8 @@ static int attachmentFlagSize = 8096; specificMessage = [request formValueForKey: @"pageforuid"]; searchCriteria = [request formValueForKey: @"search"]; searchValue = [request formValueForKey: @"value"]; - if ([searchCriteria length] > 0 - && [searchValue length] > 0) - [self _setQualifierForCriteria: searchCriteria - andValue: searchValue]; + [self _setQualifierForCriteria: searchCriteria + andValue: searchValue]; firstMessageNumber = ((specificMessage) diff --git a/UI/MailerUI/UIxMailView.m b/UI/MailerUI/UIxMailView.m index 1eb40bc7..107e9c2a 100644 --- a/UI/MailerUI/UIxMailView.m +++ b/UI/MailerUI/UIxMailView.m @@ -201,119 +201,6 @@ static NSString *mailETag = nil; return [self redirectToLocation: url]; } -- (id) deleteAction -{ - NSException *ex; - - if (![self isDeletableClientObject]) { - return [NSException exceptionWithHTTPStatus:400 /* Bad Request */ - reason:@"method cannot be invoked on " - @"the specified object"]; - } - - if ([self isInvokedBySafeMethod]) { - // TODO: fix UI to use POST for unsafe actions - [self logWithFormat:@"WARNING: method is invoked using safe HTTP method!"]; - } - - if ((ex = [[self clientObject] delete]) != nil) { - id url; - - url = [[ex reason] stringByEscapingURL]; - url = [@"view?error=" stringByAppendingString:url]; - return [self redirectToLocation:url]; - //return ex; - } - - if (![self isInlineViewer]) { - // if everything is ok, close the window (send a JS closing the Window) - id page; - - page = [self pageWithName:@"UIxMailWindowCloser"]; - [page takeValue:@"YES" forKey:@"refreshOpener"]; - return page; - } - - return [self redirectToParentFolder]; -} - -- (id) trashAction -{ - NSException *ex; - - if ([self isInvokedBySafeMethod]) { - // TODO: fix UI to use POST for unsafe actions - [self logWithFormat:@"WARNING: method is invoked using safe HTTP method!"]; - } - - if ((ex = [[self clientObject] trashInContext:context]) != nil) { - id url; - - if ([[[context request] formValueForKey:@"jsonly"] boolValue]) - /* called using XMLHttpRequest */ - return ex; - - url = [[ex reason] stringByEscapingURL]; - url = [@"view?error=" stringByAppendingString:url]; - return [self redirectToLocation:url]; - } - - if ([[[context request] formValueForKey:@"jsonly"] boolValue]) { - /* called using XMLHttpRequest */ - [[context response] setStatus:200 /* OK */]; - return [context response]; - } - - if (![self isInlineViewer]) { - // if everything is ok, close the window (send a JS closing the Window) - id page; - - page = [self pageWithName:@"UIxMailWindowCloser"]; - [page takeValue:@"YES" forKey:@"refreshOpener"]; - return page; - } - - return [self redirectToParentFolder]; -} - -- (id ) moveAction -{ - id result; - NSString *destinationFolder; - id url; - - if ([self isInvokedBySafeMethod]) { - // TODO: fix UI to use POST for unsafe actions - [self logWithFormat:@"WARNING: method is invoked using safe HTTP method!"]; - } - - destinationFolder = [self queryParameterForKey: @"tofolder"]; - if ([destinationFolder length] > 0) - { - result = [[self clientObject] moveToFolderNamed: destinationFolder - inContext: context]; - if (result) - { - if (![[[context request] formValueForKey:@"jsonly"] boolValue]) - { - url = [NSString stringWithFormat: @"view?error=%@", - [[result reason] stringByEscapingURL]]; - result = [self redirectToLocation: url]; - } - } - else - { - result = [context response]; - [result setStatus: 200]; - } - } - else - result = [NSException exceptionWithHTTPStatus:500 /* Server Error */ - reason: @"No destination folder given"]; - - return result; -} - /* generating response */ - (void) appendToResponse: (WOResponse *) _response diff --git a/UI/MailerUI/product.plist b/UI/MailerUI/product.plist index 214330cc..d6806567 100644 --- a/UI/MailerUI/product.plist +++ b/UI/MailerUI/product.plist @@ -1,435 +1,429 @@ -{ /* -*-javascript-*- */ -requires = ( MAIN, MainUI, CommonUI, Mailer, MailPartViewers ); /* , Sieve */ +{ /* -*-java-*- */ + requires = ( MAIN, MainUI, CommonUI, Mailer, MailPartViewers ); /* , Sieve */ - publicResources = ( - "uix.css", - "mailer.css", - "mailer.js", - "generic.js", - "searchfield.js", - "UIxAppointmentEditor.js", - "UIxContactEditor.js", - "UIxMailToSelection.js", + publicResources = ("uix.css", + "mailer.css", + "mailer.js", + "generic.js", + "searchfield.js", + "UIxAppointmentEditor.js", + "UIxContactEditor.js", + "UIxMailToSelection.js", - "lori_32x32.png", + "lori_32x32.png", - "tbtv_account_17x17.gif", - "tbtv_drafts_17x17.gif", - "tbtv_inbox_17x17.gif", - "tbtv_junction2_17x17.gif", - "tbtv_junction_17x17.gif", - "tbtv_leaf_corner_17x17.gif", - "tbtv_line_17x17.gif", - "tbtv_minus_17x17.gif", - "tbtv_plus_17x17.gif", - "tbtv_corner_17x17.gif", - "tbtv_corner_minus_17x17.gif", - "tbtv_corner_plus_17x17.gif", - "tbtv_sent_17x17.gif", - "tbtv_trash_17x17.gif", + "tbtv_account_17x17.gif", + "tbtv_drafts_17x17.gif", + "tbtv_inbox_17x17.gif", + "tbtv_junction2_17x17.gif", + "tbtv_junction_17x17.gif", + "tbtv_leaf_corner_17x17.gif", + "tbtv_line_17x17.gif", + "tbtv_minus_17x17.gif", + "tbtv_plus_17x17.gif", + "tbtv_corner_17x17.gif", + "tbtv_corner_minus_17x17.gif", + "tbtv_corner_plus_17x17.gif", + "tbtv_sent_17x17.gif", + "tbtv_trash_17x17.gif", - "tbtb_addressbook.png", - "tbtb_compose.png", - "tbtb_delete.png", - "tbtb_deletedoc.png", - "tbtb_filetofolder.png", - "tbtb_forward.png", - "tbtb_getmail.png", - "tbtb_next.png", - "tbtb_previous.png", - "tbtb_print.png", - "tbtb_reply.png", - "tbtb_replyall.png", - "tbtb_search.png", - "tbtb_trash.png", + "tbtb_addressbook.png", + "tbtb_compose.png", + "tbtb_delete.png", + "tbtb_deletedoc.png", + "tbtb_filetofolder.png", + "tbtb_forward.png", + "tbtb_getmail.png", + "tbtb_next.png", + "tbtb_previous.png", + "tbtb_print.png", + "tbtb_reply.png", + "tbtb_replyall.png", + "tbtb_search.png", + "tbtb_trash.png", - "tbtb_compose_addressbook_30x30.png", - "tbtb_compose_attach_30x30.png", - "tbtb_compose_clip_30x30.png", - "tbtb_compose_cut_30x30.png", - "tbtb_compose_dup_30x30.png", - "tbtb_compose_file_30x30.png", - "tbtb_compose_lock_30x30.png", - "tbtb_compose_quote_30x30.png", - "tbtb_compose_send_30x30.png", - "tbtb_compose_spell_30x30.png", + "tbtb_compose_addressbook_30x30.png", + "tbtb_compose_attach_30x30.png", + "tbtb_compose_clip_30x30.png", + "tbtb_compose_cut_30x30.png", + "tbtb_compose_dup_30x30.png", + "tbtb_compose_file_30x30.png", + "tbtb_compose_lock_30x30.png", + "tbtb_compose_quote_30x30.png", + "tbtb_compose_send_30x30.png", + "tbtb_compose_spell_30x30.png", - "message-mail.png", - "message-mail-read.png", + "message-mail.png", + "message-mail-read.png", - "icon_mark_flagged.gif", - "icon_mark_read.gif", - "icon_mark_unflagged.gif", - "icon_mark_unread.gif", - "icon_read.gif", - "icon_unread.gif", + "icon_mark_flagged.gif", + "icon_mark_read.gif", + "icon_mark_unflagged.gif", + "icon_mark_unread.gif", + "icon_read.gif", + "icon_unread.gif", - "title_attachment_14x14.png", - "title_config.png", - "title_junk.png", - "title_read_14x14.png", - "title_thread.png", - "title_sortdown_12x12.png", - "title_sortup_12x12.png", - ); + "title_attachment_14x14.png", + "title_config.png", + "title_junk.png", + "title_read_14x14.png", + "title_thread.png", + "title_sortdown_12x12.png", + "title_sortup_12x12.png", + ); -factories = { -}; + factories = { + }; -categories = { - SOGoMailFolder = { + categories = { + SOGoMailFolder = { slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoMailObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoMailObject.toolbar"; + }; }; methods = { - subscribe = { - protectedBy = ""; - actionClass = "UIxMailFolderActions"; - actionName = "subscribe"; - }; - unsubscribe = { - protectedBy = ""; - actionClass = "UIxMailFolderActions"; - actionName = "unsubscribe"; - }; - quotas = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "quotas"; - }; - view = { - protectedBy = "View"; - pageName = "UIxMailListView"; - }; - ajax = { - protectedBy = "View"; - pageName = "UIxMailAjaxRequest"; - }; - index = { - protectedBy = "View"; - pageName = "UIxMailListView"; - }; - GET = { /* hack to make it work as the default method */ - protectedBy = "View"; - pageName = "UIxMailListView"; - }; - markMessageUnread = { - protectedBy = "View"; - pageName = "UIxMailListView"; - actionName = "markMessageUnread"; - }; - markMessageRead = { - protectedBy = "View"; - pageName = "UIxMailListView"; - actionName = "markMessageRead"; - }; - getMail = { - protectedBy = "View"; - pageName = "UIxMailListView"; - actionName = "getMail"; - }; - expunge = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "emptyTrash"; - }; - createFolder = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "createFolder"; - }; - renameFolder = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "renameFolder"; - }; - deleteFolder = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "deleteFolder"; - }; - userRights = { - protectedBy = "ReadAcls"; - pageName = "UIxMailUserRightsEditor"; - }; - saveUserRights = { - protectedBy = "SaveAcls"; - pageName = "UIxMailUserRightsEditor"; - actionName = "saveUserRights"; - }; + subscribe = { + protectedBy = ""; + actionClass = "UIxMailFolderActions"; + actionName = "subscribe"; + }; + unsubscribe = { + protectedBy = ""; + actionClass = "UIxMailFolderActions"; + actionName = "unsubscribe"; + }; + quotas = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "quotas"; + }; + view = { + protectedBy = "View"; + pageName = "UIxMailListView"; + }; + ajax = { + protectedBy = "View"; + pageName = "UIxMailAjaxRequest"; + }; + index = { + protectedBy = "View"; + pageName = "UIxMailListView"; + }; + GET = { /* hack to make it work as the default method */ + protectedBy = "View"; + pageName = "UIxMailListView"; + }; + markMessageUnread = { + protectedBy = "View"; + pageName = "UIxMailListView"; + actionName = "markMessageUnread"; + }; + markMessageRead = { + protectedBy = "View"; + pageName = "UIxMailListView"; + actionName = "markMessageRead"; + }; + getMail = { + protectedBy = "View"; + pageName = "UIxMailListView"; + actionName = "getMail"; + }; + expunge = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "emptyTrash"; + }; + createFolder = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "createFolder"; + }; + renameFolder = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "renameFolder"; + }; + deleteFolder = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "deleteFolder"; + }; + userRights = { + protectedBy = "ReadAcls"; + pageName = "UIxMailUserRightsEditor"; + }; + saveUserRights = { + protectedBy = "SaveAcls"; + pageName = "UIxMailUserRightsEditor"; + actionName = "saveUserRights"; + }; }; - }; + }; - SOGoTrashFolder = { + SOGoTrashFolder = { /* just a new toolbar, other things come from SOGoMailFolder */ slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoMailObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoMailObject.toolbar"; + }; }; methods = { - emptyTrash = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "emptyTrash"; - }; + emptyTrash = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "emptyTrash"; + }; }; - }; + }; - SOGoMailObject = { + SOGoMailObject = { slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoMailObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoMailObject.toolbar"; + }; }; methods = { - view = { - protectedBy = "View"; - pageName = "UIxMailView"; - }; - viewsource = { - protectedBy = "View"; - actionClass = "UIxMailSourceView"; - actionName = "viewSource"; - }; - popupview = { - protectedBy = "View"; - pageName = "UIxMailPopupView"; - }; - move = { - protectedBy = "View"; - pageName = "UIxMailView"; - actionName = "move"; - }; - delete = { - protectedBy = "View"; - pageName = "UIxMailView"; - actionName = "delete"; - }; - trash = { - protectedBy = "View"; - pageName = "UIxMailView"; - actionName = "trash"; - }; - junk = { - protectedBy = "View"; - pageName = "UIxMailView"; - actionName = "junk"; - }; - edit = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "edit"; - }; - reply = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "reply"; - }; - replyall = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "replyToAll"; - }; - forward = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "forward"; - }; + view = { + protectedBy = "View"; + pageName = "UIxMailView"; + }; + viewsource = { + protectedBy = "View"; + actionClass = "UIxMailSourceView"; + actionName = "viewSource"; + }; + popupview = { + protectedBy = "View"; + pageName = "UIxMailPopupView"; + }; + move = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "move"; + }; + trash = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "trash"; + }; + junk = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "junk"; + }; + edit = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "edit"; + }; + reply = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "reply"; + }; + replyall = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "replyToAll"; + }; + forward = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "forward"; + }; }; - }; + }; - SOGoMailAccounts = { + SOGoMailAccounts = { slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoMailObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoMailObject.toolbar"; + }; }; methods = { - view = { - protectedBy = "View"; - pageName = "UIxMailMainFrame"; - }; - compose = { - protectedBy = "View"; - pageName = "UIxMailMainFrame"; - actionName = "compose"; - }; + view = { + protectedBy = "View"; + pageName = "UIxMailMainFrame"; + }; + compose = { + protectedBy = "View"; + pageName = "UIxMailMainFrame"; + actionName = "compose"; + }; }; - }; + }; - SOGoMailAccount = { + SOGoMailAccount = { slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoMailObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoMailObject.toolbar"; + }; }; methods = { - compose = { - protectedBy = "View"; - actionClass = "UIxMailAccountActions"; - actionName = "compose"; - }; - mailboxes = { - protectedBy = "View"; - actionClass = "UIxMailAccountActions"; - actionName = "listMailboxes"; - }; - createFolder = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "createFolder"; - }; + compose = { + protectedBy = "View"; + actionClass = "UIxMailAccountActions"; + actionName = "compose"; + }; + mailboxes = { + protectedBy = "View"; + actionClass = "UIxMailAccountActions"; + actionName = "listMailboxes"; + }; + createFolder = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "createFolder"; + }; }; - }; + }; - SOGoDraftsFolder = { + SOGoDraftsFolder = { slots = { - toolbar = { - protectedBy = "View"; - value = ( /* the toolbar groups */ - ( /* first group */ - { link = "getMail"; - image = "tb-mail-getmail-flat-24x24.png"; - cssClass = "tbicon_getmail"; label = "Get Mail"; }, - { - link = "#"; // "compose"; // target = "_blank"; - isSafe = NO; - onclick = "return openMessageWindow(null, 'compose');"; - image = "tb-mail-write-flat-24x24.png"; - cssClass = "tbicon_compose"; label = "Write"; }, - ) - ); - }; + toolbar = { + protectedBy = "View"; + value = ( /* the toolbar groups */ + ( /* first group */ + { link = "getMail"; + image = "tb-mail-getmail-flat-24x24.png"; + cssClass = "tbicon_getmail"; label = "Get Mail"; }, + { + link = "#"; // "compose"; // target = "_blank"; + isSafe = NO; + onclick = "return openMessageWindow(null, 'compose');"; + image = "tb-mail-write-flat-24x24.png"; + cssClass = "tbicon_compose"; label = "Write"; }, + ) + ); + }; }; methods = { - view = { - protectedBy = "View"; - pageName = "UIxMailListView"; - }; - getMail = { - protectedBy = "View"; - pageName = "UIxMailListView"; - }; + view = { + protectedBy = "View"; + pageName = "UIxMailListView"; + }; + getMail = { + protectedBy = "View"; + pageName = "UIxMailListView"; + }; }; - }; + }; - SOGoDraftObject = { + SOGoDraftObject = { slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoDraftObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoDraftObject.toolbar"; + }; }; methods = { - edit = { - protectedBy = "View"; - pageName = "UIxMailEditor"; - }; - save = { - protectedBy = "View"; - pageName = "UIxMailEditor"; - actionName = "save"; - }; - send = { - protectedBy = "View"; - pageName = "UIxMailEditor"; - actionName = "send"; - }; - delete = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "delete"; - }; - deleteAttachment = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "deleteAttachment"; - }; + edit = { + protectedBy = "View"; + pageName = "UIxMailEditor"; + }; + save = { + protectedBy = "View"; + pageName = "UIxMailEditor"; + actionName = "save"; + }; + send = { + protectedBy = "View"; + pageName = "UIxMailEditor"; + actionName = "send"; + }; + delete = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "delete"; + }; + deleteAttachment = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "deleteAttachment"; + }; }; - }; + }; - /* Sieve */ + /* Sieve */ - /* SOGoSieveScriptsFolder = { - slots = { - toolbar = { - protectedBy = "View"; - value = ( - ( - { - link = "getMail"; - image = "tb-mail-getmail-flat-24x24.png"; - cssClass = "tbicon_getmail"; label = "Get Mail"; - }, - { - link = "#"; // "compose"; // target = "_blank"; - onclick = "clickedNewFilter(this); return false"; - image = "tb-mail-write-flat-24x24.png"; - cssClass = "tbicon_compose"; label = "New Filter"; - }, - ), - ( - { link = "#"; - cssClass = "tbicon_delete"; label = "Delete"; }, - ), - ); - }; - }; - methods = { - view = { - protectedBy = "View"; - pageName = "UIxFilterList"; - }; - create = { - protectedBy = "View"; - pageName = "UIxFilterList"; - actionName = "create"; - }; - }; - }; +// SOGoSieveScriptsFolder = { +// slots = { +// toolbar = { +// protectedBy = "View"; +// value = ( +// ( +// { +// link = "getMail"; +// image = "tb-mail-getmail-flat-24x24.png"; +// cssClass = "tbicon_getmail"; label = "Get Mail"; +// }, +// { +// link = "#"; // "compose"; // target = "_blank"; +// onclick = "clickedNewFilter(this); return false"; +// image = "tb-mail-write-flat-24x24.png"; +// cssClass = "tbicon_compose"; label = "New Filter"; +// }, +// ), +// ( +// { link = "#"; +// cssClass = "tbicon_delete"; label = "Delete"; }, +// ), +// ); +// }; +// }; +// methods = { +// view = { +// protectedBy = "View"; +// pageName = "UIxFilterList"; +// }; +// create = { +// protectedBy = "View"; +// pageName = "UIxFilterList"; +// actionName = "create"; +// }; +// }; +// }; - SOGoSieveScriptObject = { - slots = { - toolbar = { - protectedBy = "View"; - value = ( - ( { link = "#"; - onclick = "clickedEditorSave(this);return false;"; - image = "tb-mail-file-flat-24x24.png"; - cssClass = "tbicon_save"; label = "Save"; }, - { link = "#"; - onclick = "clickedEditorDelete(this);return false;"; - image = "tb-mail-delete-flat-24x24.png"; - cssClass = "tbicon_delete"; label = "Delete"; }, - ) - ); - }; - }; - methods = { - edit = { - protectedBy = "View"; - pageName = "UIxSieveEditor"; - actionName = "edit"; - }; - save = { - protectedBy = "View"; - pageName = "UIxSieveEditor"; - actionName = "save"; - }; - delete = { - protectedBy = "View"; - pageName = "UIxSieveEditor"; - actionName = "delete"; - }; - }; - }; */ -}; +// SOGoSieveScriptObject = { +// slots = { +// toolbar = { +// protectedBy = "View"; +// value = ( +// ( { link = "#"; +// onclick = "clickedEditorSave(this);return false;"; +// image = "tb-mail-file-flat-24x24.png"; +// cssClass = "tbicon_save"; label = "Save"; }, +// { link = "#"; +// onclick = "clickedEditorDelete(this);return false;"; +// image = "tb-mail-delete-flat-24x24.png"; +// cssClass = "tbicon_delete"; label = "Delete"; }, +// ) +// ); +// }; +// }; +// methods = { +// edit = { +// protectedBy = "View"; +// pageName = "UIxSieveEditor"; +// actionName = "edit"; +// }; +// save = { +// protectedBy = "View"; +// pageName = "UIxSieveEditor"; +// actionName = "save"; +// }; +// delete = { +// protectedBy = "View"; +// pageName = "UIxSieveEditor"; +// actionName = "delete"; +// }; +// } + }; } + diff --git a/UI/MainUI/English.lproj/Localizable.strings b/UI/MainUI/English.lproj/Localizable.strings index b9ccf8f2..932c4219 100644 --- a/UI/MainUI/English.lproj/Localizable.strings +++ b/UI/MainUI/English.lproj/Localizable.strings @@ -1,6 +1,8 @@ /* this file is in UTF-8 format! */ -"Homepage" = "Homepage"; +"title" = "SOGo"; "Login:" = "Login:"; "Password:" = "Password:"; + +"Connect" = "Connect"; diff --git a/UI/MainUI/French.lproj/Localizable.strings b/UI/MainUI/French.lproj/Localizable.strings index 88966d5f..dbdc05ac 100644 --- a/UI/MainUI/French.lproj/Localizable.strings +++ b/UI/MainUI/French.lproj/Localizable.strings @@ -1,6 +1,8 @@ /* this file is in UTF-8 format! */ -"Homepage" = "Accueil"; +"title" = "SOGo"; "Login:" = "Nom d'utilisateur :"; "Password:" = "Mot de passe :"; + +"Connect" = "Connexion"; diff --git a/UI/MainUI/German.lproj/Localizable.strings b/UI/MainUI/German.lproj/Localizable.strings index 536e765b..790286f0 100644 --- a/UI/MainUI/German.lproj/Localizable.strings +++ b/UI/MainUI/German.lproj/Localizable.strings @@ -1,6 +1,8 @@ /* this file is in UTF-8 format! */ -"Homepage" = "Startseite"; +"title" = "SOGo"; -"Login:" = "Login:"; -"Password:" = "Password:"; +"Login:" = "Benutzername:"; +"Password:" = "Passwort:"; + +"Connect" = "Verbinden"; diff --git a/UI/MainUI/SOGoRootPage.h b/UI/MainUI/SOGoRootPage.h index fe3ebe46..387e11cd 100644 --- a/UI/MainUI/SOGoRootPage.h +++ b/UI/MainUI/SOGoRootPage.h @@ -23,9 +23,9 @@ #ifndef SOGOROOTPAGE_H #define SOGOROOTPAGE_H -#import +#import -@interface SOGoRootPage : UIxPageFrame +@interface SOGoRootPage : UIxComponent { NSString *userName; } diff --git a/UI/MainUI/SOGoRootPage.m b/UI/MainUI/SOGoRootPage.m index 01801d0f..c88e9af4 100644 --- a/UI/MainUI/SOGoRootPage.m +++ b/UI/MainUI/SOGoRootPage.m @@ -24,6 +24,7 @@ #import #import #import +#import #import #import #import @@ -53,89 +54,122 @@ return userName; } -/* actions */ +- (NSString *) connectURL +{ + return [NSString stringWithFormat: @"%@connect", [self applicationPath]]; +} -- (id ) defaultAction +/* actions */ +- (id ) connectAction { - WOResponse *r; - NSString *login, *rhk; + WOResponse *response; + WOCookie *authCookie; SOGoWebAuthenticator *auth; - SOGoUser *user; - SOGoUserFolder *home; - WOApplication *base; - - /* - Note: ctx.activeUser is NOT set here. Don't know why, so we retrieve - the user from the authenticator. - */ + NSString *cookieValue, *cookieString; + + auth = [[WOApplication application] + authenticatorInContext: context]; + response = [context response]; + cookieString = [NSString stringWithFormat: @"%@:%@", + [self queryParameterForKey: @"userName"], + [self queryParameterForKey: @"password"]]; + cookieValue = [NSString stringWithFormat: @"basic%@", + [cookieString stringByEncodingBase64]]; + authCookie = [WOCookie cookieWithName: [auth cookieNameInContext: context] + value: cookieValue]; + [authCookie setPath: @"/"]; + [response setStatus: 204]; + [response addCookie: authCookie]; + + return response; +} + +// - (id ) defaultAction +// { +// WOResponse *r; +// NSString *login, *rhk; +// SOGoWebAuthenticator *auth; +// SOGoUser *user; +// SOGoUserFolder *home; +// WOApplication *base; + +// /* +// Note: ctx.activeUser is NOT set here. Don't know why, so we retrieve +// the user from the authenticator. +// */ - auth = [[self clientObject] authenticatorInContext: context]; - user = [auth userInContext: context]; - login = [user login]; +// auth = [[self clientObject] authenticatorInContext: context]; +// user = [auth userInContext: context]; +// login = [user login]; - if ([login isEqualToString:@"anonymous"]) { - /* use root page for unauthenticated users */ - return self; - } +// if ([login isEqualToString:@"anonymous"]) { +// /* use root page for unauthenticated users */ +// return self; +// } - /* check base */ +// /* check base */ - base = [self application]; - rhk = [[context request] requestHandlerKey]; - if (([rhk length] == 0) || ([base requestHandlerForKey:rhk] == nil)) { - base = [base lookupName: @"so" inContext: context acquire: NO]; +// base = [self application]; +// rhk = [[context request] requestHandlerKey]; +// if (([rhk length] == 0) || ([base requestHandlerForKey:rhk] == nil)) { +// base = [base lookupName: @"so" inContext: context acquire: NO]; - if (![base isNotNull] || [base isKindOfClass:[NSException class]]) { - /* use root page if home could not be found */ - [self errorWithFormat:@"Did not find 'so' request handler!"]; - return self; - } - } +// if (![base isNotNull] || [base isKindOfClass:[NSException class]]) { +// /* use root page if home could not be found */ +// [self errorWithFormat:@"Did not find 'so' request handler!"]; +// return self; +// } +// } - /* lookup home-page */ +// /* lookup home-page */ - home = [base lookupName: login inContext: context acquire: NO]; - if (![home isNotNull] || [home isKindOfClass:[NSException class]]) { - /* use root page if home could not be found */ - return self; - } +// home = [base lookupName: login inContext: context acquire: NO]; +// if (![home isNotNull] || [home isKindOfClass:[NSException class]]) { +// /* use root page if home could not be found */ +// return self; +// } - /* redirect to home-page */ +// /* redirect to home-page */ - r = [context response]; - [r setStatus: 302 /* moved */]; - [r setHeader: [home baseURLInContext: context] - forKey: @"location"]; +// r = [context response]; +// [r setStatus: 302 /* moved */]; +// [r setHeader: [home baseURLInContext: context] +// forKey: @"location"]; - return r; -} +// return r; +// } /* response generation */ -- (void) appendToResponse: (WOResponse *) response - inContext: (WOContext *) ctx -{ - NSString *rhk; +// - (void) appendToResponse: (WOResponse *) response +// inContext: (WOContext *) ctx +// { +// NSString *rhk; - // TODO: we might also want to look into the HTTP basic-auth to redirect to - // the login URL! +// // TODO: we might also want to look into the HTTP basic-auth to redirect to +// // the login URL! - rhk = [[ctx request] requestHandlerKey]; - if ([rhk length] == 0 - || [[self application] requestHandlerForKey: rhk] == nil) - { - /* a small hack to redirect to a valid URL */ - NSString *url; +// rhk = [[ctx request] requestHandlerKey]; +// if ([rhk length] == 0 +// || [[self application] requestHandlerForKey: rhk] == nil) +// { +// /* a small hack to redirect to a valid URL */ +// NSString *url; - url = [ctx urlWithRequestHandlerKey: @"so" path: @"/" queryString: nil]; - [response setStatus: 302 /* moved */]; - [response setHeader: url forKey: @"location"]; - [self logWithFormat: @"URL: %@", url]; - return; - } - - [response setHeader: @"text/html" forKey: @"content-type"]; - [super appendToResponse: response inContext: ctx]; +// url = [ctx urlWithRequestHandlerKey: @"so" path: @"/" queryString: nil]; +// [response setStatus: 302 /* moved */]; +// [response setHeader: url forKey: @"location"]; +// [self logWithFormat: @"URL: %@", url]; +// return; +// } + +// [response setHeader: @"text/html" forKey: @"content-type"]; +// [super appendToResponse: response inContext: ctx]; +// } + +- (BOOL) isPublicInContext: (WOContext *) localContext +{ + return YES; } @end /* SOGoRootPage */ diff --git a/UI/MainUI/SOGoUserHomePage.m b/UI/MainUI/SOGoUserHomePage.m index 6f211ce6..91015583 100644 --- a/UI/MainUI/SOGoUserHomePage.m +++ b/UI/MainUI/SOGoUserHomePage.m @@ -203,10 +203,10 @@ static NSString *defaultModule = nil; - (id ) logoffAction { WOResponse *response; - NSEnumerator *cookies; WOCookie *cookie; SOGoWebAuthenticator *auth; id container; + NSCalendarDate *date; container = [[self clientObject] container]; @@ -214,11 +214,12 @@ static NSString *defaultModule = nil; [response setStatus: 302]; [response setHeader: [container baseURLInContext: context] forKey: @"location"]; - cookies = [[response cookies] objectEnumerator]; auth = [[self clientObject] authenticatorInContext: context]; cookie = [WOCookie cookieWithName: [auth cookieNameInContext: context] - value: @"logoff"]; + value: @"discard"]; [cookie setPath: @"/"]; + date = [NSCalendarDate calendarDate]; + [cookie setExpires: [date yesterday]]; [response addCookie: cookie]; return response; diff --git a/UI/MainUI/product.plist b/UI/MainUI/product.plist index 213438a6..c3ebb099 100644 --- a/UI/MainUI/product.plist +++ b/UI/MainUI/product.plist @@ -10,7 +10,7 @@ classes = { SOGoRootPage = { superclass = "SoComponent"; - protectedBy = "View"; + protectedBy = ""; defaultRoles = { "View" = ( "Authenticated" ); }; @@ -60,16 +60,16 @@ SOGo = { // TODO: move decls to class methods = { view = { - protectedBy = "View"; + protectedBy = ""; pageName = "SOGoRootPage"; }; connect = { - protectedBy = "View"; - pageName = "SOGoRootPage"; + protectedBy = ""; + pageName = "SOGoRootPage"; actionName = "connect"; }; GET = { // more or less a hack, see README of dbd - protectedBy = "View"; + protectedBy = ""; pageName = "SOGoRootPage"; }; }; diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 83eb9b18..95e48cf9 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -312,28 +312,31 @@ static BOOL uixDebugEnabled = NO; SOGoObject *currentClient, *parent; BOOL found; Class objectClass, groupFolderClass, userFolderClass; - WOContext *ctx; - - groupFolderClass = [SOGoCustomGroupFolder class]; - userFolderClass = [SOGoUserFolder class]; currentClient = [self clientObject]; - objectClass = [currentClient class]; - found = (objectClass == groupFolderClass || objectClass == userFolderClass); - while (!found && currentClient) + if (currentClient + && [currentClient isKindOfClass: [SOGoObject class]]) { - parent = [currentClient container]; - objectClass = [parent class]; - if (objectClass == groupFolderClass - || objectClass == userFolderClass) - found = YES; - else - currentClient = parent; + groupFolderClass = [SOGoCustomGroupFolder class]; + userFolderClass = [SOGoUserFolder class]; + + objectClass = [currentClient class]; + found = (objectClass == groupFolderClass || objectClass == userFolderClass); + while (!found && currentClient) + { + parent = [currentClient container]; + objectClass = [parent class]; + if (objectClass == groupFolderClass + || objectClass == userFolderClass) + found = YES; + else + currentClient = parent; + } } + else + currentClient = [WOApplication application]; - ctx = context; - - return [[currentClient baseURLInContext:ctx] hostlessURL]; + return [[currentClient baseURLInContext: context] hostlessURL]; } - (NSString *) resourcesPath diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index eecd800f..7937e8fa 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -104,7 +104,6 @@ currentAttendee = [attendees nextObject]; while (currentAttendee) { - NSLog (@"currentCN: %@", [currentAttendee cn]); [names appendFormat: @"%@,", [currentAttendee cn]]; [emails appendFormat: @"%@,", [currentAttendee rfc822Email]]; currentAttendee = [attendees nextObject]; diff --git a/UI/Templates/ContactsUI/UIxContactEditor.wox b/UI/Templates/ContactsUI/UIxContactEditor.wox index c4cc0e9e..c1c1b45e 100644 --- a/UI/Templates/ContactsUI/UIxContactEditor.wox +++ b/UI/Templates/ContactsUI/UIxContactEditor.wox @@ -74,6 +74,15 @@ + + + + +