Changeset View
Changeset View
Standalone View
Standalone View
src/httprpc.cpp
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
// config file. | // config file. | ||||
static bool multiUserAuthorized(std::string strUserPass) { | static bool multiUserAuthorized(std::string strUserPass) { | ||||
if (strUserPass.find(":") == std::string::npos) { | if (strUserPass.find(":") == std::string::npos) { | ||||
return false; | return false; | ||||
} | } | ||||
std::string strUser = strUserPass.substr(0, strUserPass.find(":")); | std::string strUser = strUserPass.substr(0, strUserPass.find(":")); | ||||
std::string strPass = strUserPass.substr(strUserPass.find(":") + 1); | std::string strPass = strUserPass.substr(strUserPass.find(":") + 1); | ||||
if (mapMultiArgs.count("-rpcauth") > 0) { | if (gArgs.IsArgSet("-rpcauth")) { | ||||
// Search for multi-user login/pass "rpcauth" from config | // Search for multi-user login/pass "rpcauth" from config | ||||
for (const std::string &strRPCAuth : mapMultiArgs.at("-rpcauth")) { | for (const std::string &strRPCAuth : gArgs.GetArgs("-rpcauth")) { | ||||
std::vector<std::string> vFields; | std::vector<std::string> vFields; | ||||
boost::split(vFields, strRPCAuth, boost::is_any_of(":$")); | boost::split(vFields, strRPCAuth, boost::is_any_of(":$")); | ||||
if (vFields.size() != 3) { | if (vFields.size() != 3) { | ||||
// Incorrect formatting in config file | // Incorrect formatting in config file | ||||
continue; | continue; | ||||
} | } | ||||
std::string strName = vFields[0]; | std::string strName = vFields[0]; | ||||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |