bool CWizDatabase::getBizGroupInfo(QMap<QString, QString>& bizInfo) { CString strTotal; bool bExist; if(!GetMeta(g_strBizGroupSection, "Count", strTotal, "", &bExist)) { return false; } if (!bExist) { return true; } bizInfo.clear(); int nTotal = strTotal.toInt(); for (int i = 0; i < nTotal; i++) { QString strBizGUID = GetMetaDef(g_strBizGroupSection, QString::number(i)); QString strBizName = GetMetaDef(g_strBizGroupSection, strBizGUID); bizInfo[strBizGUID] = strBizName; } return true; }
bool CWizDatabase::getUserGroupInfo(CWizGroupDataArray& arrayGroup) { CString strTotal; bool bExist; if (!GetMeta(g_strGroupSection, "Count", strTotal, "", &bExist)) { return false; } if (!bExist) { return false; } int nTotal = strTotal.toInt(); for (int i = 0; i < nTotal; i++) { QString strGroupGUID = GetMetaDef(g_strGroupSection, QString::number(i)); QString strGroupName = GetMetaDef(g_strGroupSection, strGroupGUID); WIZGROUPDATA group; group.strGroupGUID = strGroupGUID; group.strGroupName = strGroupName; arrayGroup.push_back(group); } return true; }
bool CWizDatabase::getUserGroupInfo(CWizGroupDataArray& arrayGroup) { CString strTotal; bool bExist; if (!GetMeta(g_strGroupSection, "Count", strTotal, "", &bExist)) { return false; } // it's ok, user has no group data if (!bExist) { return true; } int nTotal = strTotal.toInt(); for (int i = 0; i < nTotal; i++) { WIZGROUPDATA group; group.strGroupGUID = GetMetaDef(g_strGroupSection, QString::number(i)); group.strGroupName = GetMetaDef(g_strGroupSection, group.strGroupGUID); group.bizGUID = GetMetaDef(g_strBizGroupSection, group.strGroupGUID); if (!group.bizGUID.isEmpty()) group.bizName = GetMetaDef(g_strBizGroupSection, group.bizGUID); arrayGroup.push_back(group); } return true; }
bool CWizDatabase::getUserInfo(WIZUSERINFO& userInfo) { userInfo.strDisplayName = GetMetaDef(g_strAccountSection, "DisplayName"); userInfo.strUserType = GetMetaDef(g_strAccountSection, "UserType"); userInfo.strUserLevelName = GetMetaDef(g_strAccountSection, "UserLevelName"); userInfo.nUserLevel = GetMetaDef(g_strAccountSection, "UserLevel").toInt(); userInfo.nUserPoints = GetMetaDef(g_strAccountSection, "UserPoints").toInt(); return true; }
bool CWizDatabase::GetUserCert(QString& strN, QString& stre, QString& strd, QString& strHint) { strN = GetMetaDef(g_strCertSection, "N"); stre = GetMetaDef(g_strCertSection, "E"); strd = GetMetaDef(g_strCertSection, "D"); strHint = GetMetaDef(g_strCertSection, "Hint"); if (strN.isEmpty() || stre.isEmpty() || strd.isEmpty()) return false; return true; }
bool CWizDatabase::loadDatabaseInfo() { if (m_strKbGUID.isEmpty()) { m_strKbGUID = GetMetaDef(g_strDatabaseInfoSection, "KbGUID"); } m_strName = GetMetaDef(g_strDatabaseInfoSection, "Name"); m_nPermission = GetMetaDef(g_strDatabaseInfoSection, "Permission").toInt(); if (m_strKbGUID.isEmpty() || m_strName.isEmpty()) { return false; } return true; }
UINT CWizDatabase::GetPasswordFalgs() { CString strFlags = GetMetaDef(g_strAccountSection, "PasswordFlags", ""); return (UINT)atoi(strFlags.toUtf8()); }
QString CWizDatabase::GetEncryptedPassword() { return GetMetaDef(g_strAccountSection, "Password"); }
bool CWizDatabase::GetUserName(QString& strUserName) { strUserName = GetMetaDef(g_strAccountSection, "UserName"); return true; }