Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ UI++.VC.db
Build
Intermediate
vcpkg_installed
/.vs/UI++/v18
/.vs
2 changes: 2 additions & 0 deletions UI++/Actions/InteractiveActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ namespace UIpp

CString domainController = GetXMLAttribute(m_actionData.pActionNode, XML_ATTRIBUTE_DOMAINCONTROLLER);
bool doNotFallBack = FTW::IsTrue(GetXMLAttribute(m_actionData.pActionNode, XML_ATTRIBUTE_DONOTFALLBACK, XML_ACTION_FALSE));
bool useForOSDJoin = FTW::IsTrue(GetXMLAttribute(m_actionData.pActionNode, XML_ATTRIBUTE_AUTH_USER_OSDJOIN, XML_ACTION_FALSE));

CDlgBase::DialogVisibilityFlags dlgFlags = CDlgBase::BuildDialogVisibilityFlags(true,
includeBack,
Expand All @@ -288,6 +289,7 @@ namespace UIpp
getGroups,
disableCancel,
doNotFallBack,
useForOSDJoin,
_tstoi(maxRetryCount));

CDlgUserAuth dlg(actionTitle, dlgFlags, m_actionData, &authdata);
Expand Down
6 changes: 6 additions & 0 deletions UI++/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ const _TCHAR* const XML_ATTRIBUTE_TITLE_PROGRESS_DEF = (_T("Collecting values fr

DWORD const XML_ATTRIBUTE_MAXRUNTIME_DEF = 60;

const _TCHAR* const XML_ATTRIBUTE_AUTH_USER_OSDJOIN = (_T("UseForOSDJoin"));

const _TCHAR* const XML_ACTION_TYPE_USERINPUT = (_T("Input"));
const _TCHAR* const XML_ACTION_TYPE_USERINFO = (_T("Info"));
const _TCHAR* const XML_ACTION_TYPE_ERRORINFO = (_T("ErrorInfo"));
Expand Down Expand Up @@ -405,6 +407,10 @@ const _TCHAR* const VAR_IPSUBNET = (_T("XIPSubnet"));
const _TCHAR* const VAR_IPSUBNETMASK = (_T("XIPSubnetMask"));
const _TCHAR* const VAR_MACADDRESS = (_T("XMACAddress"));

const _TCHAR* const VAR_OSDJOINPASS = (_T("OSDJoinPassword"));
const _TCHAR* const VAR_OSDJOINACCOUNT = (_T("OSDJoinAccount"));
const _TCHAR* const VAR_BLACKSLASH = (_T("\\"));

const _TCHAR* const VALUE_OSVERSION_PE = (_T("PE"));
const _TCHAR* const VALUE_OSVERSION_NT = (_T("NT"));
const _TCHAR* const VALUE_OSVERSION_2000 = (_T("2000"));
Expand Down
19 changes: 15 additions & 4 deletions UI++/Dialogs/DlgUserAuth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void CDlgUserAuth::OnBnClickedNextaction()
PTSTR pUser = new TCHAR[MAX_STRING_LENGTH];
PTSTR pDom = new TCHAR[MAX_STRING_LENGTH];
PTSTR pCount = new TCHAR[MAX_STRING_LENGTH];
PTSTR pOSDUser = new TCHAR[MAX_STRING_LENGTH];

int count = 0;

Expand Down Expand Up @@ -110,8 +111,6 @@ void CDlgUserAuth::OnBnClickedNextaction()

m_actionData.pLdap->Authenticate(pUser, pPass, pDom, pDC, m_pData->m_doNotFallback);

SecureZeroMemory(pPass, sizeof(TCHAR) * (MAX_STRING_LENGTH - 1));

m_actionData.pCMLog->WriteMsg(FTWCMLOG::CCMLog::MsgType::Info,
AfxGetThread()->m_nThreadID, __TFILE__, __LINE__,
FTW::FormatResourceString(IDS_LOGMSG_USERAUTH, pUser, pDom, ldap_err2string(LDAP_SUCCESS), pCount));
Expand Down Expand Up @@ -151,7 +150,17 @@ void CDlgUserAuth::OnBnClickedNextaction()

if (groupMembershipOK && m_pData->m_getGroups)
CTSEnv::Instance().Set(m_actionData.pCMLog, VAR_AUTHUSERGROUPS, m_actionData.pLdap->ExtractGroupNamesFromAttributeList(ppAttributeVal));

if (m_pData->m_useForOSDJoin == true)
{
//I am not very good at C++ - there is probably a better way to do this.
_tcscpy_s(pOSDUser, MAX_STRING_LENGTH, pDom);
_tcscat_s(pOSDUser, MAX_STRING_LENGTH, VAR_BLACKSLASH);
_tcscat_s(pOSDUser, MAX_STRING_LENGTH, pUser);
CTSEnv::Instance().Set(m_actionData.pCMLog, VAR_OSDJOINACCOUNT, pOSDUser, true);
CTSEnv::Instance().Set(m_actionData.pCMLog, VAR_OSDJOINPASS, pPass, false);
}
//Have to delay the secure erase so the password can be captured for task sequence variable OSDJoinPassword
SecureZeroMemory(pPass, sizeof(TCHAR) * (MAX_STRING_LENGTH - 1));
}
else
{
Expand All @@ -169,6 +178,8 @@ void CDlgUserAuth::OnBnClickedNextaction()
}

}

SecureZeroMemory(pPass, sizeof(TCHAR) * (MAX_STRING_LENGTH - 1));

if (groupMembershipOK && !m_fatalAuthError)
{
Expand Down Expand Up @@ -233,7 +244,7 @@ void CDlgUserAuth::OnBnClickedNextaction()
delete[] pUser;
delete[] pDom;
delete[] pCount;

delete[] pOSDUser;
}

void CDlgUserAuth::DisplayFinalError(DWORD msg)
Expand Down
5 changes: 4 additions & 1 deletion UI++/Dialogs/DlgUserAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ struct DlgUserAuthData
bool getGroups = false,
bool disableCancel = false,
bool doNotFallback = false,
bool useForOSDJoin = false,
int maxRetries = 0)
: m_authorizedUserGroups(pAuthorizedUserGroups),
m_userAttributes(pUserattributes),
m_domainController(pDomainController),
m_getGroups(getGroups),
m_disableCancel(disableCancel),
m_doNotFallback(doNotFallback),
m_maxRetries(maxRetries)
m_maxRetries(maxRetries),
m_useForOSDJoin(useForOSDJoin)
{};

CString m_authorizedUserGroups;
Expand All @@ -31,6 +33,7 @@ struct DlgUserAuthData
bool m_getGroups;
bool m_disableCancel;
bool m_doNotFallback;
bool m_useForOSDJoin;
};

typedef DlgUserAuthData* PDlgUserAuthData;
Expand Down