Note: AxaptaUserManager class is used to validate the password.This class is also helpful to generate passwords, validate domain etc.
Below is how the dialog looks with password style dialog fields.
static void PasswordDialogs_validateADUser(Args _args)
{
Dialog d = new Dialog(“Password style dialogs and validate password in Active directory”);
DialogField dfPass1, dfPass2;
{
Dialog d = new Dialog(“Password style dialogs and validate password in Active directory”);
DialogField dfPass1, dfPass2;
UserInfo userInfo;
AxaptaUserManager axUserManager;
;
AxaptaUserManager axUserManager;
;
dfPass1 = d.addField(typeid(password), “Enter password”, “Enter password.”);
dfPass2 = d.addField(typeid(password),”Re-enter password”, “Re-enter your password to validate”);
dfPass2 = d.addField(typeid(password),”Re-enter password”, “Re-enter your password to validate”);
dfPass1.passwordStyle(true);
dfPass2.passwordStyle(true);
dfPass2.passwordStyle(true);
if (d.run())
{
userInfo = xUserInfo::find(false, curuserId());
axUserManager = new AxaptaUserManager();
{
userInfo = xUserInfo::find(false, curuserId());
axUserManager = new AxaptaUserManager();
if (strcmp(dfPass1.value(), dfPass2.value()))
throw error(“@SYP1505″);
throw error(“@SYP1505″);
if (axUserManager.validatePassword(userInfo.networkAlias , userInfo.NetworkDomain, dfPass1.value()))
{
info(“Password matches with the Active directory password :)”);
}
else
{
warning (“Password doesn’t match with the Active directory password :(“);
}
}
}
{
info(“Password matches with the Active directory password :)”);
}
else
{
warning (“Password doesn’t match with the Active directory password :(“);
}
}
}
No comments:
Post a Comment