]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
Fix multiple typo: "alredy" -> "already"
[stg.git] / projects / stargazer / plugins / authorization / inetaccess / inetaccess.cpp
index 3918f0b30c7a1ec6366fc5a72d0fe158f56f9994..439bee185ed3aabf03201ffdcaf104a1dd966a6e 100644 (file)
@@ -30,6 +30,8 @@
 
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/select.h>
+#include <unistd.h> // usleep, close
 
 #include <csignal>
 #include <cstdlib>
 #include <cerrno>
 #include <algorithm>
 
+#include "stg/common.h"
+#include "stg/locker.h"
+#include "stg/tariff.h"
+#include "stg/user_property.h"
+#include "stg/settings.h"
 #include "inetaccess.h"
-#include "common.h"
-#include "stg_locker.h"
-#include "tariff.h"
-#include "../../../settings.h"
-#include "../../../user_property.h"
 
 extern volatile const time_t stgTime;
 
@@ -861,8 +863,8 @@ if ((*user)->GetProperty().passive.Get())
 
 if ((*user)->GetAuthorized() && (*user)->GetCurrIP() != sip)
     {
-    printfd(__FILE__, "Login %s alredy in use. IP \'%s\'\n", (*user)->GetLogin().c_str(), inet_ntostring(sip).c_str());
-    WriteServLog("Login %s alredy in use. IP \'%s\'", (*user)->GetLogin().c_str(), inet_ntostring(sip).c_str());
+    printfd(__FILE__, "Login %s already in use. IP \'%s\'\n", (*user)->GetLogin().c_str(), inet_ntostring(sip).c_str());
+    WriteServLog("Login %s already in use. IP \'%s\'", (*user)->GetLogin().c_str(), inet_ntostring(sip).c_str());
     SendError(sip, sport, protoVer, "÷ÁÛ ÌÏÇÉΠÕÖÅ ÉÓÐÏÌØÚÕÅÔÓÑ!");
     return 0;
     }
@@ -870,8 +872,8 @@ if ((*user)->GetAuthorized() && (*user)->GetCurrIP() != sip)
 USER_PTR u;
 if (users->FindByIPIdx(sip, &u) == 0 && u->GetLogin() != (*user)->GetLogin())
     {
-    printfd(__FILE__, "IP address alredy in use. IP \'%s\'", inet_ntostring(sip).c_str());
-    WriteServLog("IP address alredy in use. IP \'%s\'", inet_ntostring(sip).c_str());
+    printfd(__FILE__, "IP address already in use. IP \'%s\'", inet_ntostring(sip).c_str());
+    WriteServLog("IP address already in use. IP \'%s\'", inet_ntostring(sip).c_str());
     SendError(sip, sport, protoVer, "÷ÁÛ IP ÁÄÒÅÓ ÕÖÅ ÉÓÐÏÌØÚÕÅÔÓÑ!");
     return 0;
     }
@@ -1293,7 +1295,7 @@ if ((iaUser->phase.GetPhase() == 2) && (connAck->rnd == iaUser->rnd + 1))
     iaUser->phase.UpdateTime();
 
     iaUser->lastSendAlive = iaUser->phase.GetTime();
-    if (iaUser->user->Authorize(sip, "", enabledDirs, this) == 0)
+    if (iaUser->user->Authorize(sip, enabledDirs, this) == 0)
         {
         iaUser->phase.SetPhase3();
         printfd(__FILE__, "Phase changed from 2 to 3. Reason: CONN_ACK_6\n");
@@ -1328,7 +1330,7 @@ if ((iaUser->phase.GetPhase() == 2) && (connAck->rnd == iaUser->rnd + 1))
     {
     iaUser->phase.UpdateTime();
     iaUser->lastSendAlive = iaUser->phase.GetTime();
-    if (iaUser->user->Authorize(sip, "", enabledDirs, this) == 0)
+    if (iaUser->user->Authorize(sip, enabledDirs, this) == 0)
         {
         iaUser->phase.SetPhase3();
         printfd(__FILE__, "Phase changed from 2 to 3. Reason: CONN_ACK_8\n");