bool CWizApiBase::callGetUserCert(const QString& strUserId, const QString& strPassword) { CWizApiParamBase param; param.AddString("user_id", MakeXmlRpcUserId(strUserId)); param.AddString("password", MakeXmlRpcPassword(strPassword)); return callXmlRpc(SyncMethod_GetUserCert, ¶m); }
BOOL CWizKMAccountsServer::accounts_changePassword(const QString& strUserName, const QString& strOldPassword, const QString& strNewPassword) { CWizKMBaseParam param; param.AddString(_T("user_id"), strUserName); param.AddString(_T("old_password"), MakeXmlRpcPassword(strOldPassword)); param.AddString(_T("new_password"), MakeXmlRpcPassword(strNewPassword)); // CWizXmlRpcResult callRet; if (!Call(_T("accounts.changePassword"), callRet, ¶m)) { TOLOG(_T("Change password failure!")); return FALSE; } // return TRUE; }
bool CWizApiBase::callClientLogin(const QString& strUserId, const QString& strPassword) { m_user = WIZUSERINFO(); CWizApiParamBase param; param.AddString("user_id", MakeXmlRpcUserId(strUserId)); param.AddString("password", MakeXmlRpcPassword(strPassword)); return callXmlRpc(SyncMethod_ClientLogin, ¶m); }
bool CWizApiBase::callClientLogin(const QString& strUserId, const QString& strPassword) { if (WizGlobal()->token().isEmpty()) { CWizApiParamBase param; param.AddString("user_id", MakeXmlRpcUserId(strUserId)); param.AddString("password", MakeXmlRpcPassword(strPassword)); return callXmlRpc(SyncMethod_ClientLogin, ¶m); } else { m_strUserId = strUserId; m_strPasswd = strPassword; return callClientKeepAlive(); } }
BOOL CWizKMAccountsServer::accounts_getCert(const QString& strUserName, const QString& strPassword, QString& strN, QString& stre, QString& strd, QString& strHint) { CWizKMBaseParam param; param.AddString(_T("user_id"), strUserName); param.AddString(_T("password"), MakeXmlRpcPassword(strPassword)); // if (!Call(_T("accounts.getCert"), _T("n"), strN, _T("e"), stre, _T("d"), strd, _T("hint"), strHint, ¶m)) { TOLOG(_T("Failed to get cert!")); return FALSE; } // return TRUE; }
BOOL CWizKMAccountsServer::accounts_getToken(const QString& strUserName, const QString& strPassword, QString& strToken) { CWizKMBaseParam param; param.AddString(_T("user_id"), strUserName); param.AddString(_T("password"), MakeXmlRpcPassword(strPassword)); // if (!Call(_T("accounts.getToken"), _T("token"), strToken, ¶m)) { TOLOG(_T("Failed to get token!")); return FALSE; } DEBUG_TOLOG1(_T("Get token: %1"), strToken); return TRUE; }
BOOL CWizKMAccountsServer::accounts_createAccount(const QString& strUserName, const QString& strPassword, const QString& strInviteCode) { CWizKMBaseParam param; param.AddString(_T("user_id"), strUserName); param.AddString(_T("password"), MakeXmlRpcPassword(strPassword)); param.AddString(_T("invite_code"), strInviteCode); param.AddString(_T("product_name"), "WizNoteQT"); // CWizXmlRpcResult ret; if (!Call(_T("accounts.createAccount"), ret, ¶m)) { TOLOG(_T("Failed to create account!")); return FALSE; } // return TRUE; }
bool CWizApiBase::callCreateAccount(const CString& strUserId, const CString& strPassword) { CWizApiParamBase param; param.AddString("user_id", MakeXmlRpcUserId(strUserId)); param.AddString("password", MakeXmlRpcPassword(strPassword)); #if defined Q_OS_MAC param.AddString("invite_code", "129ce11c"); param.AddString("product_name", "qtMac"); #elif defined Q_OS_LINUX param.AddString("invite_code", "7abd8f4a"); param.AddString("product_name", "qtLinux"); #else param.AddString("invite_code", "8480c6d7"); param.AddString("product_name", "qtWindows"); #endif return callXmlRpc(SyncMethod_CreateAccount, ¶m); }
BOOL CWizKMAccountsServer::accounts_clientLogin(const QString& strUserName, const QString& strPassword, const QString& strType, WIZUSERINFO& ret) { DEBUG_TOLOG(_T("Start Login")); // CWizKMBaseParam param; param.AddString(_T("user_id"), strUserName); param.AddString(_T("password"), MakeXmlRpcPassword(strPassword)); param.AddString(_T("program_type"), strType); param.AddString(_T("protocol"), "https"); // if (!Call(_T("accounts.clientLogin"), ret, ¶m)) { TOLOG(_T("Failed to login!")); return FALSE; } // DEBUG_TOLOG1(_T("Login: token=%1"), ret.strToken); // return TRUE; }