]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1207 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 31 Oct 2007 15:57:07 +0000 (15:57 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 31 Oct 2007 15:57:07 +0000 (15:57 +0000)
20 files changed:
ChangeLog
Scripts/sogo-init.d-redhat
SoObjects/Mailer/GNUmakefile
SoObjects/Mailer/SOGoDraftsFolder.h
SoObjects/Mailer/SOGoMailAccount.m
SoObjects/Mailer/SOGoMailBaseObject.h
SoObjects/Mailer/SOGoMailBaseObject.m
SoObjects/Mailer/SOGoMailFolder.h
SoObjects/Mailer/SOGoMailFolder.m
SoObjects/Mailer/SOGoSentFolder.h [new file with mode: 0644]
SoObjects/Mailer/SOGoSentFolder.m [new file with mode: 0644]
SoObjects/Mailer/SOGoTrashFolder.h
SoObjects/SOGo/SOGoUser.m
UI/Common/English.lproj/Localizable.strings
UI/Common/French.lproj/Localizable.strings
UI/MailPartViewers/UIxMailPartTextViewer.m
UI/MainUI/English.lproj/Localizable.strings
UI/MainUI/French.lproj/Localizable.strings
UI/Templates/MainUI/SOGoRootPage.wox
UI/Templates/UIxPageFrame.wox

index d47cf7cb0284b9ed4cf8b4cecce5407ed68cf01a..a2ec7f33907cf06b452e7ad270b1ed60a9eba9a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2007-10-31  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * SoObjects/Mailer/SOGoMailFolder.[hm]: added a new subclass of
+       SOGoMailFolder: SOGoMailSpecialFolder.
+
+       * SoObjects/Mailer/SOGoMailAccount.m ([SOGoMailAccount
+       -traversalFromMailAccount]): overridden method that returns the
+       initialized mutable string.
+       ([SOGoMailAccount -allFolderPaths]): take the special folder paths
+       with -traversalFromMailAccount and reposition them at the
+       beginning of the list. By creating the special folders during that
+       request, we also make sure that the folder exists thanks to the
+       new initialisation method of the new "SOGoSpecialMailFolder"
+       class.
+       ([SOGoMailAccount -lookupSentFolder:_keyinContext:_ctx]): new
+       method.
+       ([SOGoMailAccount -lookupTrashFolder:_keyinContext:_ctx]): new
+       method.
+       ([SOGoMailAccount -lookupName:_keyinContext:acquire:_flag]): no
+       longer use lookupImap4Folder.
+       ([SOGoMailAccount -lookupImap4Folder:_keyinContext:_ctx]): removed
+       method.
+
+       * SoObjects/Mailer/SOGoMailBaseObject.m ([SOGoMailBaseObject
+       -traversalFromMailAccount]): new method that returns the full
+       IMAP4 path to the object.
+
+       * SoObjects/SOGo/SOGoUser.m ([SOGoUser +initialize]): retain
+       "superUsernames" after fetching it from the ud.
+
 2007-10-30  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions
index e2182e651f3eccfb171eebbcdf3fc1875fd43dd8..def0f10df899d988c2cd5d0181b065a0fe992cb6 100755 (executable)
@@ -77,13 +77,16 @@ fi
 case "$1" in
   start)
        echo -n $"Starting $DESC: "
-       daemon su - sogo -c $DAEMON
+       for ((a=1; a <= PREFORK ; a++))
+       do
+         daemon su - sogo -c "$DAEMON $a"
+       done
 #      daemon --user sogo --pidfile $PIDFILE $DAEMON
        echo "$NAME."
        ;;
   stop)
        echo -n $"Stopping $DESC: "
-       killproc `basename $REAL_DAEMON` && rm -f $PIDFILE
+       killproc `basename $REAL_DAEMON` && rm -f ${PIDFILE}*
 #      killproc -p $PIDFILE $REAL_DAEMON && rm -f $PIDFILE
        echo "$NAME."
        ;;
