]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1169 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 10 Sep 2007 17:46:35 +0000 (17:46 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 10 Sep 2007 17:46:35 +0000 (17:46 +0000)
33 files changed:
Main/SOGo.m
NEWS
SoObjects/Appointments/SOGoAppointmentObject.m
SoObjects/Appointments/SOGoAptMailEnglishDeletion.wo/SOGoAptMailEnglishDeletion.html
SoObjects/Appointments/SOGoTaskObject.m
SoObjects/Mailer/SOGoMailObject.m
SoObjects/SOGo/NSString+Utilities.m
SoObjects/SOGo/SOGoUserFolder.m
SoObjects/SOGo/SOGoWebAuthenticator.m
UI/MailPartViewers/UIxMailPartHTMLViewer.h
UI/MailPartViewers/UIxMailPartHTMLViewer.m
UI/MailerUI/UIxMailActions.m
UI/MailerUI/UIxMailListView.m
UI/MailerUI/UIxMailView.m
UI/MailerUI/product.plist
UI/MainUI/English.lproj/Localizable.strings
UI/MainUI/French.lproj/Localizable.strings
UI/MainUI/German.lproj/Localizable.strings
UI/MainUI/SOGoRootPage.h
UI/MainUI/SOGoRootPage.m
UI/MainUI/SOGoUserHomePage.m
UI/MainUI/product.plist
UI/SOGoUI/UIxComponent.m
UI/Scheduler/UIxComponentEditor.m
UI/Templates/ContactsUI/UIxContactEditor.wox
UI/Templates/MailPartViewers/UIxMailPartHTMLViewer.wox
UI/Templates/MainUI/SOGoRootPage.wox
UI/Templates/UIxPageFrame.wox
UI/WebServerResources/JavascriptAPIExtensions.js
UI/WebServerResources/MailerUI.js
UI/WebServerResources/SOGoRootPage.css
UI/WebServerResources/SOGoRootPage.js
UI/WebServerResources/generic.js

index dc5065f7e5a302e16a6dbd675cf259169f0842ab..3bc17f5905a7ab1696ca36b9393abbfa520be2e6 100644 (file)
@@ -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 9c7872c5bcee659f629b455e1e5afdfad01980b2..325e515bb9904c8648a9ecb3ebd0d7109da1ddde 100644 (file)
--- 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
 --------------
index 1058df10c3b5e2018c5c2130507abd699ffd1519..33e14028227b76b2908e7d2c0dd14098843d6217 100644 (file)
@@ -19,6 +19,8 @@
   02111-1307, USA.
 */
 
+#import <Foundation/NSCalendarDate.h>
+
 #import <NGObjWeb/NSException+HTTP.h>
 #import <NGExtensions/NSNull+misc.h>
 #import <NGExtensions/NSObject+Logs.h>
 }
 
 /* "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
   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
               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];
         }
     }
 
       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];
 
index cea93f0d756a4b789bf76c181dfd060b45b28eec..2353f8f3ced485dd22e4f1c7d0f138a41d6fd561 100644 (file)
@@ -1,4 +1,4 @@
-<#IsSubject>Appointment <#AptStartDate /> at <#AptStartTime /> has been canceled</#IsSubject>
+<#IsSubject>Appointment <#AptStartDate /> at <#AptStartTime /> has been cancelled</#IsSubject>
 <#IsBody>
 The appointment at <#AptStartDate /> <#AptStartTime /> has been cancelled by <#Organizer />.
 </#IsBody>
\ No newline at end of file
index ac3b241cf2c0ad08843c77c34284bd5b47eaab7f..547d19e04a399fc1f1a7e4bee512669346f675ba 100644 (file)
@@ -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];
 
index 0f152a4fc6f09cfdc59d4025d127cff8c5326504..c0b4929ff75a4fc88a7aff4a906a1f125bdb156b 100644 (file)
@@ -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;
index 3cab55fb13e71c7c47e8dcf35fa6197047f6b9f4..e5d67de73886b1ddad2a9e0d2c55a8d98da94772 100644 (file)
@@ -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;
index 8db12b30eaa2aa70ee77746308a0722d64558e88..10194d27a151d8b7b53d6899808edead87fb0866 100644 (file)
@@ -23,6 +23,7 @@
 #import <Foundation/NSString.h>
 
 #import <NGObjWeb/NSException+HTTP.h>
+#import <NGObjWeb/SoClassSecurityInfo.h>
 #import <NGExtensions/NSObject+Logs.h>
 
 #import <Appointments/SOGoAppointmentFolder.h>
 
 @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
index 9bd84e2a5b58e94aea2f2b3562e1f03b7307c3cb..36a962826ec49efe664d327817b61695c556fd88 100644 (file)
  */
 
 #import <Foundation/NSArray.h>
