vncProperties.cpp
Code: Select all
// Save the password
char passwd[MAXPWLEN+1];
// TightVNC method
int len = GetDlgItemText(hwnd, IDC_PASSWORD, (LPSTR) &passwd, MAXPWLEN+1);
if (strcmp(passwd, "~~~~~~~~") != 0) {
if (len == 0)
{
vncPasswd::FromClear crypt;
_this->m_server->SetPassword(crypt);
}
else
{
vncPasswd::FromText crypt(passwd);
_this->m_server->SetPassword(crypt);
}
}
//PGM memset(passwd, '\0', MAXPWLEN+1); //PGM
//PGM len = 0; //PGM
//PGM len = GetDlgItemText(hwnd, IDC_PASSWORD2, (LPSTR) &passwd, MAXPWLEN+1); //PGM
//PGM if (strcmp(passwd, "~~~~~~~~") != 0) { //PGM
//PGM if (len == 0) //PGM
//PGM { //PGM
//PGM vncPasswd::FromClear crypt2; //PGM
//PGM _this->m_server->SetPassword2(crypt2); //PGM
//PGM } //PGM
//PGM else //PGM
//PGM { //PGM
//PGM vncPasswd::FromText crypt2(passwd); //PGM
//PGM _this->m_server->SetPassword2(crypt2); //PGM
//PGM } //PGM
//PGM } //PGM
char passwd2[MAXPWLEN+1]; //PGM
len = 0; //PGM
len = GetDlgItemText(hwnd, IDC_PASSWORD2, (LPSTR) &passwd2, MAXPWLEN+1); //PGM
if (strcmp(passwd2, "~~~~~~~~") != 0) { //PGM
if (len == 0) //PGM
{ //PGM
vncPasswd::FromClear crypt2; //PGM
_this->m_server->SetPassword2(crypt2); //PGM
} //PGM
else //PGM
{ //PGM
if (strcmp(passwd2, passwd) != 0) { //PGM
vncPasswd::FromText crypt2(passwd2); //PGM
_this->m_server->SetPassword2(crypt2); //PGM
} //PGM
else //PGM
{ //PGM
MessageBoxSecure(NULL, "The View-Only password cannot be the same as the full-control passsword", "View-Only Password Error", MB_ICONERROR); //PGM
break; //PGM
} //PGM
} //PGM
} //PGM
// Save the new settings to the server