index bd94d2e0e23bd849b2e18d05476c59c42e71e2dc..82e9dfb1f9c846dcb048175a20e048fa061e4721 100644 (file)
@@ -18,7 +18,10 @@ Mailer_OBJC_FILES += \
        SOGoMailFolder.m                \
        SOGoSharedInboxFolder.m         \
        SOGoMailObject.m                \
+       SOGoDraftObject.m               \
        SOGoMailObject+Draft.m          \
+       SOGoSentFolder.m                \
+       SOGoDraftsFolder.m              \
        SOGoTrashFolder.m               \
        \
        SOGoMailBodyPart.m              \
@@ -27,9 +30,6 @@ Mailer_OBJC_FILES += \
        SOGoCalendarMailBodyPart.m      \
        SOGoVCardMailBodyPart.m         \
        \
-       SOGoDraftsFolder.m              \
-       SOGoDraftObject.m               \
-       \
        SOGoMailForward.m               \
        \
        NSData+Mail.m                   \
index ea97a6f61257971a77de6c9e71b27fc021689d55..4c260d12fc233952c11b6b3a890ebdb355186a6b 100644 (file)
@@ -24,7 +24,7 @@
 
 @class SOGoDraftObject;
 
-@interface SOGoDraftsFolder : SOGoMailFolder
+@interface SOGoDraftsFolder : SOGoSpecialMailFolder
 
 - (SOGoDraftObject *) newDraft;
 - (BOOL) isInDraftsFolder;
index aa2f1d05cb7ddcb53c8a5c3a1936a68f6e23ed8b..25b99b70bdb1af4af7a8b69370244f017c63764c 100644 (file)
@@ -32,6 +32,7 @@
 #import <NGExtensions/NSNull+misc.h>
 #import <NGImap4/NGImap4Connection.h>
 
+#import <SoObjects/SOGo/NSArray+Utilities.h>
 #import <SoObjects/SOGo/SOGoUser.h>
 
 #import "SOGoMailFolder.h"
@@ -163,7 +164,7 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default
       [folders removeObjectsInArray: additionalFolders];
       [folders addObjectsFromArray: additionalFolders];
     }
-
+  
   return folders;
 }
 
@@ -178,13 +179,21 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default
 {
   NSMutableArray *newFolders;
   NSArray *rawFolders, *mainFolders;
+  NSString *realDraftsFolderName, *realSentFolderName, *realTrashFolderName;
 
-  rawFolders = [[self imap4Connection]
-                allFoldersForURL: [self imap4URL]];
+  rawFolders = [[self imap4Connection] allFoldersForURL: [self imap4URL]];
 
-#warning FIXME: the folder names should be prefixed
-  mainFolders = [NSArray arrayWithObjects: inboxFolderName, draftsFolderName,
-                        sentFolder, trashFolder, nil];
+  realDraftsFolderName
+    = [[self draftsFolderInContext: context] traversalFromMailAccount];
+  realSentFolderName
+    = [[self sentFolderInContext: context] traversalFromMailAccount];
+  realTrashFolderName
+    = [[self trashFolderInContext: context] traversalFromMailAccount];
+
+  mainFolders = [NSArray arrayWithObjects: inboxFolderName,
+                        realDraftsFolderName,
+                        realSentFolderName,
+                        realTrashFolderName, nil];
   newFolders = [NSMutableArray arrayWithArray: rawFolders];
   [newFolders removeObjectsInArray: mainFolders];
   [newFolders sortUsingSelector: @selector (caseInsensitiveCompare:)];
@@ -247,6 +256,11 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default
   return urlString;
 }
 
+- (NSMutableString *) traversalFromMailAccount
+{
+  return [NSMutableString string];
+}
+
 - (NSString *) imap4Login
 {
   return [[self imap4URL] user];
@@ -274,15 +288,11 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default
   return folder;
 }
 
