version 1.6, 2002/08/16 22:48:29
|
version 1.7, 2002/08/29 00:27:52
|
|
|
// encrypt password | // encrypt password |
_GetSalt(salt); | _GetSalt(salt); |
| |
ArrayDestroyer<char> pw(password.allocateCString()); |
encryptedPassword = System::encryptPassword(password.getCString(),salt); |
|
|
encryptedPassword = System::encryptPassword(pw.getPointer(),salt); |
|
| |
// add the user to the cache and password file | // add the user to the cache and password file |
_Update(ADD_USER,userName, encryptedPassword); | _Update(ADD_USER,userName, encryptedPassword); |
|
|
// encrypt new password | // encrypt new password |
_GetSalt(salt); | _GetSalt(salt); |
| |
ArrayDestroyer<char> npw(newPassword.allocateCString()); |
encryptedPassword = System::encryptPassword(newPassword.getCString(),salt); |
|
|
encryptedPassword = System::encryptPassword(npw.getPointer(),salt); |
|
| |
_Update(MODIFY_USER, userName, encryptedPassword); | _Update(MODIFY_USER, userName, encryptedPassword); |
| |
|
|
} | } |
| |
saltStr = curPassword.subString(0,2); | saltStr = curPassword.subString(0,2); |
ArrayDestroyer<char> oldsalt(saltStr.allocateCString()); |
|
ArrayDestroyer<char> pw(password.allocateCString()); |
|
| |
encryptedPassword = | encryptedPassword = |
System::encryptPassword(pw.getPointer(),oldsalt.getPointer()); |
System::encryptPassword(password.getCString(),saltStr.getCString()); |
| |
if ( curPassword != encryptedPassword ) | if ( curPassword != encryptedPassword ) |
{ | { |