2010-10-01 20:54:30 +02:00
|
|
|
/* MAPIStoreAuthenticator.m - this file is part of SOGo
|
|
|
|
*
|
2010-10-01 22:35:29 +02:00
|
|
|
* Copyright (C) 2010 Inverse inc.
|
2010-10-01 20:54:30 +02:00
|
|
|
*
|
|
|
|
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
|
|
|
*
|
|
|
|
* This file is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2010-10-18 14:57:31 +02:00
|
|
|
* the Free Software Foundation; either version 3, or (at your option)
|
2010-10-01 20:54:30 +02:00
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This file 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <Foundation/NSArray.h>
|
2011-02-17 21:55:19 +01:00
|
|
|
#import <Foundation/NSURL.h>
|
2010-10-01 20:54:30 +02:00
|
|
|
|
|
|
|
#import <SOGo/SOGoUser.h>
|
|
|
|
#import <SOGo/SOGoPermissions.h>
|
|
|
|
|
|
|
|
#import "MAPIStoreAuthenticator.h"
|
|
|
|
|
|
|
|
@implementation MAPIStoreAuthenticator
|
|
|
|
|
|
|
|
- (void) dealloc
|
|
|
|
{
|
|
|
|
[username release];
|
|
|
|
[password release];
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setUsername: (NSString *) newUsername
|
|
|
|
{
|
|
|
|
ASSIGN (username, newUsername);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) username
|
|
|
|
{
|
|
|
|
return username;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setPassword: (NSString *) newPassword
|
|
|
|
{
|
|
|
|
ASSIGN (password, newPassword);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (SOGoUser *) userInContext: (WOContext *)_ctx
|
|
|
|
{
|
|
|
|
return [SOGoUser userWithLogin: username
|
|
|
|
roles: [NSArray arrayWithObject: SoRole_Authenticated]];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) imapPasswordInContext: (WOContext *) context
|
2011-02-17 21:55:19 +01:00
|
|
|
forURL: (NSURL *) server
|
2010-10-01 20:54:30 +02:00
|
|
|
forceRenew: (BOOL) renew
|
|
|
|
{
|
|
|
|
NSString *imapPassword;
|
|
|
|
|
|
|
|
if (renew)
|
|
|
|
imapPassword = nil;
|
|
|
|
else
|
|
|
|
imapPassword = password;
|
|
|
|
|
|
|
|
return imapPassword;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|