Dear Victor,
There is a bug in the userdb_objects.cpp in trunk. The setpassword function does not consider the Unicode and MBCS. However, I changed the code to this:
void User::setPassword(const TCHAR *password, bool clearChangePasswdFlag)
{
#ifdef UNICODE
char *mb = MBStringFromWideString(password);
CalculateSHA1Hash((BYTE *)mb, strlen(mb), m_passwordHash);
free(mb);
#else
CalculateSHA1Hash((BYTE *)password, _tcslen(password), m_passwordHash);
#endif
//CalculateSHA1Hash((BYTE *)password, _tcslen(password), m_passwordHash);
m_graceLogins = MAX_GRACE_LOGINS;
m_flags |= UF_MODIFIED;
if (clearChangePasswdFlag)
m_flags &= ~UF_CHANGE_PASSWORD;
}
Still has the problem with setting or changing the password.
Could you check?
best regards,
szll2010
There is a bug in the userdb_objects.cpp in trunk. The setpassword function does not consider the Unicode and MBCS. However, I changed the code to this:
void User::setPassword(const TCHAR *password, bool clearChangePasswdFlag)
{
#ifdef UNICODE
char *mb = MBStringFromWideString(password);
CalculateSHA1Hash((BYTE *)mb, strlen(mb), m_passwordHash);
free(mb);
#else
CalculateSHA1Hash((BYTE *)password, _tcslen(password), m_passwordHash);
#endif
//CalculateSHA1Hash((BYTE *)password, _tcslen(password), m_passwordHash);
m_graceLogins = MAX_GRACE_LOGINS;
m_flags |= UF_MODIFIED;
if (clearChangePasswdFlag)
m_flags &= ~UF_CHANGE_PASSWORD;
}
Still has the problem with setting or changing the password.
Could you check?
best regards,
szll2010