Class UserLoginForm

Description

The UserLoginForm control class.

This control can be used to log in a user to any Wigbi application, using the built-in login functionality of the User seed.

The control can be added to the page with the PHP and JavaScript add functions and can then be retrieved with Wigbi.getControl(id). It requires the User seed.

JAVASCRIPT ********************************

UserLoginForm : BaseControl

Properties:

  • public string redirectPage()
  • public string setRedirectPage(string newVal)

Functions:

  • [ASYNC] public static void add(string controlId, string redirectPage, string targetElementId, function onAdd())
  • [ASYNC] public static void login(string userName, string password, function onLogin(string errorCode))
  • public void reset()
  • [ASYNC] public void submit()

Events:

  • public bool onPreSubmit()
  • public void onSubmit()
  • public void onSubmitError(string[] errorList)
  • public void onValidate(string[] errorList)

Override onPreSubmit to set what to do before the form is being submitted. If it returns false, the submit operation will abort.

Override onSubmit to set what to do when the submit operation has finished. By default, it does nothing.

Override onSubmitError to set what to do when a submit operation fails. By default, it alerts all errors in the error list.

Override onValidate to set what to do when the object has been validated. By default, it binds the result to the form.

LANGUAGE HANDLING *************************

The following language parameters are used by the control:

  • [controlId] UserLoginForm password
  • [controlId] UserLoginForm passwordInvalid
  • [controlId] UserLoginForm passwordRequired
  • [controlId] UserLoginForm submit
  • [controlId] UserLoginForm submitted
  • [controlId] UserLoginForm submitting
  • [controlId] UserLoginForm submitError
  • [controlId] UserLoginForm submitErrorMessage
  • [controlId] UserLoginForm reset
  • [controlId] UserLoginForm userName
  • [controlId] UserLoginForm userNameInvalid
  • [controlId] UserLoginForm userNameRequired

Located in /wigbi_controls/UserLoginForm.php (line 98)

BaseControl
   |
   --UserLoginForm
Method Summary
 static void add (string $controlId, [string $redirectPage = ""], [bool $redirectOnLoad = true])
 static string login (string $userName, string $password)
 UserLoginForm __construct ()
Methods
static add (line 278)

Add a UserLoginForm control to the page.

If the user is already logged in and redirectOnLoad is set to true, the control will redirect the user to the redirect page, if one is specified.

  • access: public
static void add (string $controlId, [string $redirectPage = ""], [bool $redirectOnLoad = true])
  • string $controlId: The unique control ID.
  • string $redirectPage: The page to redirect to after login, if any; default blank.
  • bool $redirectOnLoad: Whether or not to redirect if the user is logged in as the page loads; default true.
static login (line 322)

Attempt to login a user, using a certain user name and password.

  • return: An error code; empty if no error occured.
  • access: public
static string login (string $userName, string $password)
  • string $userName: The unique user name.
  • string $password: The user password.
Constructor __construct (line 109)

Create an instance of the control.

This constructor is only intended to be used by Wigbi at startup.

  • access: public
UserLoginForm __construct ()

Redefinition of:
BaseControl::__construct()
Create an instance of the class.

Inherited Methods

Inherited From BaseControl

 BaseControl::__construct()
 BaseControl::closeForm()
 BaseControl::controlId()
 BaseControl::isPostBackSource()
 BaseControl::javaScript()
 BaseControl::openForm()
 BaseControl::registerJavaScript()
 BaseControl::submit()

Documentation generated on Sun, 27 Dec 2009 20:12:07 +0100 by phpDocumentor 1.4.1