/usr/include/Wt/Auth/RegistrationWidget is in libwt-dev 3.3.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2011 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef WT_AUTH_REGISTRATION_WIDGET_H_
#define WT_AUTH_REGISTRATION_WIDGET_H_
#include <Wt/WTemplateFormView>
#include <Wt/Auth/RegistrationModel>
namespace Wt {
namespace Auth {
class AuthWidget;
class Login;
class OAuthProcess;
/*! \class RegistrationWidget Wt/Auth/RegistrationWidget
* \brief A registration widget.
*
* This implements a widget which allows a new user to register. The
* widget renders the <tt>"Wt.Auth.template.registration"</tt>
* template. and uses a RegistrationModel for the actual registration
* logic.
*
* Typically, you may want to specialize this widget to ask for other
* information.
*
* \ingroup auth
*/
class WT_API RegistrationWidget : public WTemplateFormView
{
public:
/*! \brief Constructor
*
* Creates a new authentication.
*/
RegistrationWidget(AuthWidget *authWidget = 0);
/*! \brief Sets the registration model.
*/
void setModel(RegistrationModel *model);
/*! \brief Returns the registration model.
*
* This returns the model that is used by the widget to do the actual
* registration.
*/
RegistrationModel *model() const { return model_; }
/*! \brief Updates the user-interface.
*
* This updates the user-interface to reflect the current state of the
* model.
*/
void update();
protected:
/*! \brief 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.
*/
virtual bool validate();
/*! \brief 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.
*/
virtual void doRegister();
/*! \brief Closes the registration widget.
*
* The default implementation simply deletes the widget.
*/
virtual void close();
/*! \brief 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.
*/
virtual void registerUserDetails(User& user);
virtual void render(WFlags<RenderFlag> flags);
protected:
virtual WFormWidget *createFormWidget(RegistrationModel::Field field);
private:
AuthWidget *authWidget_;
RegistrationModel *model_;
bool created_;
Login *confirmPasswordLogin_;
void checkLoginName();
void checkPassword();
void checkPassword2();
void confirmIsYou();
void confirmedIsYou();
void oAuthDone(OAuthProcess *oauth, const Identity& identity);
};
}
}
#endif // WT_AUTH_REGISTRATION_WIDGET_H_
|