+#import <Foundation/NSCalendarDate.h>
 #import <Foundation/NSString.h>
 #import <Foundation/NSUserDefaults.h>
 
+#import <NGObjWeb/SoDefaultRenderer.h>
 #import <NGObjWeb/WOApplication.h>
 #import <NGObjWeb/WOContext.h>
+#import <NGObjWeb/WOCookie.h>
 #import <NGObjWeb/WORequest.h>
 #import <NGObjWeb/WOResponse.h>
+#import <NGExtensions/NSCalendarDate+misc.h>
 #import <NGLdap/NGLdapConnection.h>
 
 #import <UI/MainUI/SOGoRootPage.h>
   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 */
index edc0143c36edf6dadef94344cd65e767a8421b93..415152dedc15b5467b3b801dd2431ea8cfe8bb2a 100644 (file)
@@ -26,6 +26,9 @@
 #import "UIxMailPartViewer.h"
 
 @interface UIxMailPartHTMLViewer : UIxMailPartViewer
+{
+  id handler;
+}
 
 - (NSString *) flatContentAsString;
 
index 2ea840ebf16a2822815a39695ed24b223297e985..4dbda7c495fe3e04c37416359be9ef97b677c91a 100644 (file)
 
 - (void) dealloc
 {
-  if (crumb)
-    [crumb release];
-  if (result)
-    [result release];
-  if (css)
-    [css release];
+  [crumb release];
+  [result release];
+  [css release];
   [super dealloc];
 }
 
 
 - (NSString *) css
 {
-  return [[css copy] autorelease];
+  return css;
 }
 
 - (NSString *) result
 {
-  return [[result copy] autorelease];
+  return result;
 }
 
 /* SaxContentHandler */
 {
   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;
     }
 }
 
+- (void) _finishCSS
+{
+  [css replaceString: @".SOGoHTMLMail-CSS-Delimiter body"
+       withString: @".SOGoHTMLMail-CSS-Delimiter"];
+  [css replaceString: @";" withString: @" !important;"];
+  [css replaceString: @"<!--" withString: @""];
+  [css replaceString: @"-->" withString: @""];
+}
+
 - (void) endElement: (NSString *) _localName
           namespace: (NSString *) _ns
             rawName: (NSString *) _rawName
   else if (inBody)
     {
       if ([_localName caseInsensitiveCompare: @"body"] == NSOrderedSame)
-        inBody = NO;
+       {
+         inBody = NO;
+         if (css)
+           [self _finishCSS];
+       }
       else
         [result appendFormat: @"</%@>", _localName];
     }
     {
       if (inStyle)
         [self _appendStyle: _chars length: _len];
-      if (inBody)
+      else if (inBody)
         {
           tmpString = [NSString stringWithCharacters: _chars length: _len];
           [result appendString: [tmpString stringByEscapingHTMLString]];
 
 @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
   return attachmentIds;
 }
 
-- (NSString *) flatContentAsString
+- (void) _parseContent
 {
   id <NSObject, SaxXMLReader> parser;
-  _UIxHTMLMailContentHandler *handler;
-  NSString *css;
-  NSMutableString *content;
   NSData *preparsedContent;
 
-  content = [NSMutableString string];
-
   preparsedContent = [super decodedFlatContent];
   parser = [[SaxXMLReaderFactory standardXMLReaderFactory]
              createXMLReaderForMimeType: @"text/html"];
   [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: @"<style type=\"text/css\">%@</style>", css];
-  [content appendString: [handler result]];
-  [handler release];
+    cssContent = [NSString stringWithFormat: @"<style type=\"text/css\">%@</style>",
+                          [handler css]];
+  else
+    cssContent = @"";
+
+  return cssContent;
+}
+
+- (NSString *) flatContentAsString
+{
+  if (!handler)
+    [self _parseContent];
 
-  return content;
+  return [handler result];
 }
 
 @end
index b8ca9cf9fb9ed86eddf62183669a0e639cb11f2f..42b5fa0e3614ae93e5b5bf3af7fb85b65e876841 100644 (file)
@@ -25,6 +25,8 @@
 #import <NGObjWeb/WOContext.h>
 #import <NGObjWeb/WORequest.h>
 #import <NGObjWeb/WOResponse.h>
+#import <NGObjWeb/NSException+HTTP.h>
+
 #import <SoObjects/Mailer/SOGoDraftObject.h>
 #import <SoObjects/Mailer/SOGoDraftsFolder.h>
 #import <SoObjects/Mailer/SOGoMailAccount.h>
@@ -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]];
   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]];
   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;
   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]];
   return [self redirectToLocation: newLocation];
 }
 