-- (id) lookupImap4Folder: (NSString *) _key
-              inContext: (id) _cx
+- (id) lookupSentFolder: (NSString *) _key
+             inContext: (id) _ctx
 {
-  NSString *s;
-
-  s = [_key isEqualToString: [self trashFolderNameInContext:_cx]]
-    ? @"SOGoTrashFolder" : @"SOGoMailFolder";
-  
-  return [self lookupFolder:_key ofClassNamed:s inContext:_cx];
+  return [self lookupFolder: _key ofClassNamed: @"SOGoSentFolder" 
+              inContext: _ctx];
 }
 
 - (id) lookupDraftsFolder: (NSString *) _key
@@ -292,6 +302,13 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default
               inContext: _ctx];
 }
 
+- (id) lookupTrashFolder: (NSString *) _key
+              inContext: (id) _ctx
+{
+  return [self lookupFolder: _key ofClassNamed: @"SOGoTrashFolder" 
+              inContext: _ctx];
+}
+
 - (id) lookupFiltersFolder: (NSString *) _key inContext: (id) _ctx
 {
   return [self lookupFolder:_key ofClassNamed:@"SOGoSieveScriptsFolder" 
@@ -308,12 +325,17 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default
     {
   // TODO: those should be product.plist bindings? (can't be class bindings
   //       though because they are 'per-account')
-      if ([_key isEqualToString: [self draftsFolderNameInContext: _ctx]])
+      if ([_key isEqualToString: [self sentFolderNameInContext: _ctx]])
+       obj = [self lookupSentFolder: _key inContext: _ctx];
+      else if ([_key isEqualToString: [self draftsFolderNameInContext: _ctx]])
        obj = [self lookupDraftsFolder: _key inContext: _ctx];
-      else if ([_key isEqualToString: [self sieveFolderNameInContext: _ctx]])
-       obj = [self lookupFiltersFolder: _key inContext: _ctx];
+      else if ([_key isEqualToString: [self trashFolderNameInContext: _ctx]])
+       obj = [self lookupTrashFolder: _key inContext: _ctx];
+//       else if ([_key isEqualToString: [self sieveFolderNameInContext: _ctx]])
+//     obj = [self lookupFiltersFolder: _key inContext: _ctx];
       else
-       obj = [self lookupImap4Folder: _key inContext: _ctx];
+       obj = [self lookupFolder: _key ofClassNamed: @"SOGoMailFolder"
+                   inContext: _ctx];
     }
   else
     obj = [super lookupName: _key inContext: _ctx acquire: NO];
index ec2d8baaac27e2f85cffb5e7d3b289fb9297b473..1faecb77f5338380ca2d1562a9ddcec1b7252317 100644 (file)
@@ -64,6 +64,7 @@
 
 - (NSString *) relativeImap4Name;
 - (NSMutableString *) imap4URLString;
+- (NSMutableString *) traversalFromMailAccount;
 
 - (NSURL *) imap4URL;
 - (NSString *) imap4Login;
index e6c2260d4c24e8556fb26d438bbc37a5513e9321..60d6c22aead6abcccb09476682b133e5a87d531a 100644 (file)
@@ -186,6 +186,16 @@ static BOOL debugOn = YES;
   return [[self authenticatorInContext: context] passwordInContext: context];
 }
 
+- (NSMutableString *) traversalFromMailAccount
+{
+  NSMutableString *currentTraversal;
+
+  currentTraversal = [container traversalFromMailAccount];
+  [currentTraversal appendFormat: @"/%@", [self relativeImap4Name]];
+
+  return currentTraversal;
+}
+
 - (void)flushMailCaches {
   [[self mailManager] flushCachesForURL:[self imap4URL]];
 }
index 3de6f3ee8c90ddd6070b5ddd28be3c390062f2e6..6ad7defa99241949d15b2bafefbea6e565fee0ef 100644 (file)
 
 - (NSArray *) subfolders;
 
+- (BOOL) isSpecialFolder;
+
 - (NSArray *) allFolderPaths;
 - (NSArray *) allFolderURLs;
 
 @end
 
+@interface SOGoSpecialMailFolder : SOGoMailFolder
+
+- (BOOL) isSpecialFolder;
+
+@end
+
 #endif /* __Mailer_SOGoMailFolder_H__ */
index ec66e36694da2402e7f754ab5ed045007eaa25b3..15f5b660ba2a8036e0308e95183e259cec26238b 100644 (file)
@@ -133,6 +133,11 @@ static NSString *defaultUserID =  @"anyone";
   return [[self imap4Connection] subfoldersForURL: [self imap4URL]];
 }
 
