-
Notifications
You must be signed in to change notification settings - Fork 1
/
auth.h
executable file
·58 lines (46 loc) · 2 KB
/
auth.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/******************************************************
FileName: auth.h
Description: Contains Declarations of class AuthForm
Authors: Gauravjeet Singh, Shaina Sabarwal, Inderpreet Singh
License: GNU GPL V3
******************************************************/
#ifndef AUTH_H_
#define AUTH_H_
#include <Wt/WContainerWidget>
#include <Wt/Auth/AuthModel>
#include <Wt/Auth/AuthWidget>
#include <Wt/Auth/PasswordService>
#include "global.h"
//! Class for Authentication Forms
/*!
This class is inherited from WContainer Widget, it configures and displays the authentication form.
All the authentication related tasks are handlend by this Class
*/
class AuthForm : public Wt::WContainerWidget
{
private:
//! Container for the dashboard
WContainerWidget *dashContainer;
Session session_;
public:
//! A constructor for Authentication Form
/*! A constructor that accepts a WContainerWidget as a parent, then checks if there is a change in user session (logged in or logout) and depending upon that calls a function n authEvent, which performs the related authentication task.
It creates and configures AuthWidget from Wt::Auth::AuthWidget which gives us the front end part of our Authentication form.
*/
AuthForm(Wt::WContainerWidget *parent);
//! A function that performs Authentication task
/*!
authEvent() is called by constructor whenever there is a change in the state of session (logs in or logs out), and depending upon that auth event performs the necessary task
It also logs whenever a user logs in or logs out
*/
void authEvent();
//! A function to provide the register facility
/*!
registerAdmin() is called in the constructor of this class, It first checks whether the admin is already registered or not. If not, it provides with the registration values otherwise those fields are not visible.
*/
void registerAdmin();
//! AuthWidget, making a common widget for all auth related things like login, register and logout
Wt::Auth::AuthWidget *authWidget;
bool setLogin;
};
#endif