-/* SOGoDraftObject */
 - (id) deleteAction
 {
   SOGoDraftObject *draft;
index ae2758675fbcf2660386a2ec542f1ccff2d8c2a5..c80f48e6373b0612e4339c9aac2171267f1ccb15 100644 (file)
@@ -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)
index 1eb40bc79b8ad0dc7744929a4e657daa63648e9f..107e9c2ad8d3315e4d74a9711065412d78b16d7e 100644 (file)
@@ -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 <WOActionResults>) moveAction
-{
-  id <WOActionResults> 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
index 214330cc8e7f42898cfb684dffad0566f6e99a8b..d6806567c2897239644565c56b1495d7f294ab10 100644 (file)
-{ /* -*-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 = "<public>";
-           actionClass = "UIxMailFolderActions";
-           actionName = "subscribe";
-        };
-        unsubscribe = {
-           protectedBy = "<public>";
-           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 = "<public>";
+         actionClass = "UIxMailFolderActions";
+         actionName = "subscribe";
+       };
+       unsubscribe = {
+         protectedBy = "<public>";
+         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";
+//     };
+//   }
+  };
 }
+
index b9ccf8f2fb0bbf30a0db371898c2b98b7cfb7496..932c421941350fc3a3eaa7a1f6e052d94169b172 100644 (file)
@@ -1,6 +1,8 @@
 /* this file is in UTF-8 format! */
 
-"Homepage" = "Homepage";
+"title" = "SOGo";
 
 "Login:" = "Login:";
 "Password:" = "Password:";
+
+"Connect" = "Connect";
index 88966d5f50bc7133df3369c31fd6006b788171b2..dbdc05ac207ad9f654910d680abb64b201a988cc 100644 (file)
@@ -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";
index 536e765b5c546c42f4fbf60a8d4dad20d0283819..790286f0953298ef6119e345b2d77a82fcebfecc 100644 (file)
@@ -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";
index fe3ebe466de1912984b790e8df20fbebf267ce37..387e11cd73da05281a700c44cf2fc0f86402bb71 100644 (file)
@@ -23,9 +23,9 @@
 #ifndef SOGOROOTPAGE_H
 #define SOGOROOTPAGE_H
 
-#import <UI/Common/UIxPageFrame.h>
+#import <UI/SOGoUI/UIxComponent.h>
 
-@interface SOGoRootPage : UIxPageFrame
+@interface SOGoRootPage : UIxComponent
 {
   NSString *userName;
 }
index 01801d0f0e242563bb73227b74dfa82b2a9027b1..c88e9af4f629b3ea597608cb9c2ceec9151a3545 100644 (file)
@@ -24,6 +24,7 @@
 #import <NGObjWeb/WOCookie.h>
 #import <NGObjWeb/WORequest.h>
 #import <NGObjWeb/WOResponse.h>
+#import <NGExtensions/NGBase64Coding.h>
 #import <NGExtensions/NSNull+misc.h>
 #import <NGExtensions/NSString+misc.h>
 #import <NGExtensions/NSObject+Logs.h>
   return userName;
 }
 
-/* actions */
+- (NSString *) connectURL
+{
+  return [NSString stringWithFormat: @"%@connect", [self applicationPath]];
+}
 
-- (id <WOActionResults>) defaultAction
+/* actions */
+- (id <WOActionResults>) 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 <WOActionResults>) 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 */
index 6f211ce67d677d3e41d5292369fe383bd2a6afe7..910155833657e00b828dfd829a45025f7c4a8425 100644 (file)
@@ -203,10 +203,10 @@ static NSString *defaultModule = nil;
 - (id <WOActionResults>) 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;
