X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/e6f8d47a04848cfe9c07285282a463890daf6b6c..5280c0e68f3c1f2a9d1a4d69fa65a0cbdb96f004:/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp diff --git a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp index 23417166..99e0a091 100644 --- a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp +++ b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp @@ -86,7 +86,7 @@ std::vector::const_iterator pvi; /////////////////////////// pv.param = "Port"; pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv); -if (pvi == s.moduleParams.end()) +if (pvi == s.moduleParams.end() || pvi->value.empty()) { errorStr = "Parameter \'Port\' not found."; printfd(__FILE__, "Parameter 'Port' not found\n"); @@ -102,7 +102,7 @@ port = static_cast(p); /////////////////////////// pv.param = "UserDelay"; pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv); -if (pvi == s.moduleParams.end()) +if (pvi == s.moduleParams.end() || pvi->value.empty()) { errorStr = "Parameter \'UserDelay\' not found."; printfd(__FILE__, "Parameter 'UserDelay' not found\n"); @@ -118,7 +118,7 @@ if (ParseIntInRange(pvi->value[0], 5, 600, &userDelay)) /////////////////////////// pv.param = "UserTimeout"; pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv); -if (pvi == s.moduleParams.end()) +if (pvi == s.moduleParams.end() || pvi->value.empty()) { errorStr = "Parameter \'UserTimeout\' not found."; printfd(__FILE__, "Parameter 'UserTimeout' not found\n"); @@ -134,7 +134,7 @@ if (ParseIntInRange(pvi->value[0], 15, 1200, &userTimeout)) /////////////////////////// pv.param = "LogProtocolErrors"; pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv); -if (pvi == s.moduleParams.end()) +if (pvi == s.moduleParams.end() || pvi->value.empty()) logProtocolErrors = false; else if (ParseYesNo(pvi->value[0], &logProtocolErrors)) { @@ -142,16 +142,12 @@ else if (ParseYesNo(pvi->value[0], &logProtocolErrors)) printfd(__FILE__, "Cannot parse parameter 'LogProtocolErrors'\n"); return -1; } -if (logProtocolErrors) - printfd(__FILE__, "LogProtocolErrors: true\n"); -else - printfd(__FILE__, "LogProtocolErrors: false\n"); ///////////////////////////////////////////////////////////// std::string freeMbType; int n = 0; pv.param = "FreeMb"; pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv); -if (pvi == s.moduleParams.end()) +if (pvi == s.moduleParams.end() || pvi->value.empty()) { errorStr = "Parameter \'FreeMb\' not found."; printfd(__FILE__, "Parameter 'FreeMb' not found\n"); @@ -192,15 +188,13 @@ return 0; #ifdef IA_PHASE_DEBUG IA_PHASE::IA_PHASE() : phase(1), - phaseTime(), flog(NULL) { gettimeofday(&phaseTime, NULL); } #else IA_PHASE::IA_PHASE() - : phase(1), - phaseTime() + : phase(1) { gettimeofday(&phaseTime, NULL); } @@ -535,15 +529,14 @@ int AUTH_IA::Reload(const MODULE_SETTINGS & ms) AUTH_IA_SETTINGS newIaSettings; if (newIaSettings.ParseSettings(ms)) { - STG_LOGGER & WriteServLog = GetStgLogger(); printfd(__FILE__, "AUTH_IA::Reload() - Failed to reload InetAccess.\n"); - WriteServLog("AUTH_IA: Cannot reload InetAccess. Errors found."); + logger("AUTH_IA: Cannot reload InetAccess. Errors found."); return -1; } -STG_LOGGER & WriteServLog = GetStgLogger(); printfd(__FILE__, "AUTH_IA::Reload() - Reloaded InetAccess successfully.\n"); -WriteServLog("AUTH_IA: Reloaded InetAccess successfully."); +logger("AUTH_IA: Reloaded InetAccess successfully."); +iaSettings = newIaSettings; return 0; } //-----------------------------------------------------------------------------