Make sql connection public to share same connection pool. Layout calls for user info from DB. Implement login path.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include <Wt/WLineEdit>
|
||||
#include <Wt/WText>
|
||||
#include "../WebInterface.h"
|
||||
#include <Wt/Dbo/Session>
|
||||
|
||||
class LoginInterface : public Wt::WContainerWidget
|
||||
{
|
||||
@@ -42,7 +43,14 @@ private:
|
||||
Wt::WContainerWidget* passwordContainer;
|
||||
Wt::WLineEdit* usernameField;
|
||||
Wt::WLineEdit* passwordField;
|
||||
Wt::WText* loginMessage;
|
||||
WebInterface* app;
|
||||
void loginCheck();
|
||||
void createUser(Wt::Dbo::Session* session, std::string username, std::string rawPassword, bool isAdmin);
|
||||
int getUserCount(Wt::Dbo::Session* session);
|
||||
User* getUserForLoginCookie(Wt::Dbo::Session* session, std::string cookie);
|
||||
User* getUserForLoginAuth(Wt::Dbo::Session* session, std::string username, std::string rawPassword);
|
||||
void setLocalCookieForUser(User user);
|
||||
};
|
||||
|
||||
#endif // LOGININTERFACE_H
|
||||
|
||||
Reference in New Issue
Block a user