]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@93 d1b88da0-ebda-0310-925b-ed51d8...
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 30 Jun 2004 08:20:19 +0000 (08:20 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 30 Jun 2004 08:20:19 +0000 (08:20 +0000)
SOGo/Main/GNUmakefile
SOGo/Main/README [new file with mode: 0644]
SOGo/Main/SOGoRootPage.m [new file with mode: 0644]
SOGo/Main/SOGoRootPage.wox [new file with mode: 0644]
SOGo/Main/product.plist
SOGo/Main/sogod.m

index ffdb1401a0bfe8921218e9dbda9328607a8861e1..b47ba64eada6d800369053535fab5df0a0e1460c 100644 (file)
@@ -8,10 +8,14 @@ sogod_OBJC_FILES += \
        sogod.m                 \
        SOGoProductLoader.m     \
        SOGoAuthenticator.m     \
+       \
+       SOGoRootPage.m          \
 
-sogod_RESOURCE_FILES += \
-       Version         \
-       product.plist   \
+sogod_RESOURCE_FILES +=        \
+       Version                 \
+       product.plist           \
+       \
+       SOGoRootPage.wox        \
 
 sogod_WEBSERVER_RESOURCE_FILES += 
 
diff --git a/SOGo/Main/README b/SOGo/Main/README
new file mode 100644 (file)
index 0000000..4441bfe
--- /dev/null
@@ -0,0 +1,12 @@
+# $Id$
+
+SOGo
+====
+
+Master Daemon, loads the functionality from product bundles in Library/SOGo.
+
+Setup
+=====
+
+  Defaults write sogod NGBundlePath '""'
+  => otherwise some bundles will clash with "fat" OGo
diff --git a/SOGo/Main/SOGoRootPage.m b/SOGo/Main/SOGoRootPage.m
new file mode 100644 (file)
index 0000000..80d25ac
--- /dev/null
@@ -0,0 +1,75 @@
+// $Id$
+
+#include <NGObjWeb/SoComponent.h>
+
+@interface SOGoRootPage : SoComponent
+{
+  NSString *userName;
+}
+
+@end
+
+#include "common.h"
+
+@implementation SOGoRootPage
+
+- (id)initWithContext:(id)_ctx {
+  if ((self = [super initWithContext:_ctx])) {
+  }
+  return self;
+}
+
+- (void)dealloc {
+  [self->userName release];
+  [super dealloc];
+}
+
+/* accessors */
+
+- (void)setUserName:(NSString *)_value {
+  ASSIGNCOPY(self->userName, _value);
+}
+- (NSString *)userName {
+  return self->userName;
+}
+
+/* actions */
+
+- (id)connectAction {
+  NSString *url;
+  
+  [self takeFormValuesForKeys:@"userName", nil];
+  
+  if ([[self userName] length] == 0)
+    return nil;
+  
+  url = [@"/" stringByAppendingString:[[self userName] stringByEscapingURL]];
+  if (![url hasSuffix:@"/"])
+    url = [url stringByAppendingString:@"/"];
+  
+  url = [[self context] urlWithRequestHandlerKey:@"so" 
+                       path:url queryString:nil];
+  return [self redirectToLocation:url];
+}
+
+/* response generation */
+
+- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
+  NSString *rhk;
+  
+  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;
+  }
+  
+  [super appendToResponse:_response inContext:_ctx];
+}
+
+@end /* SOGoRootPage */
diff --git a/SOGo/Main/SOGoRootPage.wox b/SOGo/Main/SOGoRootPage.wox
new file mode 100644 (file)
index 0000000..771354c
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version='1.0' standalone='yes'?>
+<html
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:var="http://www.skyrix.com/od/binding"
+  xmlns:const="http://www.skyrix.com/od/constant"
+>
+  <head>
+    <title>Scalable OGo Homepage</title>
+  </head>
+
+  <body>
+    <h3>Scalable OGo Homepage</h3>
+
+    <form href="connect">
+      Login:
+      <input name="userName" type="text" var:value="userName" />
+      <input name="submit" type="submit" value="connect" />
+    </form>
+  </body>
+</html>
index f8c27189bab5eaeabb45ced18c8077abda2183a9..cbec188ce0105a667de7802461f5981d2bd1c94c 100644 (file)
         "WebDAV Access" = "Authenticated";
       };
       methods = {
+        index = { 
+          protectedBy = "View";
+          pageName    = "SOGoRootPage"; 
+        };
+        GET = { // more or less a hack, see README of dbd
+          protectedBy = "View";
+          pageName    = "SOGoRootPage"; 
+        };
+        connect = { 
+          protectedBy = "View";
+          pageName    = "SOGoRootPage"; 
+          actionName  = "connect";
+        };
       };
     };
   };
index 82b95fd4de6c0104f16aba498ae8e45a740bf568..94bbd390c928ecf92ac2fa218bbcb3b477a903a6 100644 (file)
@@ -56,11 +56,13 @@ static unsigned int vMemSizeLimit = 0;
   if ((self = [super init])) {
     [[SOGoProductLoader productLoader] loadProducts];
 
+#if 0 /* enable, if we added the value class */
     /* setup some WebDAV type mappings required for Evolution */
     [EOQualifier registerValueClass:NSClassFromString(@"dateTime")
                 forTypeName:@"dateTime"];
     [EOQualifier registerValueClass:NSClassFromString(@"dateTime")
                 forTypeName:@"dateTime.tz"];
+#endif
     
   }
   return self;