Changed: modify account urls on client_default_cfg , allow read account manage url from client_default_cfg

merge-requests/7/head
Riasan 3 years ago
parent 405974c9c0
commit 103179ece7

@ -903,17 +903,77 @@ void CClientConfig::setValues()
READ_STRING_FV(FSHost)
READ_BOOL_DEV(DisplayAccountButtons)
READ_STRING_DEV(CreateAccountURL)
READ_STRING_DEV(EditAccountURL)
READ_STRING_DEV(ForgetPwdURL)
READ_STRING_FV(CreateAccountURL)
READ_STRING_FV(EditAccountURL)
READ_STRING_FV(ForgetPwdURL)
READ_STRING_DEV(BetaAccountURL)
READ_STRING_DEV(FreeTrialURL)
// defined in client_default.cfg
READ_STRING_FV(ConditionsTermsURL)
READ_STRING_FV(NamingPolicyURL)
READ_STRING_FV(LoginSupportURL)
// read NamingPolicyURL from client_default.cfg
//READ_STRING_FV(NamingPolicyURL)
std::string languageCo = "wk";
CConfigFile::CVar *languageCodeVarPtr = ClientCfg.ConfigFile.getVarPtr("LanguageCode");
if (languageCodeVarPtr)
{
languageCo = languageCodeVarPtr->asString();
}
CConfigFile::CVar *policyurl = ClientCfg.ConfigFile.getVarPtr("NamingPolicyURL");
if (policyurl)
{
for (uint i = 0; i < policyurl->size(); ++i)
{
std::string entry = policyurl->asString(i);
if (entry.size() >= languageCo.size())
{
if (nlstricmp(entry.substr(0, languageCo.size()), languageCo) == 0)
{
std::string::size_type pos = entry.find("=");
if (pos != std::string::npos)
{
ClientCfg.NamingPolicyURL = entry.substr(pos + 1);
}
}
}
}
}
// read NamingPolicyURL from client_default.cfg
//READ_STRING_FV(ConditionsTermsURL)
CConfigFile::CVar *coturl = ClientCfg.ConfigFile.getVarPtr("ConditionsTermsURL");
if (coturl)
{
for (uint i = 0; i < coturl->size(); ++i)
{
std::string entry = coturl->asString(i);
if (entry.size() >= languageCo.size())
{
if (nlstricmp(entry.substr(0, languageCo.size()), languageCo) == 0)
{
std::string::size_type pos = entry.find("=");
if (pos != std::string::npos)
{
ClientCfg.ConditionsTermsURL = entry.substr(pos + 1);
}
}
}
}
}
#ifndef RZ_NO_CLIENT
// if cookie is not empty, it means that the client was launch
// by the nel_launcher, so it can't be local

@ -1932,8 +1932,11 @@ class CAHOpenURL : public IActionHandler
#else
// TODO: for Linux and Mac OS
#endif
if (sParams == "cfg_EditAccountURL")
if (sParams == "cfg_CreateAccountURL")
{
url = ClientCfg.CreateAccountURL;
}
else if (sParams == "cfg_EditAccountURL")
{
url = ClientCfg.EditAccountURL;
}
@ -1972,6 +1975,8 @@ class CAHOpenURL : public IActionHandler
return;
}
if(sParams != "cfg_ConditionsTermsURL" && sParams != "cfg_NamingPolicyURL")
{
// modify existing languages
// old site
@ -1998,6 +2003,7 @@ class CAHOpenURL : public IActionHandler
if (!LoginCustomParameters.empty())
url += LoginCustomParameters;
}
}
openURL(url);

Loading…
Cancel
Save