124 lines
2.6 KiB
C++
124 lines
2.6 KiB
C++
|
// DLG_Passwd.cpp : implementation file
|
|||
|
//
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "smsmanager.h"
|
|||
|
#include "DLG_Passwd.h"
|
|||
|
|
|||
|
#ifdef _DEBUG
|
|||
|
#define new DEBUG_NEW
|
|||
|
#undef THIS_FILE
|
|||
|
static char THIS_FILE[] = __FILE__;
|
|||
|
#endif
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_Passwd dialog
|
|||
|
|
|||
|
|
|||
|
DLG_Passwd::DLG_Passwd(CWnd* pParent /*=NULL*/)
|
|||
|
: CDialog(DLG_Passwd::IDD, pParent)
|
|||
|
{
|
|||
|
//{{AFX_DATA_INIT(DLG_Passwd)
|
|||
|
m_strNew = _T("");
|
|||
|
m_strNewRe = _T("");
|
|||
|
m_strUser = _T("");
|
|||
|
m_strYmm = _T("");
|
|||
|
//}}AFX_DATA_INIT
|
|||
|
|
|||
|
memset( &m_Setup , 0 , sizeof(m_Setup) );
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void DLG_Passwd::DoDataExchange(CDataExchange* pDX)
|
|||
|
{
|
|||
|
CDialog::DoDataExchange(pDX);
|
|||
|
//{{AFX_DATA_MAP(DLG_Passwd)
|
|||
|
DDX_Text(pDX, IDC_PASSWD_NEW, m_strNew);
|
|||
|
DDV_MaxChars(pDX, m_strNew, 16);
|
|||
|
DDX_Text(pDX, IDC_PASSWD_NEWRE, m_strNewRe);
|
|||
|
DDV_MaxChars(pDX, m_strNewRe, 16);
|
|||
|
DDX_Text(pDX, IDC_PASSWD_USER, m_strUser);
|
|||
|
DDV_MaxChars(pDX, m_strUser, 16);
|
|||
|
DDX_Text(pDX, IDC_PASSWD_YMM, m_strYmm);
|
|||
|
DDV_MaxChars(pDX, m_strYmm, 16);
|
|||
|
//}}AFX_DATA_MAP
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
BEGIN_MESSAGE_MAP(DLG_Passwd, CDialog)
|
|||
|
//{{AFX_MSG_MAP(DLG_Passwd)
|
|||
|
//}}AFX_MSG_MAP
|
|||
|
ON_BN_CLICKED(IDOK, &DLG_Passwd::OnBnClickedOk)
|
|||
|
END_MESSAGE_MAP()
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_Passwd message handlers
|
|||
|
|
|||
|
void DLG_Passwd::OnOK()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
void DLG_Passwd::SetParam(SM_Setup setup)
|
|||
|
{
|
|||
|
m_Setup = setup;
|
|||
|
}
|
|||
|
|
|||
|
SM_Setup DLG_Passwd::GetParam()
|
|||
|
{
|
|||
|
return m_Setup;
|
|||
|
}
|
|||
|
|
|||
|
BOOL DLG_Passwd::OnInitDialog()
|
|||
|
{
|
|||
|
CDialog::OnInitDialog();
|
|||
|
|
|||
|
m_strUser = m_Setup.szUser;
|
|||
|
UpdateData( false );
|
|||
|
|
|||
|
#ifdef SMSCENTER_DGSB //<2F><>ݸ<EFBFBD>籣<EFBFBD>İ汾<C4B0>ر<EFBFBD><D8B1><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
GetDlgItem(IDC_PASSWD_NOTICE)->ShowWindow(SW_SHOW);
|
|||
|
#endif
|
|||
|
|
|||
|
return TRUE; // return TRUE unless you set the focus to a control
|
|||
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void DLG_Passwd::OnBnClickedOk()
|
|||
|
{
|
|||
|
UpdateData(true);
|
|||
|
if (m_strYmm != CString(m_Setup.szPasswd))
|
|||
|
{
|
|||
|
MessageBox(_T("ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!"), _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), MB_ICONWARNING);
|
|||
|
GetDlgItem(IDC_PASSWD_YMM)->SetFocus();
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
CString strRetMsg;
|
|||
|
BOOL bPasswdVaild = false;
|
|||
|
#ifdef SMSCENTER_DGSB //<2F><>ݸ<EFBFBD>籣<EFBFBD>İ汾<C4B0><E6B1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>
|
|||
|
bPasswdVaild = Passwd_CheckVaild(m_strNew, strRetMsg, 8, 1);
|
|||
|
#else
|
|||
|
bPasswdVaild = Passwd_CheckVaild(m_strNew, strRetMsg, 8, 0);
|
|||
|
#endif
|
|||
|
if (!bPasswdVaild)
|
|||
|
{
|
|||
|
strRetMsg.Format(_T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>%s"), strRetMsg);
|
|||
|
MessageBox(strRetMsg, _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), MB_ICONWARNING);
|
|||
|
GetDlgItem(IDC_PASSWD_YMM)->SetFocus();
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
if (m_strNew != m_strNewRe)
|
|||
|
{
|
|||
|
MessageBox(_T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!"), _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), MB_ICONWARNING);
|
|||
|
GetDlgItem(IDC_PASSWD_NEW)->SetFocus();
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
_tcscpy(m_Setup.szPasswd, m_strNew);
|
|||
|
|
|||
|
CDialog::OnOK();
|
|||
|
}
|