+- (BOOL) isSpecialFolder
+{
+  return NO;
+}
+
 - (NSArray *) allFolderPaths
 {
   NSMutableArray *deepSubfolders;
@@ -688,3 +693,26 @@ static NSString *defaultUserID =  @"anyone";
 }
 
 @end /* SOGoMailFolder */
+
+@implementation SOGoSpecialMailFolder
+
+- (id) initWithName: (NSString *) newName
+       inContainer: (id) newContainer
+{
+  if ((self = [super initWithName: newName
+                    inContainer: newContainer]))
+    {
+      if (![[self imap4Connection] doesMailboxExistAtURL: [self imap4URL]])
+       [imap4 createMailbox: [self relativeImap4Name]
+              atURL: [newContainer imap4URL]];
+    }
+
+  return self;
+}
+
+- (BOOL) isSpecialFolder
+{
+  return YES;
+}
+
+@end
diff --git a/SoObjects/Mailer/SOGoSentFolder.h b/SoObjects/Mailer/SOGoSentFolder.h
new file mode 100644 (file)
index 0000000..18c360f
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+  Copyright (C) 2005 SKYRIX Software AG
+
+  This file is part of OpenGroupware.org.
+
+  OGo is free software; you can redistribute it and/or modify it under
+  the terms of the GNU Lesser General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with OGo; see the file COPYING.  If not, write to the
+  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+*/
+
+#ifndef __Mailer_SOGoSentFolder_H__
+#define __Mailer_SOGoSentFolder_H__
+
+#import "SOGoMailFolder.h"
+
+@interface SOGoSentFolder : SOGoSpecialMailFolder
+@end
+
+#endif /* __Mailer_SOGoSentFolder_H__ */
diff --git a/SoObjects/Mailer/SOGoSentFolder.m b/SoObjects/Mailer/SOGoSentFolder.m
new file mode 100644 (file)
index 0000000..92648a7
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+  Copyright (C) 2005 SKYRIX Software AG
+
+  This file is part of OpenGroupware.org.
+
+  OGo is free software; you can redistribute it and/or modify it under
+  the terms of the GNU Lesser General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with OGo; see the file COPYING.  If not, write to the
+  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+*/
+
+#import <Foundation/NSString.h>
+
+#import "SOGoSentFolder.h"
+
+@implementation SOGoSentFolder
+
+/* folder type */
+
+- (NSString *)outlookFolderClass {
+  return @"IPF.Sent";
+}
+
+@end /* SOGoSentFolder */
index d097490a4d2c892b57caf03c3cff6d192dc4321f..5d14947f1a039949fe126b3ecc316d9cc1b8b4b7 100644 (file)
@@ -24,7 +24,7 @@
 
 #import "SOGoMailFolder.h"
 
-@interface SOGoTrashFolder : SOGoMailFolder
+@interface SOGoTrashFolder : SOGoSpecialMailFolder
 @end
 
 #endif /* __Mailer_SOGoTrashFolder_H__ */
index f3a0633ac7622ff4814c126d554c8fcaae65b6c3..708ed4f96e564a80f524da4e4589cfeb7a0d363b 100644 (file)
@@ -98,9 +98,7 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
        ASSIGN (defaultLanguage, @"English");
     }
   if (!superUsernames)