index 213438a6bb8265206a4a3d4198eca36229327a08..c3ebb09938582cd3a975da27e53ead740bd554aa 100644 (file)
@@ -10,7 +10,7 @@
   classes = {
     SOGoRootPage = {
       superclass  = "SoComponent";
-      protectedBy = "View";
+      protectedBy = "<public>";
       defaultRoles = {
         "View" = ( "Authenticated" );
       };
     SOGo = { // TODO: move decls to class
       methods = {
         view = { 
-          protectedBy = "View";
+          protectedBy = "<public>";
           pageName = "SOGoRootPage"; 
         };
        connect = {
-          protectedBy = "View";
-          pageName = "SOGoRootPage"; 
+          protectedBy = "<public>";
+          pageName = "SOGoRootPage";
          actionName = "connect";
         };
         GET = { // more or less a hack, see README of dbd
-          protectedBy = "View";
+          protectedBy = "<public>";
           pageName = "SOGoRootPage"; 
         };
       };
index 83eb9b18f3d4467a1c04ba3e743a81adcc1a925b..95e48cf9413660c311d5a6ac6310d2a8d7f3c5a9 100644 (file)
@@ -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
index eecd800ff1b39b74351e1f9111a16f098688087f..7937e8fa7aeadaa552d261e2ebf6493dca8562d8 100644 (file)
   currentAttendee = [attendees nextObject];
   while (currentAttendee)
     {
-      NSLog (@"currentCN: %@", [currentAttendee cn]);
       [names appendFormat: @"%@,", [currentAttendee cn]];
       [emails appendFormat: @"%@,", [currentAttendee rfc822Email]];
       currentAttendee = [attendees nextObject];
index c4cc0e9edff2e75e67c465594517695d4b4eb91b..c1c1b45e75a465f68d1e07463a3f89b77ce7a273 100644 (file)
                 </label>
               </td>
             </tr>
+            <tr>
+              <td>
+                <label><var:string label:value="Screen Name:"
+                   />
+                  <input type="text" class="textField" name="screenName"
+                    id="screenName" var:value="snapshot.screenName" />
+                </label>
+              </td>
+            </tr> 
             <tr>
               <td id="htmlMailFormat">
                 <label><var:string
                 </label>
               </td>
             </tr>
-            <tr>
-              <td>
-                <label><var:string label:value="Screen Name:"
-                   />
-                  <input type="text" class="textField" name="screenName"
-                    id="screenName" var:value="snapshot.screenName" />
-                </label>
-              </td>
-            </tr>
-          </table>
+         </table>
          <span class="caption"><var:string label:value="Phones" /></span>
           <table>
             <tr>
index ba3db2f038d699b0fdb747fff6cf3ab2510c3e49..c4bd4faea85eb9d1d8ba0d19a55dc995dae02284 100644 (file)
@@ -1,9 +1,12 @@
 <?xml version="1.0" standalone="yes"?>
-<div
+<!DOCTYPE container>
+<container
   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:var="http://www.skyrix.com/od/binding"
   xmlns:const="http://www.skyrix.com/od/constant"
   xmlns:rsrc="OGo:url"
-  xmlns:label="OGo:label"
-  class="mailer_htmlcontent SOGoHTMLMail-CSS-Delimiter"
-><var:string value="flatContentAsString" const:escapeHTML="NO" /></div>
+  xmlns:label="OGo:label">
+  <var:string value="cssContent" const:escapeHTML="NO" />
+  <div class="SOGoHTMLMail-CSS-Delimiter mailer_htmlcontent"
+    ><var:string value="flatContentAsString" const:escapeHTML="NO" /></div>
+</container>
index c5f08cbd86a055f903813288f917faad916f695e..0fa3da10e83530dac02e987ffb175126e8bac9f3 100644 (file)
@@ -1,82 +1,26 @@
 <?xml version="1.0" standalone="yes"?>
-<!DOCTYPE container>
-<container 
+<!DOCTYPE var:component>
+<var:component
+  className="UIxPageFrame"
   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:var="http://www.skyrix.com/od/binding"
   xmlns:const="http://www.skyrix.com/od/constant"
   xmlns:rsrc="OGo:url"
   xmlns:label="OGo:label"
   ><var:string var:value="doctype" const:escapeHTML="NO" />
-  <html>
-    <head>
-      <title>
-       <var:string value="title"/>
-      </title>
-      <meta name="hideFrame" var:content="hideFrame" />
-      <meta name="description" content="SOGo Web Interface" />
-      <meta name="author" content="SKYRIX Software AG/Inverse groupe conseil" />
-      <meta name="robots" content="stop" />
-      <meta name="build" var:content="buildDate" />
-      <link href="mailto:support@inverse.ca" rev="made" />
-      <link rel="shortcut icon" rsrc:href="lori_16x16.ico" type="image/x-icon" />
-      <link type="text/css" rel="stylesheet" rsrc:href="generic.css" />
-      <link type="text/css" rel="stylesheet" rsrc:href="dtree.css" />
-      <var:if-ie
-       ><link type="text/css" rel="stylesheet" rsrc:href="iefixes.css"
-         /></var:if-ie>
-      <link type="text/css" rel="stylesheet" rsrc:href="SOGoRootPage.css" />
-    </head>
-
-    <body class="loginPage">
-      <script type="text/javascript">
-       var ResourcesURL = '/SOGo.woa/WebServerResources';
-        var ApplicationBaseURL = '<var:string value="applicationPath" />';
-      </script>
-
-      <script type="text/javascript" rsrc:src="_IEtoW3C.js"><!-- space required --></script>
-      <script type="text/javascript" rsrc:src="events.js"><!-- space required --></script>
-      <script type="text/javascript" rsrc:src="prototype.js"><!-- space required --></script>
-      <script type="text/javascript" rsrc:src="JavascriptAPIExtensions.js"><!-- space required --></script>
-      <script type="text/javascript" rsrc:src="HTMLElement.js"><!-- space required --></script>
-      <script type="text/javascript" rsrc:src="HTMLInputElement.js"><!-- space required --></script>
-      <script type="text/javascript" rsrc:src="HTMLTableElement.js"><!-- space required --></script>
-      <script type="text/javascript" rsrc:src="HTMLUListElement.js"><!-- space required --></script>
-      <script type="text/javascript" rsrc:src="generic.js"><!-- space required --></script>
-      <script type="text/javascript" rsrc:src="SOGoDragAndDrop.js"><!-- space required --></script>
-      <script type="text/javascript" rsrc:src="SOGoDragHandles.js"><!-- space required --></script>
-      <script type="text/javascript" rsrc:src="SOGoRootPage.js"><!-- space required --></script>
-      <!-- var:js-stringtable
-       var:framework="productFrameworkName"
-       const:identifier="labels" -->
-      <!-- var:js-stringtable
-       const:identifier="clabels" -->
-      <div class="pageContent">
-       <form href="view">
-         <div id="loginScreen">
-           <img rsrc:src="lori-login.jpg"/><br/><br/>
-           <label><var:string label:value="Login:"/><br/>
-             <input class="textField" id="userName" name="userName"
-               type="text" var:value="userName" /></label><br/>
-           <label><var:string label:value="Password:"/><br/>
-             <input class="textField" id="password"
-               name="password" type="password" var:value="password" /><br/></label>
-           <div id="loginButton">
-             <input class="button" id="submit" name="submit" type="submit" label:value="Connect" />
-           </div>
-         </div>
-       </form>
+  <form id="connectForm" var:href="connectURL">
+    <div id="loginScreen">
+      <img rsrc:src="lori-login.jpg"/><br/><br/>
+      <label><var:string label:value="Login:"/><br/>
+       <input class="textField" id="userName" name="userName"
+         type="text" var:value="userName" /></label><br/>
+      <label><var:string label:value="Password:"/><br/>
+       <input class="textField" id="password"
+         name="password" type="password" var:value="password" /><br/></label>
+      <div id="loginButton">
+       <input class="button" id="submit" name="submit" type="submit" label:value="Connect" />
       </div>
-      <noscript>
-       <div class="javascriptPopupBackground">
-       </div>
-       <div class="javascriptMessagePseudoWindow noJavascriptErrorMessage">
-         <var:string label:value="noJavascriptError"
-           /><br /><br
-           /><a class="button" var:href="page.context.uri"
-           ><var:string label:value="noJavascriptRetry"
-             /></a>
-       </div>
-      </noscript>
-    </body>
-  </html>
-</container>
+    </div>
+  </form>
+  <img id="preparedAnimation" rsrc:src="busy.gif"/>
+</var:component>
index a38aa506b0f3aaceb04c6fe7c74169272f3b8b6e..6bad635bb41786f48337192a23c257c5f6582f64 100644 (file)
 
       <body var:class="bodyClasses">
        <script type="text/javascript">
-         var UserFolderURL = '<var:string value="userFolderPath" />';
          var ApplicationBaseURL = '<var:string value="applicationPath" />';
          var ResourcesURL = '/SOGo.woa/WebServerResources';
-         var UserLogin = '<var:string value="shortUserNameForDisplay" />';
+         <var:if condition="shortUserNameForDisplay" const:value="anonymous"
+           const:negate="YES"
+           >var UserFolderURL = '<var:string value="userFolderPath" />';
+         var UserLogin = '<var:string value="shortUserNameForDisplay" />';</var:if>
        </script>
-
-       <script type="text/javascript" rsrc:src="_IEtoW3C.js"><!-- space required --></script>
        <script type="text/javascript" rsrc:src="events.js"><!-- space required --></script>
        <script type="text/javascript" rsrc:src="prototype.js"><!-- space required --></script>
        <script type="text/javascript" rsrc:src="JavascriptAPIExtensions.js"><!-- space required --></script>
        <script type="text/javascript" rsrc:src="generic.js"><!-- space required --></script>
        <script type="text/javascript" rsrc:src="SOGoDragAndDrop.js"><!-- space required --></script>
        <script type="text/javascript" rsrc:src="SOGoDragHandles.js"><!-- space required --></script>
-       <var:if condition="hasProductSpecificJavaScript"
-         ><script type="text/javascript" var:src="productJavaScriptURL"><!-- space required --></script
-           ></var:if>
-       <var:if condition="hasPageSpecificJavaScript"
-         ><script type="text/javascript" var:src="pageJavaScriptURL"> <!-- space required --></script
-           ></var:if>
+       <var:if condition="hasProductSpecificJavaScript"><script type="text/javascript"
+           var:src="productJavaScriptURL"><!-- space required --></script></var:if>
+       <var:if condition="hasPageSpecificJavaScript"><script type="text/javascript"
+           var:src="pageJavaScriptURL"><!-- space required --></script></var:if>
        <var:js-stringtable
          var:framework="productFrameworkName"
          const:identifier="labels" />
        <var:js-stringtable
          const:identifier="clabels" />
 
-       <var:if condition="isPopup" const:negate="YES"
-         ><var:if condition="context.isUIxDebugEnabled"
-           ><div id="logConsole"><!-- space --></div></var:if>
-
-         <div id="linkBanner" class="linkbanner">
-           <a id="logoff" var:href="logoffPath"
-             ><var:string label:value="Logoff" /></a>
-           <a var:href="relativeCalendarPath"
-             ><var:string label:value="Calendar" /></a> |
-           <a var:href="relativeContactsPath"
-             ><var:string label:value="Address Book" /></a> |
-           <a var:href="relativeMailPath"
-             ><var:string label:value="Mail" /></a> |
-           <a var:href="relativePreferencesPath"
-             ><var:string label:value="Preferences" /></a>
-           <var:if condition="context.isUIxDebugEnabled"
-             >| <a href="#"><var:string
-                 label:value="Log Console (dev.)" /></a
-               ></var:if>
-         </div>
-       </var:if
-         
-         ><var:component className="UIxToolbar" var:toolbar="toolbar"
-         />
-
+       <var:if condition="shortUserNameForDisplay" const:value="anonymous"
+         const:negate="YES"
+         ><var:if condition="isPopup" const:negate="YES"
+           ><var:if condition="context.isUIxDebugEnabled"
+             ><div id="logConsole"><!-- space --></div></var:if>
+           <div id="linkBanner" class="linkbanner">
+             <a id="logoff" var:href="logoffPath"
+               ><var:string label:value="Logoff" /></a>
+             <a var:href="relativeCalendarPath"
+               ><var:string label:value="Calendar" /></a> |
+             <a var:href="relativeContactsPath"
+               ><var:string label:value="Address Book" /></a> |
+             <a var:href="relativeMailPath"
+               ><var:string label:value="Mail" /></a> |
+             <a var:href="relativePreferencesPath"
+               ><var:string label:value="Preferences" /></a>
+             <var:if condition="context.isUIxDebugEnabled"
+               >| <a href="#"><var:string
+                   label:value="Log Console (dev.)" /></a
+                 ></var:if>
+           </div>
+         </var:if
+           ><var:component className="UIxToolbar" var:toolbar="toolbar"
+           />
+       </var:if>
+       
        <div class="pageContent"
          ><var:component-content
            /></div>
index 69aa6bd5e8e4f77662fc414127c1ddfe5fea0a6a..a1cf862cf22b4333afc6893d413f014e955ceb5a 100644 (file)
@@ -235,7 +235,7 @@ String.prototype.base64encode = function () {
   var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
   var i = 0;
  
-  var input = this._base64_utf8_encode();
+  var input = this.utf8encode();
 
   while (i < input.length) {
     chr1 = input.charCodeAt(i++);
@@ -289,10 +289,10 @@ String.prototype.base64decode = function() {
     }
   }
 
-  return output._base64_utf8_decode();
+  return output.utf8decode();
 };
 
-String.prototype._base64_utf8_encode = function() {
+String.prototype.utf8encode = function() {
   var string = this.replace(/\r\n/g,"\n");
   var utftext = "";
  
@@ -316,7 +316,7 @@ String.prototype._base64_utf8_encode = function() {
   return utftext;
 };
 
-String.prototype._base64_utf8_decode = function() {
+String.prototype.utf8decode = function() {
   var string = "";
   var i = 0;
   var c = c1 = c2 = 0;
index 1327b24542de522460fd8b3c3121c2db37fdb9b7..09814bc5536eff9ac4d27ef2d4340c52a8ee5a72 100644 (file)
@@ -153,7 +153,7 @@ function mailListMarkMessage(event) {
 
   if (http) {
     // TODO: add parameter to signal that we are only interested in OK
-    http.open("POST", url + "&jsonly=1", false /* not async */);
+    http.open("POST", url, false /* not async */);
     http.send("");
     if (http.status != 200) {
       // TODO: refresh page?
@@ -229,11 +229,11 @@ function uixDeleteSelectedMessages(sender) {
     /* send AJAX request (synchronously) */
 
     var messageId = currentMailbox + "/" + rowId;
-    url = ApplicationBaseURL + messageId + "/trash?jsonly=1";
+    url = ApplicationBaseURL + messageId + "/trash";
     http = createHTTPClient();
     http.open("POST", url, false /* not async */);
     http.send("");
-    if (http.status != 200) { /* request failed */
+    if (!isHttpStatus204(http.status)) { /* request failed */
       failCount++;
       http = null;
       continue;
@@ -270,7 +270,7 @@ function moveMessages(rowIds, folder) {
          
     var messageId = currentMailbox + "/" + rowIds[i];
     url = (ApplicationBaseURL + messageId
-          + "/move?jsonly=1&tofolder=" + folder);
+          + "/move?tofolder=" + folder);
     http = createHTTPClient();
     http.open("GET", url, false /* not async */);
     http.send("");
@@ -1089,6 +1089,7 @@ function initMailboxTree() {
   mailboxTree.add(0, -1, '');
 
   mailboxTree.pendingRequests = mailAccounts.length;
+  activeAjaxRequests += mailAccounts.length;
   for (var i = 0; i < mailAccounts.length; i++) {
     var url = ApplicationBaseURL + "/" + mailAccounts[i] + "/mailboxes";
     triggerAjaxRequest(url, onLoadMailboxesCallback, mailAccounts[i]);
@@ -1203,14 +1204,17 @@ function updateMailboxMenus() {
 function onLoadMailboxesCallback(http) {
   if (http.readyState == 4
       && http.status == 200) {
+    checkAjaxRequestsState();
     var newAccount = buildMailboxes(http.callbackData,
                                    http.responseText);
     accounts[http.callbackData] = newAccount;
     mailboxTree.addMailAccount(newAccount);
     mailboxTree.pendingRequests--;
+    activeAjaxRequests--;
     if (!mailboxTree.pendingRequests) {
       updateMailboxTreeInPage();
       updateMailboxMenus();
+      checkAjaxRequestsState();
     }
   }
 
@@ -1297,8 +1301,16 @@ function onMenuExpungeFolder(event) {
 function onMenuEmptyTrash(event) {
   var folderID = document.menuTarget.getAttribute("dataname");
   var urlstr = URLForFolderID(folderID) + "/emptyTrash";
-
   triggerAjaxRequest(urlstr, folderRefreshCallback, folderID);
+
+  if (folderID == currentMailbox) {
+    var div = $('messageContent');
+    for (var i = div.childNodes.length - 1; i > -1; i--)
+      div.removeChild(div.childNodes[i]);
+  }
+  var msgID = currentMessages[folderID];
+  if (msgID)
+    deleteCachedMessage(folderID + "/" + msgID);
 }
 
 function folderOperationCallback(http) {
index ee7ab9448a9041e6652f872ac7a9b81eda502095..fa534ef43669de1cba0c4ab17dc9dfdda1569e7f 100644 (file)
@@ -1,6 +1,12 @@
 BODY
 { background-color: #999; }
 
+IMG#preparedAnimation
+{ 
+  width: 0px;
+  height: 0px;
+}
+
 DIV#loginScreen
 {
   background-color: #d4d0c8;
@@ -8,8 +14,8 @@ DIV#loginScreen
   margin-top: 5em;
   padding: 10px;
   border: 2px solid transparent;
-  width: 158px;
-  height: 250px;
+  width: 197px;
+  height: 300px;
   -moz-border-top-colors: #efebe7 #fff;
   -moz-border-left-colors: #efebe7 #fff;
   -moz-border-right-colors: #000 #9c9a94 transparent;
@@ -17,10 +23,14 @@ DIV#loginScreen
 }
 
 DIV#loginScreen IMG
-{ border: 1px solid #999; }
+{ border: 0px;
+  margin: 0px;
+  padding: 0px;
+  height: 192px;
+  width: 192px; }
 
-DIV#loginScreen INPUT
-{ width: 100%; }
+DIV#loginScreen INPUT.textField
+{ width: 187px; }
 
 DIV#loginButton
 { text-align: right; }
@@ -31,6 +41,8 @@ DIV#loginButton INPUT
 
 DIV#loginButton IMG#progressIndicator
 { float: left;
+  width: 16px;
+  height: 16px;
   border: 0px none;
   margin-top: 5px;
   margin-left: 5px; }
index 7e311008d916f99fc03c21540853fb6c7835b86f..a225d3eb052e53c590295d90233aa378324336b1 100644 (file)
@@ -1,16 +1,41 @@
 function initLogin() {
+  var date = new Date();
+  date.setTime(date.getTime() - 86400000);
+  document.cookie = ("0xHIGHFLYxSOGo-0.9=discard; path=/"
+                    + "; expires=" + date.toGMTString());
   var submit = $("submit");
+  Event.observe(submit, "click", onLoginClick);
+
   var userName = $("userName");
   userName.focus();
-  Event.observe(submit, "click", onLoginClick);
+
+  var image = $("preparedAnimation");
+  image.parentNode.removeChild(image);
 }
 
 function onLoginClick(event) {
   startAnimation($("loginButton"), $("submit"));
 
-  var loginString = $("userName").value + ":" + $("password").value;
-  document.cookie = ("0xHIGHFLYxSOGo-0.9 = basic" + loginString.base64encode()
-                    + "; path=/");
+  var userName = $("userName").value;
+  var password = $("password").value;
+
+  if (userName.length > 0) {
+    var url = ($("connectForm").getAttribute("action")
+              + "?userName=" + userName
+              + "&password=" + password);
+    document.cookie = "";
+    triggerAjaxRequest(url, onLoginCallback);
+  }
+
+  preventDefault(event);
+}
+
+function onLoginCallback(http) {
+  if (http.readyState == 4) {
+    if (http.status == 204) {
+      window.location.href = ApplicationBaseURL + $("userName").value;
+    }
+  }
 }
 
 addEvent(window, 'load', initLogin);
index 608947f61cb78ce1e820adfce37f1e5a6d76d4d0..1dc5f4222bff60993b0b03ab839cec88a66c863e 100644 (file)
@@ -1260,24 +1260,23 @@ function loadPreferences() {
 }
 
 function onLoadHandler(event) {
-   if (!document.body.hasClassName("loginPage")) {
-     loadPreferences();
-   }
-   queryParameters = parseQueryParameters('' + window.location);
-   if (!$(document.body).hasClassName("popup")) {
-      initLogConsole();
-   }
-   initCriteria();
-   configureSearchField();
-   initMenus();
-   initTabs();
-   configureDragHandles();
-   configureSortableTableHeaders();
-   configureLinkBanner();
-   var progressImage = $("progressIndicator");
-   if (progressImage)
-      progressImage.parentNode.removeChild(progressImage);
-   Event.observe(document.body, "contextmenu", onBodyClickContextMenu);
+  if (typeof UserLogin != "undefined")
+    loadPreferences();
+  queryParameters = parseQueryParameters('' + window.location);
+  if (!$(document.body).hasClassName("popup")) {
+    initLogConsole();
+  }
+  initCriteria();
+  configureSearchField();
+  initMenus();
+  initTabs();
+  configureDragHandles();
+  configureSortableTableHeaders();
+  configureLinkBanner();
+  var progressImage = $("progressIndicator");
+  if (progressImage)
+    progressImage.parentNode.removeChild(progressImage);
+  Event.observe(document.body, "contextmenu", onBodyClickContextMenu);
 }
 
 function onBodyClickContextMenu(event) {