stephb9959
2023-10-03 22:11:33 -07:00
parent 69e507a5bd
commit a8da1a4223
4 changed files with 8 additions and 7 deletions

View File

@@ -62,9 +62,9 @@ namespace OpenWifi {
if(RE.UseGWProxy) { if(RE.UseGWProxy) {
Poco::JSON::Object ServerSettings; Poco::JSON::Object ServerSettings;
if (RE.Type == "orion") { if (RE.Type == "orion") {
return OpenRoaming_Orion()->Render(RE, Result); return OpenRoaming_Orion()->Render(RE, SerialNumber_, Result);
} else if (RE.Type == "globalreach") { } else if (RE.Type == "globalreach") {
return OpenRoaming_GlobalReach()->Render(RE, Result); return OpenRoaming_GlobalReach()->Render(RE, SerialNumber_, Result);
} else if (RE.Type == "radsec") { } else if (RE.Type == "radsec") {
} else if (RE.Type == "radius") { } else if (RE.Type == "radius") {
@@ -169,6 +169,7 @@ namespace OpenWifi {
} }
bool APConfig::Get(Poco::JSON::Object::Ptr &Configuration) { bool APConfig::Get(Poco::JSON::Object::Ptr &Configuration) {
if (Config_.empty()) { if (Config_.empty()) {
Explanation_.clear(); Explanation_.clear();
try { try {

View File

@@ -41,7 +41,7 @@ namespace OpenWifi {
StorageService()->GLBLRAccountInfoDB().Iterate(F); StorageService()->GLBLRAccountInfoDB().Iterate(F);
} }
bool OpenRoaming::Render(const OpenWifi::ProvObjects::RADIUSEndPoint &RE, Poco::JSON::Object &Result) { bool OpenRoaming::Render(const OpenWifi::ProvObjects::RADIUSEndPoint &RE, const std::string &SerialNumber, Poco::JSON::Object &Result) {
if(RE.UseGWProxy) { if(RE.UseGWProxy) {
Poco::JSON::Object Auth, Acct, CoA; Poco::JSON::Object Auth, Acct, CoA;
@@ -58,7 +58,7 @@ namespace OpenWifi {
CoA.set("port", 3799); CoA.set("port", 3799);
CoA.set("secret", RE.RadsecServers[0].Secret); CoA.set("secret", RE.RadsecServers[0].Secret);
Result.set("nas-identifier", RE.NasIdentifier); Result.set("nas-identifier", RE.NasIdentifier.empty() ? SerialNumber : RE.NasIdentifier );
Result.set("authentication", Auth); Result.set("authentication", Auth);
Result.set("accounting", Acct); Result.set("accounting", Acct);
Result.set("dynamic-authorization", CoA); Result.set("dynamic-authorization", CoA);

View File

@@ -36,7 +36,7 @@ namespace OpenWifi {
void InitCache(); void InitCache();
bool Render(const OpenWifi::ProvObjects::RADIUSEndPoint &RE, Poco::JSON::Object &Result); bool Render(const OpenWifi::ProvObjects::RADIUSEndPoint &RE, const std::string & SerialNUmber, Poco::JSON::Object &Result);
private: private:
std::string MakeToken(const std::string &GlobalReachAccountId, const std::string &PrivateKey = ""); std::string MakeToken(const std::string &GlobalReachAccountId, const std::string &PrivateKey = "");

View File

@@ -38,7 +38,7 @@ namespace OpenWifi {
return OrionWifiServerAddresses; return OrionWifiServerAddresses;
} }
inline bool Render(const OpenWifi::ProvObjects::RADIUSEndPoint &RE, Poco::JSON::Object &Result) { inline bool Render(const OpenWifi::ProvObjects::RADIUSEndPoint &RE, const std::string &SerialNumber, Poco::JSON::Object &Result) {
if(RE.UseGWProxy) { if(RE.UseGWProxy) {
Poco::JSON::Object Auth, Acct, CoA; Poco::JSON::Object Auth, Acct, CoA;
@@ -55,7 +55,7 @@ namespace OpenWifi {
CoA.set("port", 3799); CoA.set("port", 3799);
CoA.set("secret", RE.RadsecServers[0].Secret); CoA.set("secret", RE.RadsecServers[0].Secret);
Result.set("nas-identifier", RE.NasIdentifier); Result.set("nas-identifier", RE.NasIdentifier.empty() ? SerialNumber : RE.NasIdentifier );
Result.set("authentication", Auth); Result.set("authentication", Auth);
Result.set("accounting", Acct); Result.set("accounting", Acct);
Result.set("dynamic-authorization", CoA); Result.set("dynamic-authorization", CoA);