2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #import <EOControl/EOControl.h>
23 #import <NGLdap/NGLdapConnection.h>
26 int main(int argc, char **argv, char **env) {
27 NSAutoreleasePool *pool;
32 #if LIB_FOUNDATION_LIBRARY
33 [NSProcessInfo initializeWithArguments:argv count:argc environment:env];
36 pool = [[NSAutoreleasePool alloc] init];
38 args = [[NSProcessInfo processInfo] arguments];
39 if ([args count] < 3) {
40 NSLog(@"usage: %@ <user> <password>", [args objectAtIndex:0]);
44 ud = [NSUserDefaults standardUserDefaults];
46 ok = [NGLdapConnection checkPassword:[args objectAtIndex:2]
47 ofLogin:[args objectAtIndex:1]
48 atBaseDN:[ud stringForKey:@"LDAPRootDN"]
49 onHost:[ud stringForKey:@"LDAPHost"]
52 printf("authenticated successfully.\n");
54 printf("did not authenticate !\n");