-    {
-      superUsernames = [ud arrayForKey: @"SOGoSuperUsernames"];
-    }
+    ASSIGN (superUsernames, [ud arrayForKey: @"SOGoSuperUsernames"]);
 
   acceptAnyUser = ([[ud stringForKey: @"SOGoAuthentificationMethod"]
                     isEqualToString: @"bypass"]);
index 1ae7857ef3857007c8a73bb4061e19d9515b4c2c..d7c1eb9b7c34b4bea361d814aa1872e3f1949766 100644 (file)
@@ -10,7 +10,7 @@
 "Address Book" = "Address Book";
 "Mail" = "Mail";
 "Preferences" = "Preferences";
-"Sign Out" = "Sign Out";
+"Disconnect" = "Disconnect";
 "Right Administration" = "Right Administration";
 "Log Console (dev.)" = "Log Console (dev.)";
 
index 2de07b5c9be2c93fbdddbe0e92abfe502b84f3fe..257db60d74b288c67cf7405bc89e30910b6164aa 100644 (file)
@@ -8,7 +8,7 @@
 "Address Book" = "Carnet d'adresses";
 "Mail" = "Courrier";
 "Preferences" = "Préférences";
-"Sign Out" = "Quitter";
+"Disconnect" = "Quitter";
 "Right Administration" = "Partage";
 "Log Console (dev.)" = "Journal (dév.)";
 
index 22d41a38665b0fe4d5b649f11609d91b2969f1cd..450c14217673352a06b833c05d8f129fb2a2d82b 100644 (file)
@@ -44,6 +44,8 @@
   content = [NSMutableString string];
   superContent = [[super flatContentAsString] stringByEscapingHTMLString];
   [content appendString: [superContent stringByDetectingURLs]];
+  [content replaceString: @"\r\n" withString: @"<br />"];
+  [content replaceString: @"\n" withString: @"<br />"];
 
   return content;
 }
index 9cc6c319a96b87c0053d810e762a61bf160f76a5..534d91a00d8acb07117ebca30d8c90155bbf613f 100644 (file)
@@ -2,7 +2,7 @@
 
 "title" = "SOGo";
 
-"Login:" = "Login:";
+"Username:" = "Username:";
 "Password:" = "Password:";
 
 "Connect" = "Connect";
index 2cd2ec0693b72eaacc977f26272f2f3af94e299c..b22b0c9e37e1f0b1ef9e451c38fa04af3aa395c9 100644 (file)
@@ -2,7 +2,7 @@
 
 "title" = "SOGo";
 
-"Login:" = "Nom d'utilisateur :";
+"Username:" = "Nom d'utilisateur :";
 "Password:" = "Mot de passe :";
 
 "Connect" = "Connexion";
index 78353a75b2b6e87e430ad0391263f9b5015c805d..3eaf672a3a66be43a9557b2ea8c88d7626d40a3f 100644 (file)
@@ -13,7 +13,7 @@
       <img id="splash" rsrc:src="lori-login.jpg"/><br/><br/>
       <var:if condition="shortUserNameForDisplay" const:value="wrongusernamepassword"
       ><p class="error"><var:string label:value="Wrong username or password."/></p>
-      </var:if><label><var:string label:value="Login:"/><br/>
+      </var:if><label><var:string label:value="Username:"/><br/>
        <input class="textField" id="userName" name="userName"
          type="text" var:value="userName" /></label><br/>
       <label><var:string label:value="Password:"/><br/>
index 837071a8575e1e600cc347f115991710643a7f58..9e38a12179ad32ce9778effbdb42d9b087818ee6 100644 (file)
@@ -45,7 +45,7 @@
                  ><div id="logConsole"><!-- space --></div></var:if>
                <div id="linkBanner" class="linkbanner">
                  <a id="logoff" var:href="logoffPath"
-                   ><var:string label:value="Sign Out" /></a>
+                   ><var:string label:value="Disconnect" /></a>
                  <a var:href="relativeCalendarPath"
                    ><var:string label:value="Calendar" /></a> |
                  <a var:href="relativeContactsPath"