Wt
3.2.2
|
A registration widget. More...
#include <Wt/Auth/RegistrationWidget>
Public Member Functions | |
RegistrationWidget (AuthWidget *authWidget=0) | |
Constructor. | |
void | setModel (RegistrationModel *model) |
Sets the registration model. | |
RegistrationModel * | model () const |
Returns the registration model. | |
void | update () |
Updates the user-interface. | |
Protected Member Functions | |
virtual bool | validate () |
Validates the current information. | |
virtual void | doRegister () |
Performs the registration. | |
virtual void | close () |
Closes the registration widget. | |
virtual void | registerUserDetails (User &user) |
Registers more user information. | |
virtual WFormWidget * | createFormWidget (RegistrationModel::Field field) |
Creates a form widget. |
A registration widget.
This implements a widget which allows a new user to register. The widget renders the "Wt.Auth.template.registration"
template. and uses a RegistrationModel for the actual registration logic.
Typically, you may want to specialize this widget to ask for other information.
Wt::Auth::RegistrationWidget::RegistrationWidget | ( | AuthWidget * | authWidget = 0 | ) |
Constructor.
Creates a new authentication.
void Wt::Auth::RegistrationWidget::close | ( | ) | [protected, virtual] |
Closes the registration widget.
The default implementation simply deletes the widget.
WFormWidget * Wt::Auth::RegistrationWidget::createFormWidget | ( | RegistrationModel::Field | field | ) | [protected, virtual] |
Creates a form widget.
This method is called by updateViewField() when it needs to create a form widget for a field. You either need to make sure these widgets have been created and bound before calling updateView(), or you need to specialize this method to do it on-demand.
Reimplemented from Wt::WTemplateFormView.
void Wt::Auth::RegistrationWidget::doRegister | ( | ) | [protected, virtual] |
Performs the registration.
The default implementation checks if the information is valid with validate(), and then calls RegistrationModel::doRegister(). If registration was successful, it calls registerUserDetails() and subsequently logs the user in.
RegistrationModel* Wt::Auth::RegistrationWidget::model | ( | ) | const |
Returns the registration model.
This returns the model that is used by the widget to do the actual registration.
void Wt::Auth::RegistrationWidget::registerUserDetails | ( | User & | user | ) | [protected, virtual] |
Registers more user information.
This method is called when a new user has been successfully registered.
You may want to reimplement this method if you've added other information to the registration form which needs to be annotated to the user.
void Wt::Auth::RegistrationWidget::update | ( | ) |
Updates the user-interface.
This updates the user-interface to reflect the current state of the model.
bool Wt::Auth::RegistrationWidget::validate | ( | ) | [protected, virtual] |
Validates the current information.
The default implementation simply calls RegistrationModel::validate() on the model.
You may want to reimplement this method if you've added other information to the registration form that need validation.