mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-08 09:55:09 +00:00
Monotone-Parent: 3972d71b4e36835c89743644fadfbba2dbb04d93
Monotone-Revision: aef31cd9268feda455bc506f04dcaee7b64ed80d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-18T15:37:37 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -19,14 +19,19 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
#import <NGLdap/NGLdapConnection.h>
|
||||
#import "SOGoPermissions.h"
|
||||
|
||||
#import "LDAPUserManager.h"
|
||||
#import "SOGoPermissions.h"
|
||||
#import "SOGoUser.h"
|
||||
|
||||
#import "SOGoAuthenticator.h"
|
||||
#import "SOGoUser.h"
|
||||
#import "common.h"
|
||||
|
||||
@implementation SOGoAuthenticator
|
||||
|
||||
@@ -79,6 +84,23 @@
|
||||
&& [_pwd isEqualToString: @"freebusy"]));
|
||||
}
|
||||
|
||||
- (NSString *) _passwordInContext: (WOContext *) context
|
||||
{
|
||||
NSString *auth, *password;
|
||||
NSArray *creds;
|
||||
|
||||
password = nil;
|
||||
auth = [[context request] headerForKey:@"authorization"];
|
||||
if (auth)
|
||||
{
|
||||
creds = [self parseCredentials: auth];
|
||||
if ([creds count] > 1)
|
||||
password = [creds objectAtIndex: 1];
|
||||
}
|
||||
|
||||
return password;
|
||||
}
|
||||
|
||||
/* create SOGoUser */
|
||||
|
||||
- (SOGoUser *) userInContext: (WOContext *)_ctx
|
||||
@@ -109,8 +131,11 @@
|
||||
user = anonymous;
|
||||
}
|
||||
else
|
||||
user = [SOGoUser userWithLogin: login
|
||||
roles: [self rolesForLogin: login]];
|
||||
{
|
||||
user = [SOGoUser userWithLogin: login
|
||||
roles: [self rolesForLogin: login]];
|
||||
[user setCurrentPassword: [self _passwordInContext: _ctx]];
|
||||
}
|
||||
}
|
||||
else
|
||||
user = nil;
|
||||
|
||||
@@ -19,9 +19,16 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <NGObjWeb/NSException+HTTP.h>
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <GDLContentStore/GCSFolder.h>
|
||||
|
||||
#import "common.h"
|
||||
#import "SOGoFolder.h"
|
||||
#import "SOGoUser.h"
|
||||
#import "SOGoPermissions.h"
|
||||
|
||||
@@ -19,7 +19,18 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <unistd.h>
|
||||
#import <stdlib.h>
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSURL.h>
|
||||
|
||||
#import <NGObjWeb/SoObject.h>
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <EOControl/EOQualifier.h>
|
||||
#import <GDLAccess/EOAdaptorChannel.h>
|
||||
#import <GDLContentStore/GCSFolderManager.h>
|
||||
#import <GDLContentStore/GCSFolder.h>
|
||||
@@ -27,10 +38,8 @@
|
||||
#import <SaxObjC/XMLNamespaces.h>
|
||||
|
||||
#import "SOGoPermissions.h"
|
||||
|
||||
#import "SOGoFolder.h"
|
||||
#import "common.h"
|
||||
#import <unistd.h>
|
||||
#import <stdlib.h>
|
||||
|
||||
static NSString *defaultUserID = @"<default>";
|
||||
|
||||
|
||||
@@ -18,28 +18,31 @@
|
||||
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
*/
|
||||
// $Id: SOGoGroupsFolder.m 115 2004-06-30 11:57:37Z helge $
|
||||
|
||||
#include "SOGoGroupsFolder.h"
|
||||
#include "common.h"
|
||||
#import <NGObjWeb/NSException+HTTP.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
||||
#import "SOGoGroupsFolder.h"
|
||||
|
||||
@implementation SOGoGroupsFolder
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
// - (void)dealloc {
|
||||
// [super dealloc];
|
||||
// }
|
||||
|
||||
/* accessors */
|
||||
|
||||
/* SOPE */
|
||||
|
||||
- (BOOL)isFolderish {
|
||||
- (BOOL) isFolderish
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
/* looking up shared objects */
|
||||
|
||||
- (SOGoGroupsFolder *)lookupGroupsFolder {
|
||||
- (SOGoGroupsFolder *) lookupGroupsFolder
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -47,33 +50,42 @@
|
||||
|
||||
/* name lookup */
|
||||
|
||||
- (id)customGroup:(NSString *)_key inContext:(id)_ctx {
|
||||
- (id) customGroup: (NSString *) _key
|
||||
inContext: (id) _ctx
|
||||
{
|
||||
static Class groupClass = Nil;
|
||||
id group;
|
||||
|
||||
if (groupClass == Nil)
|
||||
|
||||
if (!groupClass)
|
||||
groupClass = NSClassFromString(@"SOGoCustomGroupFolder");
|
||||
if (groupClass == Nil) {
|
||||
[self logWithFormat:@"ERROR: missing SOGoCustomGroupFolder class!"];
|
||||
return nil;
|
||||
}
|
||||
|
||||
group = [[groupClass alloc] initWithName:_key inContainer:self];
|
||||
return [group autorelease];
|
||||
if (!groupClass)
|
||||
{
|
||||
[self logWithFormat:@"ERROR: missing SOGoCustomGroupFolder class!"];
|
||||
group = nil;
|
||||
}
|
||||
else
|
||||
group = [groupClass objectWithName: _key inContainer: self];
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
|
||||
- (id) lookupName: (NSString *) _key
|
||||
inContext: (id) _ctx
|
||||
acquire: (BOOL) _flag
|
||||
{
|
||||
id obj;
|
||||
|
||||
/* first check attributes directly bound to the application */
|
||||
if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
|
||||
return obj;
|
||||
|
||||
if ([_key hasPrefix:@"_custom_"])
|
||||
return [self customGroup:_key inContext:_ctx];
|
||||
|
||||
/* return 404 to stop acquisition */
|
||||
return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
|
||||
obj = [super lookupName: _key inContext: _ctx acquire: NO];
|
||||
if (!obj)
|
||||
{
|
||||
if ([_key hasPrefix: @"_custom_"])
|
||||
obj = [self customGroup: _key inContext: _ctx];
|
||||
else
|
||||
obj = [NSException exceptionWithHTTPStatus:404 /* Not Found */];
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
@end /* SOGoGroupsFolder */
|
||||
|
||||
Reference in New Issue
Block a user