ftp.nice.ch/pub/next/unix/disk/SambaManager.1.0.NIHS.s.tar.gz#/SambaManager/DomainLogin.m

This is DomainLogin.m in view mode; [Download] [Up]

#import "DomainLogin.h"
#import <netinfo/ni.h>

@implementation DomainLogin
- init:(const char *)user passwd:(const char *)passwd
{
		userName = NXCopyStringBufferFromZone(user, [self zone]);
		password = NXCopyStringBufferFromZone(passwd, [self zone]);
		return self;
}

- free
{
		NXZoneFree([self zone], userName);
		NXZoneFree([self zone], password);
		return self;
}

- (BOOL)authenticate:(void *)handle
{
int	status;

		status = ni_setuser(handle, userName);
		if (status == NI_OK)
			status = ni_setpassword(handle, password);
		if (status == NI_OK)
			return YES;
		else
			return NO;
}
@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.