Loading client/client.cpp +9 −8 Changes for client/client.cpp: 9 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -27,14 +27,12 @@ #include "client.h" #include "../src/hash/sha512.h" authdb::ClientConnection::ClientConnection(){ _Socket=nullptr; _Client=nullptr; } authdb::ClientConnection::~ClientConnection(){ delete _Socket; delete _Client; } void authdb::ClientConnection::setUrl(const char *url){ Loading @@ -54,10 +52,13 @@ void authdb::ClientConnection::setUsername(const char *username){ } void authdb::ClientConnection::setUserPassword(const char *password){ sha512 sha; sha.hash(password,_UserPasswordHash); _UserPassword=password; } authdb::Client::Client(ClientConnection& clt) : _Con(clt){ _Con._Client=new libhttppp::HttpClient(_Con._Url); } authdb::Client::Client(ClientConnection& clt){ _Con=clt; authdb::Client::~Client(){ delete _Con._Client; } client/client.h +8 −6 Changes for client/client.h: 8 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include <string> #include <netplus/socket.h> #include <httppp/http.h> #include "../src/uuid.h" #include "../src/session.h" Loading @@ -49,9 +49,9 @@ namespace authdb { std::string _CltName; std::string _CltSecret; std::string _UserName; std::string _UserPasswordHash; std::string _UserPassword; netplus::socket *_Socket; libhttppp::HttpClient *_Client; uuid _SessionID; uuid _ClientId; friend class Client; Loading @@ -60,6 +60,8 @@ namespace authdb { class Client { public: Client(ClientConnection &clt); ~Client(); bool UserAuth(); bool ClientAuth(); Loading @@ -68,14 +70,14 @@ namespace authdb { void add(const std::string &clientname,const std::string &cltsecret); void rem(const std::string &clientname); bool check(const std::string &clientname); }; } CCon; class GPO { public: bool check(uuid gpoid,const SessionData &sdat); }; } CGPO; private: ClientConnection _Con; ClientConnection &_Con; }; }; Loading
client/client.cpp +9 −8 Changes for client/client.cpp: 9 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -27,14 +27,12 @@ #include "client.h" #include "../src/hash/sha512.h" authdb::ClientConnection::ClientConnection(){ _Socket=nullptr; _Client=nullptr; } authdb::ClientConnection::~ClientConnection(){ delete _Socket; delete _Client; } void authdb::ClientConnection::setUrl(const char *url){ Loading @@ -54,10 +52,13 @@ void authdb::ClientConnection::setUsername(const char *username){ } void authdb::ClientConnection::setUserPassword(const char *password){ sha512 sha; sha.hash(password,_UserPasswordHash); _UserPassword=password; } authdb::Client::Client(ClientConnection& clt) : _Con(clt){ _Con._Client=new libhttppp::HttpClient(_Con._Url); } authdb::Client::Client(ClientConnection& clt){ _Con=clt; authdb::Client::~Client(){ delete _Con._Client; }
client/client.h +8 −6 Changes for client/client.h: 8 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include <string> #include <netplus/socket.h> #include <httppp/http.h> #include "../src/uuid.h" #include "../src/session.h" Loading @@ -49,9 +49,9 @@ namespace authdb { std::string _CltName; std::string _CltSecret; std::string _UserName; std::string _UserPasswordHash; std::string _UserPassword; netplus::socket *_Socket; libhttppp::HttpClient *_Client; uuid _SessionID; uuid _ClientId; friend class Client; Loading @@ -60,6 +60,8 @@ namespace authdb { class Client { public: Client(ClientConnection &clt); ~Client(); bool UserAuth(); bool ClientAuth(); Loading @@ -68,14 +70,14 @@ namespace authdb { void add(const std::string &clientname,const std::string &cltsecret); void rem(const std::string &clientname); bool check(const std::string &clientname); }; } CCon; class GPO { public: bool check(uuid gpoid,const SessionData &sdat); }; } CGPO; private: ClientConnection _Con; ClientConnection &_Con; }; };