Main Page | Class List | File List | Class Members | File Members

ldapauth_plus.h

Go to the documentation of this file.
00001 /*
00002 pGina ldapAuth code - based upon skeleton code for pGina plugin development
00003 Copyright (C) 2002 Micah Cooper
00004 
00005 This program is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU General Public License
00007 as published by the Free Software Foundation; either version 2
00008 of the License, or (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 
00019 Email: coopermj@muohio.edu
00020 Snail Mail:
00021         Micah Cooper
00022         212A Kreger Hall
00023         Miami University
00024         Oxford OH  45056
00025 */
00026 // ldapauth_plus.h : main header file for the ldapauth_plus DLL
00027 //
00028 
00029 #pragma once
00030 
00031 #ifndef __AFXWIN_H__
00032         #error include 'stdafx.h' before including this file for PCH
00033 #endif
00034 
00035 #include "pgina_headers.h"
00036 #include "messages_def.h"
00037 #include <wchar.h>
00038 #include <WCHAR.h>
00039 #include <Winldap.h>
00040 #include <Winreg.h>
00041 #include <Windows.h>
00042 #include <stdio.h>
00043 #include <stdlib.h>
00044 #include <Winber.h>
00045 #include <Lm.h>
00046 
00047 #ifdef _DEBUG
00048 #include <atltime.h>
00049 #endif
00050 
00051 // Global Values
00052 #define MISCONFIGURED 0
00053 #define MULTIMAP        1
00054 #define SEARCH          2
00055 #define STRMAP          3
00056 // Well-known users and groups...
00057 #define DOMAIN_USER_RID_ADMIN          (0x000001F4L)
00058 #define DOMAIN_USER_RID_GUEST          (0x000001F5L)
00059 #define DOMAIN_GROUP_RID_ADMINS        (0x00000200L)
00060 #define DOMAIN_GROUP_RID_USERS         (0x00000201L)
00061 #define DOMAIN_GROUP_RID_GUESTS        (0x00000202L)
00062 // well-known aliases ...
00063 #define DOMAIN_ALIAS_RID_ADMINS        (0x00000220L)
00064 #define DOMAIN_ALIAS_RID_USERS         (0x00000221L)
00065 #define DOMAIN_ALIAS_RID_GUESTS        (0x00000222L)
00066 #define DOMAIN_ALIAS_RID_POWER_USERS   (0x00000223L)
00067 #define DOMAIN_ALIAS_RID_ACCOUNT_OPS   (0x00000224L)
00068 #define DOMAIN_ALIAS_RID_SYSTEM_OPS    (0x00000225L)
00069 #define DOMAIN_ALIAS_RID_PRINT_OPS     (0x00000226L)
00070 #define DOMAIN_ALIAS_RID_BACKUP_OPS    (0x00000227L)
00071 #define DOMAIN_ALIAS_RID_REPLICATOR    (0x00000228L)
00072 
00073 #define LDAPAUTHVERSION TEXT("LDAPAuth Version 1.4 by Micah Cooper and Michael Morris")
00074 // Prototypes
00075 long regLookup(WCHAR *,WCHAR *);
00076 PWCHAR * ldapSearchAttr(LPTSTR, WCHAR *, LDAP *, WCHAR *, bool ldpOverride);
00077 void plugError(LPCWSTR *, LPVOID, DWORD);
00078 bool ldapDoBindTest(LPTSTR, LPTSTR, LPTSTR, LDAP *);
00079 bool ldapTestMap(LPTSTR, LPTSTR, WCHAR *, WCHAR *, LDAP *, WCHAR *);
00080 bool ldapMapGo(LPTSTR, LPTSTR, LPTSTR, LPTSTR, LPTSTR, LDAP *, WCHAR *);
00081 WCHAR * getContext(WCHAR *);
00082 bool ldapSearchForDN(LPTSTR, WCHAR *, WCHAR *, LDAP *);
00083 bool ldapTestMultiMap(LPTSTR, LPTSTR, WCHAR *, WCHAR *, LDAP *, WCHAR *);
00084 bool regSet(WCHAR *, WCHAR *);
00085 bool ldapTestSearch(LPTSTR, LPTSTR, WCHAR *, LDAP *, WCHAR *);
00086 DWORD determineLdap(void);
00087 bool ldapGroupCheck(WCHAR *, WCHAR *, LDAP *,WCHAR *);
00088 bool okToLogin(WCHAR *, LDAP *, WCHAR *);
00089 bool createAsAdmin(WCHAR *, LDAP *, WCHAR *);
00090 PWCHAR * ldapSearchAttr(LPTSTR, WCHAR *, LDAP *, WCHAR *);
00091 void populateUserInfo(pGinaInfo *, LDAP *, WCHAR *);
00092 void setNDSReg(WCHAR *, WCHAR *);
00093 void confNDSClient(WCHAR *, WCHAR *, WCHAR *);
00094 BOOL whoIsGroup(WCHAR *, DWORD);
00095 TCHAR * regReadString(LPCTSTR location); // Added by nate
00096 BOOL regWriteString(LPTSTR value,LPCTSTR location); // added by nate
00097 BOOL regWriteDword(DWORD,LPCTSTR); // added by nate
00098 DWORD regReadDword(LPCTSTR); // added by nate
00099 void regDelValue(LPCTSTR); //added by nate
00101 
00104 void doLdapSearch(WCHAR ldapFilter[256]);
00105 
00106 #ifdef _DEBUG
00107 void debugOut(WCHAR *,...);
00108 #endif
00109 
00110 
00112 /* See ldapauth_plus.cpp for the implementation of this class
00113 */
00114 class Cldapauth_plusApp : public CWinApp
00115 {
00116 public:
00117         Cldapauth_plusApp();
00118 
00119 // Overrides
00120 public:
00121         virtual BOOL InitInstance();
00122 
00123         DECLARE_MESSAGE_MAP();
00124 };

Generated on Fri Feb 20 12:03:41 2004 for ldapauth plugin for pGina by doxygen 1.3.5