/* Copyright (C) 2000-2003 Max Berger This file is part of vCardReceiver, written for the OpenGroupware project (OGo) OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. OGo 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with OGo; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id$ #import "vCardReceiverSessionHandler.h" #include @implementation vCardSyncSessionHandler - (id) initWithUser:(NSString *)u pass:(NSString *)p { self = [super init]; if (self) { self->user=NULL; ASSIGNCOPY(self->user,u); self->pass=NULL; ASSIGNCOPY(self->pass,p); db = [[vCardReceiverDatabaseHandler alloc]init]; [db setRemoteTarget:[NSString stringWithFormat:@"./Contacts/%@",user]]; } return self; } - (void) dealloc { [db release]; [user release]; [pass release]; [super dealloc]; } - (NSString *)requireAuthentication { return nil; } - (BOOL)authenticateAs:(NSString *)user withPass:(NSString *)pass { return YES; } - (NSString *)provideUsername { return user; } - (NSString *)providePlainPassword { return pass; } - (int)databaseCount { return 1; } - (id)databaseForIndex:(int)index { return db; } - (BOOL) server { return NO; } - (void) setSyncml:(SyncML*)syncml { // Do nothing (don't need that - yet) } - (void) invalidCredentials { NSLog(@"Error: Invalid Credentials (username/password)"); } - (NSString*) deviceIdentification { return @"vCardReceiver"; } - (NSDictionary*) loadDeviceInformationFor:(NSString*)device { return nil; } - (void) saveDeviceInformation:(NSDictionary*)information for:(NSString*)device { // Don't save. We don't need that } @end