mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-30 10:47:17 +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;
|
||||
|
||||
Reference in New Issue
Block a user