Wt
3.7.1
|
A class that manages the current login state. More...
#include <Wt/Auth/Login>
Public Member Functions | |
Login () | |
Default constructor. More... | |
void | login (const User &user, LoginState state=StrongLogin) |
Logs a user in. More... | |
void | logout () |
Logs the current user out. More... | |
LoginState | state () const |
Returns the current login state. More... | |
bool | loggedIn () const |
Returns whether a user has successfully logged in. More... | |
const User & | user () const |
Returns the user currently identified. More... | |
Signal & | changed () |
Signal that indicates login changes. More... | |
![]() | |
WObject (WObject *parent=0) | |
Create a WObject with a given parent object. More... | |
virtual | ~WObject () |
Destructor. More... | |
virtual const std::string | id () const |
Returns the (unique) identifier for this object. More... | |
virtual void | setObjectName (const std::string &name) |
Sets an object name. More... | |
virtual std::string | objectName () const |
Returns the object name. More... | |
void | resetLearnedSlots () |
Resets learned stateless slot implementations. More... | |
template<class T > | |
void | resetLearnedSlot (void(T::*method)()) |
Resets a learned stateless slot implementation. More... | |
template<class T > | |
WStatelessSlot * | implementStateless (void(T::*method)()) |
Declares a slot to be stateless and learn client-side behaviour on first invocation. More... | |
template<class T > | |
WStatelessSlot * | implementStateless (void(T::*method)(), void(T::*undoMethod)()) |
Declares a slot to be stateless and learn client-side behaviour in advance. More... | |
void | isNotStateless () |
Marks the current function as not stateless. More... | |
template<class T > | |
WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode) |
Provides a JavaScript implementation for a method. More... | |
void | addChild (WObject *child) |
Adds a child object. More... | |
virtual void | removeChild (WObject *child) |
Removes a child object. More... | |
const std::vector< WObject * > & | children () const |
Returns the children. | |
WObject * | parent () const |
Returns the parent object. | |
Additional Inherited Members | |
![]() | |
typedef void(WObject::* | Method) () |
Typedef for a WObject method without arguments. | |
![]() | |
virtual WStatelessSlot * | getStateless (Method method) |
On-demand stateless slot implementation. More... | |
![]() | |
static WObject * | sender () |
Returns the sender of the current slot call. More... | |
A class that manages the current login state.
This is a model class which is typically associated with a single session, for the duration of the session.
Widgets that implement authentication (and thus produce authentication changes), will indicate their result in this object using the login() or logout() methods.
Widgets that want to react to login state changes (typically, as user logging in or out) should listen to the changed() signal of this object.
Wt::Auth::Login::Login | ( | ) |
Default constructor.
Creates a login object in the LoggedOut state.
Signal& Wt::Auth::Login::changed | ( | ) |
Signal that indicates login changes.
This signal is emitted as a result of login() or logout(). If no user was logged in, then a changed() signal does not necessarily mean that user is loggedIn() as the user may have been identified correctly but have a DisabledLogin state() for example.
bool Wt::Auth::Login::loggedIn | ( | ) | const |
Returns whether a user has successfully logged in.
This returns true
only if the state is WeakLogin or StrongLogin.
void Wt::Auth::Login::login | ( | const User & | user, |
LoginState | state = StrongLogin |
||
) |
Logs a user in.
A user can be logged in using either a DisabledLogin, WeakLogin or StrongLogin state
. The login state is forced to DisabledLogin if User::status() returns Disabled.
void Wt::Auth::Login::logout | ( | ) |
Logs the current user out.
Sets the state to LoggedOut.
LoginState Wt::Auth::Login::state | ( | ) | const |
const User & Wt::Auth::Login::user | ( | ) | const |
Returns the user currently identified.
Returns the user currently identified.