Wt  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions
Wt::Auth::Login Class Reference

A class that manages the current login state. More...

#include <Wt/Auth/Login>

Inheritance diagram for Wt::Auth::Login:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Login ()
 Default constructor.
void login (const User &user, LoginState state=StrongLogin)
 Logs a user in.
void logout ()
 Logs the current user out.
LoginState state () const
 Returns the current login state.
bool loggedIn () const
 Returns whether a user has successfully logged in.
const Useruser () const
 Returns the user currently identified.
Signalchanged ()
 Signal that indicates login changes.
- Public Member Functions inherited from Wt::WObject
 WObject (WObject *parent=0)
 Create a WObject with a given parent object.
virtual ~WObject ()
 Destructor.
virtual const std::string id () const
 Returns the (unique) identifier for this object.
void setObjectName (const std::string &name)
 Sets an object name.
virtual std::string objectName () const
 Returns the object name.
void resetLearnedSlots ()
 Resets learned stateless slot implementations.
template<class T >
void resetLearnedSlot (void(T::*method)())
 Resets a learned stateless slot implementation.
template<class T >
WStatelessSlot * implementStateless (void(T::*method)())
 Declares a slot to be stateless and learn client-side behaviour on first invocation.
template<class T >
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
 Declares a slot to be stateless and learn client-side behaviour in advance.
template<class T >
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
 Provides a JavaScript implementation for a method.
void addChild (WObject *child)
 Adds a child object.
virtual void removeChild (WObject *child)
 Removes a child object.
const std::vector< WObject * > & children () const
 Returns the children.
WObjectparent () const
 Returns the parent object.

Additional Inherited Members

- Public Types inherited from Wt::WObject
typedef void(WObject::* Method )()
 Typedef for a WObject method without arguments.
- Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * getStateless (Method method)
 On-demand stateless slot implementation.
- Static Protected Member Functions inherited from Wt::WObject
static WObjectsender ()
 Returns the sender of the current slot call.

Detailed Description

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.

See also:
AuthWidget

Constructor & Destructor Documentation

Wt::Auth::Login::Login ( )

Default constructor.

Creates a login object in the LoggedOut state.


Member Function Documentation

Signal& Wt::Auth::Login::changed ( )

Signal that indicates login changes.

This signal is emitted as a result of login() or logout().

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.

See also:
state()
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.

See also:
logout(), loggedIn()
void Wt::Auth::Login::logout ( )

Logs the current user out.

Sets the state to LoggedOut.

LoginState Wt::Auth::Login::state ( ) const

Returns the current login state.

See also:
login(), logout()
const User & Wt::Auth::Login::user ( ) const

Returns the user currently identified.

Returns the user currently identified.

Note:
This may also be a user whose account is currently disabled.

Generated on Sun May 27 2012 for the C++ Web Toolkit (Wt) by doxygen 1.8.1