X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/068f824958f4864fb9c6f03484bf470e0cb61098..9d9d76eb11d3cd854907adaacbef5812f9d0b996:/projects/stargazer/user_impl.h diff --git a/projects/stargazer/user_impl.h b/projects/stargazer/user_impl.h index 2fc563df..6f6030ca 100644 --- a/projects/stargazer/user_impl.h +++ b/projects/stargazer/user_impl.h @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -182,10 +183,12 @@ public: bool GetConnected() const { return connected; } time_t GetConnectedModificationTime() const { return connected.ModificationTime(); } - int GetAuthorized() const { return authorizedBy.size(); } + int GetAuthorized() const { return static_cast(authorizedBy.size()); } int Authorize(uint32_t ip, uint32_t enabledDirs, const AUTH * auth); - void Unauthorize(const AUTH * auth); + void Unauthorize(const AUTH * auth, + const std::string & reason = std::string()); bool IsAuthorizedBy(const AUTH * auth) const; + std::vector GetAuthorizers() const; int AddMessage(STG_MSG * msg); @@ -197,8 +200,8 @@ public: const std::string & GetStrError() const { return errorStr; } - USER_PROPERTIES & GetProperty() { return property; }; - const USER_PROPERTIES & GetProperty() const { return property; }; + USER_PROPERTIES & GetProperty() { return property; } + const USER_PROPERTIES & GetProperty() const { return property; } void SetDeleted() { deleted = true; } bool GetDeleted() const { return deleted; } @@ -247,6 +250,7 @@ private: USER_PROPERTY currIP; uint32_t lastIPForDisconnect; // User's ip after unauth but before disconnect + std::string lastDisconnectReason; time_t pingTime;