See ChangeLog

Monotone-Parent: 024380d579a482e49866c36ef54561cf8b39ab02
Monotone-Revision: 2cbc46c16f9b3d45d868b15a968f614dbbaf9749

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2010-03-08T15:18:05
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2010-03-08 15:18:05 +00:00
parent 13206f066d
commit 40c3cb74d0
26 changed files with 1059 additions and 98 deletions
+24 -5
View File
@@ -1,6 +1,6 @@
/* SQLSource.h - this file is part of SOGo
*
* Copyright (C) 2009 Inverse inc.
* Copyright (C) 2009-2010 Inverse inc.
*
* Author: Ludovic Marcotte <lmarcotte@inverse.ca>
*
@@ -40,6 +40,8 @@
#include "SQLSource.h"
#include "SOGoConstants.h"
/**
* The view MUST contain the following columns:
*
@@ -162,8 +164,17 @@
return NO;
}
- (BOOL) checkLogin: (NSString *) login
andPassword: (NSString *) password
//
// SQL sources don't support right now all the password policy
// stuff supported by OpenLDAP (and others). If we want to support
// this for SQL sources, we'll have to implement the same
// kind of logic in this module.
//
- (BOOL) checkLogin: (NSString *) _login
password: (NSString *) _pwd
perr: (SOGoPasswordPolicyError *) _perr
expire: (int *) _expire
grace: (int *) _grace
{
EOAdaptorChannel *channel;
GCSChannelManager *cm;
@@ -180,7 +191,7 @@
sql = [NSString stringWithFormat: (@"SELECT c_password"
@" FROM %@"
@" WHERE c_uid = '%@'"),
[_viewURL gcsTableName], login];
[_viewURL gcsTableName], _login];
ex = [channel evaluateExpressionX: sql];
if (!ex)
@@ -193,7 +204,7 @@
row = [channel fetchAttributes: attrs withZone: NULL];
value = [row objectForKey: @"c_password"];
rc = [self _isPassword: password equalTo: value];
rc = [self _isPassword: _pwd equalTo: value];
[channel cancelFetch];
}
else
@@ -207,6 +218,14 @@
return rc;
}
- (BOOL) changePasswordForLogin: (NSString *) login
oldPassword: (NSString *) oldPassword
newPassword: (NSString *) newPassword
perr: (SOGoPasswordPolicyError *) perr
{
return NO;
}
- (NSDictionary *) _lookupContactEntry: (NSString *) theID
considerEmail: (BOOL) b
{